influxdata / influxdata/telegraf

[plugins/outputs/opentelemetry] Allow specifiying tags to be exported as resource attributes

Open
#13,508 1 comment 1 reaction 1 assignee Claimed by @jacobmarble View on GitHub
feature request
Dominant language
Go
Stars
17.8k
Forks
5.8k
Avg merge
1d 20h
Merged PRs (30d)
161

Description

### Use Case

The OTLP metrics data model distinguishes between resource attributes and datapoint attributes; the former being a class of attributes common to all telemetry signals in OTLP that specify the resource that generate telemetry. The Telegraf data model does not seem to have these concepts instead having just tags/fields used at the datapoint level, and the current situation is to (except when the tag name is a resource semantic convention) is to map all tags as datapoint attributes.

When an user is exporting in the OTLP format, a user currently has no way to specify which tags should mapped to resource attributes. This is something that is supported by OpenTelemetry SDKs and the OpenTelemetry Collector and is allowed by the specification (with some guidance [here](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.22.0/specification/common/attribute-naming.md#recommendations-for-application-developers)), but is not currently possible through Telegraf.

### Expected behavior

A new option is added to the Telegraf output plugin to specify which tags should be mapped as resource attributes instead of datapoint attributes.

### Actual behavior

No option is available and no workaround exists: currently, if a tag's name matches that of an OpenTelemetry resource-level semantic convention [it will be mapped as a resource attribute](https://github.com/influxdata/influxdb-observability/blob/ec55604dd7e4e09cfd50d3ecd007401306a66d7e/influx2otel/metrics.go#L90), otherwise it will be mapped as a datapoint attribute.

### Additional info

cc @jacobmarble since you are probably the person with the most context here :)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.