# 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>meta.signal\_type</code></li><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.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>meta.signal\_type</code></li><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.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>meta.signal\_type</code></li><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.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**                                                                                                                                    |
| ------------------------------------------------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `meta.signal_type`                               | String   | OpenTelemetry Signal type. Possible values: `trace`                                                                                                |
| `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 route the data point to the external service                                                                       |
| `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 set of fields that should be populated:

| **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 should be 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`.

All tags are streamed as attributes unless they contain characters that are not compliant with the[OpenTelemetry naming conventions for attributes](https://opentelemetry.io/docs/specs/semconv/general/naming/#recommendations-for-application-developers). Non-compliant tags are excluded from the `Resource` attribute.

When a tag is converted to an attribute, some tags may 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 attribute is represented as a `string`.
* **Multiple values**: If there are several values for the same key, the attribute value will be represented as an array containing the `string` elements that are the values associated with the tag's `key`.
* **Shared tags**: If tests and Cloud and Enterprise Agents are assigned to the same *tag*, the unique set of values are provided as attribute values.

#### Example

Consider the following scenario where:

* 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_metrics {
    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 {
          array_value: {
            values: [
              {
                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" %}
Note that not all observability platforms accommodate the use of string arrays for attribute values. For instance, New Relic and Splunk Observability Cloud does not support this format. If your backend does not support string arrays for attributes, the tag attribute is excluded from the metric or the whole datapoint is excluded.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.thousandeyes.com/product-documentation/integration-guides/opentelemetry/data-model/data-model-v2/traces.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
