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

Exemplars are broken for long histograms #5212

Closed
jack-berg opened this issue Feb 13, 2023 · 1 comment
Closed

Exemplars are broken for long histograms #5212

jack-berg opened this issue Feb 13, 2023 · 1 comment

Comments

@jack-berg
Copy link
Member

jack-berg commented Feb 13, 2023

If you try to record to LongHistogram in the context of a sampled span, an exemplar will not be included on collection. However, DoubleHistogram works as expected. I looked into it and its due to HistogramPointData only returning double histogram. Under the covers, we record the value as a long to the ReservoirCell, and then try to read out the cell's doubleValue, which doesn't exist.

From @dashpole:

Using the logging exporter, I can confirm that it isn't an issue with the prometheus exporter:

INFO: metric: ImmutableMetricData{resource=Resource{schemaUrl=null, attributes={service.name="PrometheusExporterExample", telemetry.sdk.language="java", telemetry.sdk.name="opentelemetry", telemetry.sdk.version="1.22.0"}}, instrumentationScopeInfo=InstrumentationScopeInfo{name=io.opentelemetry.example.prometheus, version=null, schemaUrl=null, attributes={}}, name=super.timer, description=, unit=ms, type=HISTOGRAM, data=ImmutableHistogramData{aggregationTemporality=CUMULATIVE, points=[ImmutableHistogramPointData{getStartEpochNanos=1676326373284000000, getEpochNanos=1676326433302000000, getAttributes={}, getSum=59053.0, getCount=59, hasMin=true, getMin=1000.0, hasMax=true, getMax=1026.0, getBoundaries=[0.0, 5.0, 10.0, 25.0, 50.0, 75.0, 100.0, 250.0, 500.0, 750.0, 1000.0, 2500.0, 5000.0, 7500.0, 10000.0], getCounts=[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 28, 0, 0, 0, 0], getExemplars=[ImmutableDoubleExemplarData{filteredAttributes={}, epochNanos=1676326429485000000, spanContext=ImmutableSpanContext{traceId=ef29eebb7cde692aa527d9c114b384af, spanId=e0a4334cc4242518, traceFlags=01, traceState=ArrayBasedTraceState{entries=[]}, remote=false, valid=true}, value=0.0}, ImmutableDoubleExemplarData{filteredAttributes={}, epochNanos=1676326432488000000, spanContext=ImmutableSpanContext{traceId=9c16ce50f3788156dc0fb8424810b7bb, spanId=94e329af9852cc7c, traceFlags=01, traceState=ArrayBasedTraceState{entries=[]}, remote=false, valid=true}, value=0.0}]}]}}

The values of both are 0.0, even though only higher buckets have any observations.

Originally posted by @dashpole in open-telemetry/opentelemetry-java-examples#96 (comment)

@jack-berg
Copy link
Member Author

Resolved by #5216

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant