open-telemetry / opentelemetry-collector-contrib

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

influxdb exporter, failed to convert OTLP metric to line protocol: unsupported sum aggregation temporality AGGREGATION_TEMPORALITY_DELTA #4038

Closed juanma-cvega closed 2 years ago

juanma-cvega commented 3 years ago

Describe the bug I'm currently using Micrometer in a Spring Boot application with the Statsd implementation to send metrics to the collector. I've already tried using the AWS CloudWatch EMF exporter but now I'm trying to send metrics to InfluxDB instead. When the collector tries to send the metrics to the database, I get the error

failed to convert OTLP metric to line protocol: unsupported sum aggregation temporality AGGREGATION_TEMPORALITY_DELTA

After enabling debug level for the logs, I can see entries like the following, which I guess are causing the issue.

-> Name: tomcat_sessions_created,statistic=count -> Description: -> Unit: -> DataType: IntSum -> IsMonotonic: true -> AggregationTemporality: AGGREGATION_TEMPORALITY_DELTA

Steps to reproduce Deploy a Spring Boot application with the Micrometer Statsd implementation and flavor 'telegraf'

What did you expect to see? Metrics being sent to InfluxDB.

What did you see instead? An error when the collector tries to send the metrics to the database.

What version did you use? Version: 0.29.0

What config did you use?

extensions:
  zpages:
    endpoint: 0.0.0.0:55679

receivers:
  statsd:
    endpoint: 0.0.0.0:8125

exporters:
  influxdb:
    endpoint: https://endpoint
    timeout: 500ms
    org: test
    bucket: test
    headers:
      Authorization: "Basic XXX"
    metrics_schema: telegraf-prometheus-v2
  logging:
    loglevel: debug

service:
  pipelines:
    metrics:
      receivers: [ statsd ]
      processors: [ ]
      exporters: [ influxdb, logging ]
  extensions: [zpages]

Environment AWS ECS Fargate with openjdk base image (Debian). Collector deployed as a sidecar. InfluxDB v1.8.3 opentelemetry-java-instrumentation with OTEL_METRICS_EXPORTER=none (currently for X-Ray traces only).

juanma-cvega commented 3 years ago

After going through the list of issues, could my problem be related to https://github.com/open-telemetry/opentelemetry-specification/issues/731? I assume other systems like Telegraf must be doing the aggregation internally for them to work with InfluxDB.

jacobmarble commented 3 years ago

@bogdandrutu please assign this to me.

jacobmarble commented 2 years ago

@juanma-cvega did you find a solution to this problem? The InfluxDB exporter supports two schemas, both are standard Prometheus-to-InfluxDB conventions, and it looks like the Prometheus exporter also does not support delta metrics.

https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.46.0/exporter/prometheusexporter/accumulator.go#L168-L171

I believe this issue can be closed.