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), 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, otherwise it will be mapped as a datapoint attribute.
Additional info
cc @jacobmarble since you are probably the person with the most context here :)
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), 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, otherwise it will be mapped as a datapoint attribute.
Additional info
cc @jacobmarble since you are probably the person with the most context here :)