> For the complete documentation index, see [llms.txt](https://docs.thousandeyes.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.thousandeyes.com/product-documentation/integration-guides/opentelemetry/data-model/data-model-v2/traces.md).

# ThousandEyes for OpenTelemetry Data Model v2 - Traces

## Supported Test Types

### **Network & App Synthetics Tests**

{% hint style="info" %}
In the context of this page, a layer refers to the specific category of trace data generated by a ThousandEyes test that is available for export through OpenTelemetry.
{% endhint %}

* Transaction tests support only the `transaction` layer.
* Page load and API tests support only the `page-load` and `API` layers, respectively.

| **Test type** | **Resource attributes**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | **Span attributes**                                                                                                                                                                                                     |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Page load     | <ul><li><code>service.name</code></li><li><code>thousandeyes.account.id</code></li><li><code>thousandeyes.data.version</code></li><li><code>thousandeyes.permalink</code></li><li><code>thousandeyes.source.agent.id</code></li><li><code>thousandeyes.source.agent.location</code></li><li><code>thousandeyes.source.agent.name</code></li><li><code>thousandeyes.source.agent.geoname.id</code></li><li><code>thousandeyes.source.agent.geo.region.iso\_code</code></li><li><code>thousandeyes.source.agent.geo.country.iso\_code</code></li><li><code>thousandeyes.stream.id</code></li><li><code>thousandeyes.stream.name</code></li><li><code>thousandeyes.test.domain</code></li><li><code>thousandeyes.test.id</code></li><li><code>thousandeyes.test.name</code></li><li><code>thousandeyes.test.type</code></li></ul> | <ul><li><code>http.request.method</code></li><li><code>http.response.code</code></li><li><code>server.address</code></li><li><code>server.port</code></li><li><code>url.full</code></li></ul>                           |
| Transaction   | <ul><li><code>service.name</code></li><li><code>thousandeyes.account.id</code></li><li><code>thousandeyes.data.version</code></li><li><code>thousandeyes.permalink</code></li><li><code>thousandeyes.source.agent.id</code></li><li><code>thousandeyes.source.agent.location</code></li><li><code>thousandeyes.source.agent.name</code></li><li><code>thousandeyes.source.agent.geoname.id</code></li><li><code>thousandeyes.source.agent.geo.region.iso\_code</code></li><li><code>thousandeyes.source.agent.geo.country.iso\_code</code></li><li><code>thousandeyes.stream.id</code></li><li><code>thousandeyes.stream.name</code></li><li><code>thousandeyes.test.domain</code></li><li><code>thousandeyes.test.id</code></li><li><code>thousandeyes.test.name</code></li><li><code>thousandeyes.test.type</code></li></ul> | <ul><li><code>http.request.method</code></li><li><code>http.response.code</code></li><li><code>server.address</code></li><li><code>server.port</code></li><li><code>url.full</code></li></ul>                           |
| API           | <ul><li><code>service.name</code></li><li><code>thousandeyes.account.id</code></li><li><code>thousandeyes.data.version</code></li><li><code>thousandeyes.permalink</code></li><li><code>thousandeyes.source.agent.id</code></li><li><code>thousandeyes.source.agent.location</code></li><li><code>thousandeyes.source.agent.name</code></li><li><code>thousandeyes.source.agent.geoname.id</code></li><li><code>thousandeyes.source.agent.geo.region.iso\_code</code></li><li><code>thousandeyes.source.agent.geo.country.iso\_code</code></li><li><code>thousandeyes.stream.id</code></li><li><code>thousandeyes.stream.name</code></li><li><code>thousandeyes.test.domain</code></li><li><code>thousandeyes.test.id</code></li><li><code>thousandeyes.test.name</code></li><li><code>thousandeyes.test.type</code></li></ul> | <ul><li><code>http.request.method</code></li><li><code>http.response.code</code></li><li><code>server.address</code></li><li><code>server.port</code></li><li><code>url.full</code></li><li><code>step</code></li></ul> |

## Attributes

The OpenTelemetry pipeline supports the following OTel attributes:

### Resource Attributes

| **Attribute**                                    | **Type** | **Description**                                                                                                                                    |
| ------------------------------------------------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `service.name`                                   | String   | Name of the service                                                                                                                                |
| `thousandeyes.account.id`                        | String   | The ID of the account that the telemetry data is associated with.                                                                                  |
| `thousandeyes.data.version`                      | String   | <p>Specifies the version of the data model. Possible values:</p><ul><li><code>v1</code></li><li><code>v2</code></li></ul>                          |
| `thousandeyes.permalink`                         | String   | ThousandEyes test permalink                                                                                                                        |
| `thousandeyes.source.agent.id`                   | String   | Identifies the ThousandEyes agent that ran the test                                                                                                |
| `thousandeyes.source.agent.location`             | String   | Location of the ThousandEyes source agent                                                                                                          |
| `thousandeyes.source.agent.name`                 | String   | Name of the ThousandEyes source agent                                                                                                              |
| `thousandeyes.source.agent.geoname.id`           | String   | The GeoNames ID of the ThousandEyes source agent that ran the test. For more information, see \[GeoNames]\(<https://www.geonames.org/about.html>). |
| `thousandeyes.source.agent.geo.region.iso_code`  | String   | ISO code for the region where the source agent is located.                                                                                         |
| `thousandeyes.source.agent.geo.country.iso_code` | String   | ISO code for the country where the source agent is located.                                                                                        |
| `thousandeyes.stream.id`                         | String   | UUID of the integration used to export the data.                                                                                                   |
| `thousandeyes.stream.name`                       | String   | Name of the integration used to export the data. This attribute changes when you rename the integration.                                           |
| `thousandeyes.test.domain`                       | String   | Identifies the origin of the test data. Possible values: `cea` (Network & App Synthetics)                                                          |
| `thousandeyes.test.id`                           | String   | Identifies the ThousandEyes test                                                                                                                   |
| `thousandeyes.test.name`                         | String   | Name of the ThousandEyes test                                                                                                                      |
| `thousandeyes.test.type`                         | String   | Identifies the type of test. Possible values: `"page-load"`, `"web-transactions"`, `"api"`                                                         |

### Span Attributes

| **Attribute**         | **Type** | **Description**                                                                                                                                                                                                                                                   |
| --------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `http.request.method` | String   | <p>HTTP request method. Enum:</p><ul><li><code>GET</code></li><li><code>POST</code></li><li><code>HEAD</code></li><li><code>PUT</code></li><li><code>DELETE</code></li><li><code>OPTIONS</code></li><li><code>PATCH</code></li><li><code>CONNECT</code></li></ul> |
| `http.response.code`  | Integer  | HTTP response code                                                                                                                                                                                                                                                |
| `server.address`      | String   | Server address                                                                                                                                                                                                                                                    |
| `server.port`         | Integer  | Server port                                                                                                                                                                                                                                                       |
| `url.full`            | String   | Full URL of the request                                                                                                                                                                                                                                           |
| `step`                | Integer  | Step ID for API tests. Identifies individual steps in multi-step API test sequences.                                                                                                                                                                              |

## Span Fields

Each span has a set of fields to populate:

| **Field**                   | **Type**                                                                                                                                                                       | **Description**                                                                                                                                                                                                                                                                                |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `trace_id`                  | String                                                                                                                                                                         | Trace ID representing the trace that the span is a part of                                                                                                                                                                                                                                     |
| `span_id`                   | String                                                                                                                                                                         | Span ID representing the span                                                                                                                                                                                                                                                                  |
| `parent_span_id` (optional) | String                                                                                                                                                                         | Parent span ID representing the parent span of the current span                                                                                                                                                                                                                                |
| `name`                      | String                                                                                                                                                                         | Name of the span                                                                                                                                                                                                                                                                               |
| `kind`                      | Enum                                                                                                                                                                           | <p>Kind of span. Enum:</p><ul><li><code>SPAN\_KIND\_UNSPECIFIED</code></li><li><code>SPAN\_KIND\_INTERNAL</code></li><li><code>SPAN\_KIND\_SERVER</code></li><li><code>SPAN\_KIND\_CLIENT</code></li><li><code>SPAN\_KIND\_PRODUCER</code></li><li><code>SPAN\_KIND\_CONSUMER</code></li></ul> |
| `start_time_unix_nano`      | Integer                                                                                                                                                                        | The start time of the span, expressed in the number of nanoseconds since the Unix epoch                                                                                                                                                                                                        |
| `end_time_unix_nano`        | Integer                                                                                                                                                                        | The end time of the span, expressed in the number of nanoseconds since the Unix epoch                                                                                                                                                                                                          |
| `status`                    | <p>Possible values for <code>code</code>:</p><ul><li><code>STATUS\_CODE\_UNSET</code></li><li><code>STATUS\_CODE\_OK</code></li><li><code>STATUS\_CODE\_ERROR</code></li></ul> | <p>Each span has a status. Status is structurally defined by the following properties:</p><ul><li><code>code</code>: Status code. It is an enumerated StatusCode, one of the values listed below.</li><li><code>message</code>: (Optional) Description of the status.</li></ul>                |

For more information on the OpenTelemetry data model, see the [OpenTelemetry specification](https://opentelemetry.io/docs/concepts/signals/traces/#span-status).

### Tags as Attributes

ThousandEyes converts [tags](https://developer.cisco.com/docs/thousandeyes/list-tags/) from tests and associated Cloud and Enterprise Agents into OpenTelemetry `Resource` attributes. Each tag consists of a `key` and a corresponding `value`.

If a stream uses `tagMatch`, `tagMatch` selects which tests are included in the stream. It does not limit which supported tags are converted to attributes.

Tags are streamed as attributes unless the tag key is not compliant with the [OpenTelemetry naming conventions for attributes](https://opentelemetry.io/docs/specs/semconv/general/naming/#recommendations-for-application-developers) or matches a ThousandEyes reserved OpenTelemetry attribute name. ThousandEyes excludes those tags from the `Resource` attributes.

When a tag is converted to an attribute, the tag key becomes the attribute name. Some tags might have multiple values or be shared between tests and agents. These cases are handled as follows:

* **Single value**: If a tag key has only one value, the value is represented as `string_value`.
* **Multiple values**: If there are several values for the same key, the value is represented as `array_value`, with each associated value as a `string_value` element.
* **Shared tags**: If tests and Cloud or Enterprise Agents are assigned to the same tag, the unique set of values is provided as the attribute value.

For more information, see [Tags and OpenTelemetry Streams](/product-documentation/integration-guides/opentelemetry/tags-and-opentelemetry-streams.md).

#### Example

Consider the following scenario:

* A stream is configured with test `1234` and the following tags:
  * `branch:sfo`
  * `branch:nyc`
  * `team:netops`
* The following tags are associated with test `1234`:
  * `branch:sfo`
  * `branch:nyc`
  * `team:netops`
  * `cluster:analytics`
* The following tags are associated with the source agent used by test `1234`:
  * `branch:sfo`
  * `location:us`

The resulting attributes would be structured as follows:

```
{
  resource_spans {
    resource {
      attributes {
        key: "branch"
        value {
          array_value: {
            values: [
              {
                string_value: "sfo"
              },
              {
                string_value: "nyc"
              }
            ]
          }
        }
      }
      attributes {
        key: "team"
        value {
          string_value: "netops"
        }
      }
      attributes {
        key: "cluster"
        value {
          string_value: "analytics"
        }
      }
      attributes {
        key: "location"
        value {
          string_value: "us"
        }
      }
    }
  }
}
```

**Notes**:

* The `branch:sfo` tag is not added twice to the `Resource` because the key-value pair already exists in the attributes.

{% hint style="info" %}
Not all observability platforms support string arrays for attribute values. For example, New Relic and Splunk Observability Cloud do not support this format. If your backend does not support string arrays for attributes, the tag attribute or the data point might be excluded.
{% endhint %}
