Fields dropped by opentelemetry input plugin?

Dear All,
It is nice to be part of this community!

I am trying to process OTEL data using telegraf OTEL input plugin. I have created some sample input files for telemetry i.e. traces, logs and metrics. I have tried with several permutations but following fields are always dropped, they do not appear in the output.

SPANS:
spans[0].parentSpanId
scopeSpans[0].scope.name
scopeSpans[0].scope.version

Logs:
scopeLogs[0].scope.name
scopeLogs[0].scope.version

Metrics (counter):
metrics[0].description
metrics[0].unit

I see that the extraction logic for these fields is visible in the Otel2Influx library.
I have a minimal config file, and I suppose i cannot mention fields inclusion or exclusion criteria in the config file, can only do it for tags.
What am I missing?

@dpsingh Can you provide a sample of your Telegraf configuration?

Hi @scott ,

Thanks for the reply.

Telegraf version is “1.35.1”.

I have tried several configs, following is the last one I am using:

[agent]
  interval = "10s"
  flush_interval = "10s"
  debug = true

[[inputs.opentelemetry]]
  service_address = "0.0.0.0:4317"
  span_dimensions = ["service.name", "trace_id", "span_id"]
  log_record_dimensions = ["service.name", "trace_id", "span_id"]

[[outputs.file]]
  files = ["C:/user/code/OTEL/out.json"]
  data_format = "json"

hey @scott, pls let me know if any additional information is required.

I’m not familiar enough with the OpenTelemetry (OTEL) plugin or the OTEL schema to accurately answer this question. @jacobmarble, do you have any insight into how this plugin should be configured to pull in the fields that are currently being dropped?

@jacobmarble kindly share your feedback. thanks!

@dpsingh I dug into your issue by looking at both the Telegraf OpenTelemetry input plugin code and the influxdb-observability/otel2influx conversion library. Here’s what’s going on:

Not actually dropped:

  • spans[0].parentSpanId is present, but as parent_span_id (camelCase is converted to snake_case for InfluxDB line protocol).

Missing for real:

  • scopeSpans[0].scope.name / .version
  • scopeLogs[0].scope.name / .version
    These aren’t currently extracted in otel2influx, scope attributes are handled, but not name/version like in the old instrumentation_library_name pattern.

Used differently:

  • metrics[0].description and metrics[0].unit help build the measurement name ({name}_{unit}_{type}) but aren’t stored as separate fields.

What you can do:

  1. For parentSpanId, look for parent_span_id in the output.
  2. For scope name/version or separate metric description/unit fields, open a feature request at influxdb-observability and explain your use case.

Tip:
Enable debug logging in Telegraf to see the exact field names:

[agent]
  debug = true

Most of your data is still there, it’s just being transformed according to the conversion schema.

1 Like

@skartikey thanks for the reply. However, my observation is slightly different. in fact the main issue has been parent span id loss. I made a short document that has input data, output data, config file, and comparison of fields in the input vs output. the earlier information I provided was just field names.

If you can please once check the document at https://drive.google.com/file/d/1Py1Vr_10CwkP17udTjcR4JaY8LGiK75v/view?usp=sharing

@dpsingh Thanks for the detailed analysis, your input/output comparison makes the problem clear. This isn’t just a missing feature, it’s a bug in the otel2influx conversion library:

  • Parent span ID is missing, breaking distributed tracing
  • Scope name/version from configuration is not appearing in output

Please file a bug report (not a feature request) at: https://github.com/influxdata/influxdb-observability
Include your exact input/output example, reference this forum thread, and note the impact on distributed tracing.