You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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'sdoubleValue
, 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)
The text was updated successfully, but these errors were encountered: