Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Counter type from statsdreceiver being dropped by prometheusexporter #4153

Closed
locmai opened this issue Jul 11, 2021 · 2 comments
Closed

Counter type from statsdreceiver being dropped by prometheusexporter #4153

locmai opened this issue Jul 11, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@locmai
Copy link
Contributor

locmai commented Jul 11, 2021

Describe the bug
The counting-type metric from StatsD receiver will always be dropped by the prometheusexporter

Steps to reproduce

  • Set the config..yaml as the one below the Config section
  • Build from source and run the binary / Run on k8s cluster
  • Send a simple c metric: echo "locmai.test:30|c" | nc -w 1 -v -u 0.0.0.0 8127

What did you expect to see?
The locmai_test metric being exported in the Prometheus Exporter http://0.0.0.0:9090

What did you see instead?
No metric be exported from the prometheusexporter, check the metrics.json and the metric is exported there.

What version did you use?
Version: v0.29.0

What config did you use?
Config:

receivers:
  statsd:
    endpoint: "0.0.0.0:8127"
    aggregation_interval: 5s
    enable_metric_type: true
    timer_histogram_mapping:
      - statsd_type: "histogram"
        observer_type: "summary"
      - statsd_type: "timing"
        observer_type: "summary"
processors:
  batch:
exporters:
  prometheus:
    endpoint: "0.0.0.0:9090"
    metric_expiration: 180m
  file:
    path: ./metrics.json
service:
  pipelines:
    metrics:
      receivers: [statsd]
      processors: [batch]
      exporters: [prometheus,file]

Environment
OS: CentOS, Kubernetes, MacOS,

Additional context
This was due to the logic for the statsdreceiver that set SetAggregationTemporality(pdata.AggregationTemporalityDelta)

nm.IntSum().SetAggregationTemporality(pdata.AggregationTemporalityDelta)

And the prometheusexporter is dropping any metric without the AggregationTemporalityCumulative

https://github.com/open-telemetry/opentelemetry-collector/blob/cc41009d95166f0c5ab9a9bddbab9ec903ed163d/exporter/prometheusexporter/accumulator.go#L198

It only check for AggregationTemporalityCumulative, not AggregationTemporalityDelta.

So for the proposal solution:
Fix these lines from prometheusexporter to check the other AggregationTemporality types as well before dropping the metric.

@locmai
Copy link
Contributor Author

locmai commented Jan 13, 2022

I'm re-opening this since my last fix was off the spec of statsd receiver, re-trying with the hope of fixing this one at the prometheusexporter end.

@locmai
Copy link
Contributor Author

locmai commented May 19, 2022

Another attempt from @nabam I found in the PR list #9006 - this one also updated the accumulateDoubleHistogram function but doesn't include the fix for statsd receiver side in #9919

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant