Skip to content

InfluxDB Exporter uses unsupported ns precision instead of nanosecond for InfluxDB 3 Core #43645

@StevenSeeger

Description

@StevenSeeger

Component(s)

No response

What happened?

Description

When exporting logs to InfluxDB 3 Core using the official influxdb exporter in opentelemetry-collector-contrib, the exporter sends the timestamp precision as ns. InfluxDB 3 Core expects nanosecond (not ns), resulting in errors like:

serde error: unknown variant `ns`, expected one of `auto`, `second`, `millisecond`, `microsecond`, `nanosecond`

Steps to Reproduce

  1. Configure the OpenTelemetry Collector with the influxdb exporter targeting InfluxDB 3 Core.
  2. Send logs via OTLP to the collector.
  3. Observe the error in the collector logs and InfluxDB response.

Expected Result

The exporter should use nanosecond as the precision value, or allow configuration of the precision.

Actual Result

The exporter hardcodes ns as the precision, which is rejected by InfluxDB 3 Core.

Collector version

0.137.0

Environment information

Environment:

OpenTelemetry Collector Contrib version: 0.137.0 (latest)
InfluxDB version: 3-core
Exporter config:

exporters:
  influxdb:
    endpoint: http://influxdb:8086/api/v3/write_lp
    token: <token>
    org: <org>
    bucket: <bucket>
    timeout: 30s

OpenTelemetry Collector configuration

receivers:
  otlp:
    protocols:
      grpc:
        endpoint: 0.0.0.0:4317
      http:
        endpoint: 0.0.0.0:4318

processors:
  batch:
    timeout: 10s
    send_batch_size: 1024

exporters:
  influxdb:
    endpoint: http://influxdb:8086/api/v3/write_lp?precision=nanosecond
    token: <token>
    org: <org>
    bucket: <bucket>
    timeout: 30s
    metrics_schema: telegraf-prometheus-v2
    
  debug:
    verbosity: detailed
    sampling_initial: 5
    sampling_thereafter: 200

service:
  pipelines:
    logs:
      receivers: [otlp]
      processors: [batch]
      exporters: [debug, influxdb]
    
  telemetry:
    logs:
      level: debug

Log output

"exporter", "otelcol.signal": "logs", "error": "not retryable error: Permanent error: line protocol write returned \"400 Bad Request\" \"serde error: unknown variant `ns`, expected one of `auto`, `second`, `millisecond`, `microsecond`, `nanosecond`\"", "dropped_items": 1}

Additional context

Direct HTTP API ingestion with precision=nanosecond works as expected.

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions