> 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/filter-streamed-telemetry.md).

# Filter Streamed Telemetry

By default, a ThousandEyes for OpenTelemetry integration exports all supported telemetry for its selected signal, data model version, and data sources. You can control the exported data by excluding specific metrics or attributes from an integration.

Common reasons to exclude attributes include:

* Reducing telemetry cardinality.
* Preventing specific supported attributes that contain personally identifiable information (PII) from being exported.

Filters match attribute names, not individual attribute values.

Filtering is configured separately for each integration. Metric and attribute names are matched exactly and are case-sensitive.

## Filter Behavior

The available filters depend on the integration signal:

| Signal  | Metric exclusions       | Attribute exclusions    |
| ------- | ----------------------- | ----------------------- |
| Metrics | Supported for v1 and v2 | Supported for v1 and v2 |
| Traces  | Not supported           | Supported for v2        |
| Logs    | Not supported           | Supported for v2        |

Metric exclusions remove each matching metric and all of its data points from the integration output.

Attribute exclusions remove each matching top-level attribute wherever that attribute is supported for the signal:

* **Metrics:** Resource, instrumentation scope, and data point attributes.
* **Traces:** Resource, instrumentation scope, and span attributes. Span event and span link attributes are not filtered.
* **Logs:** Resource, instrumentation scope, and log record attributes.

Excluding an attribute does not remove its resource, span, log record, metric, or data point. If an excluded attribute is not present in a telemetry item, that item is unchanged.

{% hint style="info" %}
Filtering changes may take a short time to appear in exported telemetry while the integration configuration is refreshed.
{% endhint %}

## Supported Metric and Attribute Names

The filter options are based on the integration's signal and data model version. Use the metric and attribute names documented in the corresponding data model:

| Data model and signal | Catalog                                                                                                                                                                                                                                                                                     |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Data model v1 metrics | [Metrics](https://docs.thousandeyes.com/product-documentation/integration-guides/opentelemetry/data-model/data-model-v1#metrics) and [attributes](https://docs.thousandeyes.com/product-documentation/integration-guides/opentelemetry/data-model/data-model-v1#attributes)                 |
| Data model v2 metrics | [Metrics](https://docs.thousandeyes.com/product-documentation/integration-guides/opentelemetry/data-model/data-model-v2/metrics#metrics) and [attributes](https://docs.thousandeyes.com/product-documentation/integration-guides/opentelemetry/data-model/data-model-v2/metrics#attributes) |
| Data model v2 traces  | [Trace attributes](https://docs.thousandeyes.com/product-documentation/integration-guides/opentelemetry/data-model/data-model-v2/traces#attributes)                                                                                                                                         |
| Data model v2 logs    | [Log attributes](https://docs.thousandeyes.com/product-documentation/integration-guides/opentelemetry/data-model/data-model-v2/logs#attributes)                                                                                                                                             |

The following attributes are reserved and cannot be excluded:

| Data model version | Reserved attributes                                                              |
| ------------------ | -------------------------------------------------------------------------------- |
| v1                 | `account.id`, `thousandeyes.data.version`, `thousandeyes.stream.id`              |
| v2                 | `thousandeyes.account.id`, `thousandeyes.data.version`, `thousandeyes.stream.id` |

The UI does not display reserved attributes in its selectors. API requests can contain only names supported for the selected signal and data model version. Names that are not in the supported filter catalog, including attributes created dynamically from tags, are rejected.

## Configure Filtering Using the UI

You can configure filtering while creating an integration or operation, or by editing an existing one.

### Integrations 1.0

1. In the ThousandEyes platform, go to **Manage > Integrations > Integrations 1.0**.
2. Create a ThousandEyes for OpenTelemetry integration, or select an existing integration and click **Edit**.
3. If you are creating an integration, select the **OpenTelemetry Signal** and **Data Model Version**. If you are editing an existing integration, verify its read-only **OpenTelemetry Signal** and **Data Model Version** values. These values determine which filter options are available.
4. In **Filter Configuration**, select the data to exclude:
   * For a metric stream, use **Metrics** to exclude metrics and **Specific Metric Attributes** to exclude attributes.
   * For a trace or log stream, use **Specific Attributes** to exclude attributes.
5. Click **Save**.

### Integrations 2.0

1. In the ThousandEyes platform, go to **Manage > Integrations > Integrations 2.0**.
2. Create or edit an OpenTelemetry operation and assign a connector.
3. If you are creating an operation, select the **OpenTelemetry Signal**. If you are editing an existing operation, verify its read-only **OpenTelemetry Signal** value. Integrations 2.0 filter options use data model v2.
4. In **Filter Configuration**, select the data to exclude:
   * For a metric stream, use **Metrics** to exclude metrics and **Specific Metric Attributes** to exclude attributes.
   * For a trace or log stream, use **Specific Attributes** to exclude attributes.
5. Click **Save**.

The selectors show how many supported names are excluded. If you leave a selector empty, the integration exports all supported metrics or attributes for that selector.

## Configure Filtering Using the API

Use `filters.metricsFilter.excludedMetrics` and `filters.attributesFilter.excludedAttributes` when you create or update a stream. The following example creates a data model v2 metric stream that excludes `network.loss` and the `server.address` attribute:

```curl
curl -i -X POST https://api.thousandeyes.com/v7/streams \
  -H "Authorization: Bearer $BEARER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "opentelemetry",
    "name": "Filtered metrics stream",
    "signal": "metric",
    "endpointType": "http",
    "streamEndpointUrl": "https://example.com/v1/metrics",
    "dataModelVersion": "v2",
    "testMatch": [
      {
        "id": "987654",
        "domain": "cea"
      }
    ],
    "filters": {
      "metricsFilter": {
        "excludedMetrics": [
          "network.loss"
        ]
      },
      "attributesFilter": {
        "excludedAttributes": [
          "server.address"
        ]
      }
    }
  }'
```

For trace and log streams, omit `metricsFilter` and configure only `attributesFilter`.

When updating an integration with `PUT /v7/streams/{id}`:

* Omitting a filter preserves its current exclusions.
* Sending an empty `excludedMetrics` or `excludedAttributes` array clears the corresponding exclusions.
* Sending null as the value of `excludedMetrics` or `excludedAttributes`, an unsupported name, or a metric exclusion for a trace or log stream causes validation to fail.

For the complete endpoint schema and response definitions, see the [ThousandEyes for OpenTelemetry API](https://developer.cisco.com/docs/thousandeyes/thousandeyes-for-opentelemetry-api-overview/).
