Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updates doc on otel resource attributes promoted to labels #10685

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
35 changes: 35 additions & 0 deletions docs/sources/mimir/configure/configure-otel-collector.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,41 @@ service:
exporters: [..., prometheusremotewrite]
```

## Work with default OpenTelemetry labels

OpenTelemetry metrics use resource attributes to describe the set of characteristics associated with a given resource, or entity producing telemetry data. For example, a host resource might have multiple attributes, including an ID, an image, and a type.

To optimize the storage of and ability to query this data, Mimir automatically assigns the following OTel resource attributes as labels at the time of ingestion, with periods (`.`) replaced by underscores (`_`):

- `service.instance.id`
- `service.name`
- `service.namespace`
- `service.version`
- `cloud.availability_zone`
- `cloud region`
- `container.name`
- `deployment.environment.name`
- `k8s.cluster.name`
- `k8s.container.name`
- `k8s.cronjob.name`
- `k8s.daemonset.name`
- `k8s.deployment.name`
- `k8s.job.name`
- `k8s.namespace.name`
- `k8s.pod.name`
- `k8s.replicaset.name`
- `k8s.statefulset.name`

If you are using Grafana Cloud, contact support to disable this setting or to update this list.

{{< admonition type="note" >}}
Some of these labels are mutually exclusive. If you don't need a particular label, you can aggregate it using Adaptive Metrics. For more information about Adaptive Metrics, refer to [Reduce metrics costs via Adaptive Metrics](https://grafana.com/docs/grafana-cloud/cost-management-and-billing/adaptive-telemetry/adaptive-metrics/).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the note refer to the list of resource attributes above (as opposed to labels)? Do you have examples of mutually exclusive ones? Not sure how to interpret the note.

If you are referring to resource attributes, why not avoid promoting them instead of aggregating the resulting labels away?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, they are resource attributes. I actually think this note might add more confusion than clarity, and I'm going to remove it.

{{< /admonition >}}

Mimir stores additional OTel resource attributes in a separate series called `target_info`, which you can query using a join query or the Prometheus `info()` function. Refer to [Functions](https://prometheus.io/docs/prometheus/latest/querying/functions/) in the Prometheus documentation for more information.

To learn more about OpenTelemetry resource attributes, refer to [Resources](https://opentelemetry.io/docs/languages/js/resources/) in the OpenTelemetry documentation.

## Format considerations

We follow the official [OTLP Metric points to Prometheus](https://opentelemetry.io/docs/reference/specification/compatibility/prometheus_and_openmetrics/#otlp-metric-points-to-prometheus) specification.
Expand Down
Loading