open-telemetry / opentelemetry-collector-contrib

Contrib repository for the OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
2.94k stars 2.29k forks source link

influxdb receiver - allow configurable field separator for joining measurement and field names #34693

Open clheikes opened 1 month ago

clheikes commented 1 month ago

Component(s)

receiver/influxdb

Is your feature request related to a problem? Please describe.

When converting to opentelemetry metrics, The influxdb receiver is joining the measurement name and each field with a "_".

Several of the telegraf output plugins are joining measurement and fields with a "." making it difficult to migrate to the open telemetry collector without changing metric names in all of the downstream dashboards and monitors impacted.

Describe the solution you'd like

Allow the field separator to be configurable when ingesting metrics.

receivers:
  influxdb:
    endpoint: 0.0.0.0:8080
    measurementFieldSeparator: "."

Describe alternatives you've considered

We looked at using transforms but our field names have underscores in them as well so there is no simple way to convert these back to a period as a separator.

Additional context

Relavant code

metricName := fmt.Sprintf("%s_%s", measurement, k)

github-actions[bot] commented 1 month ago

Pinging code owners: