> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/traceable/agent-docs/apigee/non-blocking-agent/configuration.md).

# Traceable Apigee Policy Configuration

This document outlines the configuration options for the Traceable policy in Apigee.

## TraceableJS Configuration(Configure in the TraceableJS.xml file)

### Core Configuration Properties

| Property                                  | Required | Default                                    | Description                                                                                                                                                              |
| ----------------------------------------- | -------- | ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `ta_reporting_endpoint`                   | Yes\*    | `""`                                       | The reporting endpoint URL. Should be `http://TPA_HOST:5442` or `https://TPA_HOST:5443`. **\*Mandatory when using javascript\_callout**                                  |
| `ta_service_name`                         | No       | `"apigee"`                                 | Name of your service that will appear in the Traceable platform                                                                                                          |
| `ta_environment_name`                     | No       | `""`                                       | Optional environment name. If not provided, the TPA's environment name will be used                                                                                      |
| `ta_data_capture_body_max_size_bytes`     | No       | `131072`                                   | Maximum size in bytes for capturing request/response bodies                                                                                                              |
| `ta_data_capture_http_body_request`       | No       | `true`                                     | Enable/disable capturing of HTTP request bodies                                                                                                                          |
| `ta_data_capture_http_body_response`      | No       | `true`                                     | Enable/disable capturing of HTTP response bodies                                                                                                                         |
| `ta_data_capture_http_headers_request`    | No       | `true`                                     | Enable/disable capturing of HTTP request headers                                                                                                                         |
| `ta_data_capture_http_headers_response`   | No       | `true`                                     | Enable/disable capturing of HTTP response headers                                                                                                                        |
| `ta_data_capture_target_request_response` | No       | `false`                                    | Enable/disable capturing of target request/response data                                                                                                                 |
| `ta_data_capture_allowed_types`           | No       | `"json,graphql,x-www-form-urlencoded,xml"` | Comma-separated list of content types to capture                                                                                                                         |
| `ta_reporting_trace_reporter_type`        | No       | `"message_logging"`                        | Type of trace reporter. Options: message\_logging, service\_callout, javascript\_callout                                                                                 |
| `ta_extra_attribute_list`                 | No       | `""`                                       | Chain of context\_variable,attribute\_name separated by pipe (\|). Example: car.id,vehicle.car.id\|model.id,vehicletype.model.id                                         |
| `ta_header_exclude_key_prefix`            | No       | `""`                                       | Multiple prefixes separated by (\|) (single pipe). Headers whose keys start with any prefix will NOT be sent to TPA. Specify Header prefixes in lower case letters only. |

### Dynamic Configuration Override Properties

These properties allow you to specify context variable names that can dynamically override the default configuration values at runtime:

| Property                                      | Description                                                                 |
| --------------------------------------------- | --------------------------------------------------------------------------- |
| `ta_reporting_endpoint_var`                   | Context variable name to override `ta_reporting_endpoint`                   |
| `ta_service_name_var`                         | Context variable name to override `ta_service_name`                         |
| `ta_environment_name_var`                     | Context variable name to override `ta_environment_name`                     |
| `ta_data_capture_body_max_size_bytes_var`     | Context variable name to override `ta_data_capture_body_max_size_bytes`     |
| `ta_data_capture_http_body_request_var`       | Context variable name to override `ta_data_capture_http_body_request`       |
| `ta_data_capture_http_body_response_var`      | Context variable name to override `ta_data_capture_http_body_response`      |
| `ta_data_capture_http_headers_request_var`    | Context variable name to override `ta_data_capture_http_headers_request`    |
| `ta_data_capture_http_headers_response_var`   | Context variable name to override `ta_data_capture_http_headers_response`   |
| `ta_data_capture_target_request_response_var` | Context variable name to override `ta_data_capture_target_request_response` |
| `ta_data_capture_allowed_types_var`           | Context variable name to override `ta_data_capture_allowed_types`           |
| `ta_reporting_trace_reporter_type_var`        | Context variable name to override `ta_reporting_trace_reporter_type`        |
| `ta_header_exclude_key_prefix_var`            | Context variable name to override `ta_header_exclude_key_prefix`            |

## Message Logging policy usage

In your Platform agent deployment, ensure the Apigee log server is enabled. Edit the config.yaml file to configure the following:

```yaml
global:
  apigee_server:
    enabled: true
    message_end_token: "__SPAN_END__"
    server:
      endpoint: "0.0.0.0:8444"
      key_file: ""
      cert_file: ""
      max_queue_size: 1000
      max_buffer_size: 1024
```

* Ensure that port 8444 (or the configured port for the Apigee log server) of the instance where the Platform agent is installed is accessible from the Apigee servers.
* Note that the port of the Apigee log server is a TCP port. Make sure that from your Apigee setup, there should be outgoing data access to the TCP port of the Apigee log server (part of the Platform agent).

Also configure the host field in the ExportSpansML policy:

```xml
<Syslog>
    <Message>{TRACEABLE_DATA}__SPAN_END__</Message>
    <!-- Host IP/address TPA -->
    <Host>[TPA_IP]</Host>
</Syslog>
```

## Enabling ssl

If ssl needs to be enabled, follow the steps mentioned in the installation.md file

## ExportSpansSC Usage

Configure the following fields when this policy is being used

```xml
<Request>
    <Timeout>250</Timeout>
    <HTTPTargetConnection>
        <!-- The URL would be https://TPA_HOST:5443/ext_cap/v1/req_res_cap in case of TLS configuration -->
        <URL>http://TPA_HOST:5442/ext_cap/v1/req_res_cap</URL>
    </HTTPTargetConnection>
</Request>
```
