opencensus-specs icon indicating copy to clipboard operation
opencensus-specs copied to clipboard

Exported type/kind conversion for different aggregates

Open fabxc opened this issue 6 years ago • 3 comments

I first ran into this via the Prometheus exporter in Go but I think it affects more libraries after browsing through different exporters and languages.

I have a sum aggregation, which is strictly increasing. I cannot use a count aggregation because it's in a tight loop and would eat lots of CPU.

I understand that a negative observation can make the sum go up and down. So making it a gauge type would make sense. But the Prometheus exporter converts the sum aggregation to Prometheus's "untyped" type in Go and Java alike instead.

  • What is the reasoning behind this?
  • Could a new MonotonicSum aggregation, that can cleanly map to a cumulative/counter type, be a useful addition to support this use case? (worth a separate issue?)

Digging further, the Stackdriver exporter in Java seems to return an unrecognized kind as well. The Go Stackdriver exporter though creates all metrics as cumulatives regardless of their aggregation, which seems incorrect.

@jkohen

fabxc avatar Jul 20 '18 10:07 fabxc

@bogdandrutu serendipity! Exactly what we were discussing about treating counters explicitly as monotonic event counters.

jkohen avatar Jul 20 '18 12:07 jkohen

It seems that the census-ecosystem Stackdriver exporter for Go fixes one issue described above. What is the relationship between the exporters in this Github org and the implementations directly in the client libraries?

fabxc avatar Jul 23 '18 10:07 fabxc

The implementation directly in the go client library will be deprecated in the future, see: https://github.com/census-instrumentation/opencensus-go/pull/790

basvanbeek avatar Jul 23 '18 12:07 basvanbeek