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
{{ message }}
Repository navigation
PeriodicMetricExporter does not export periodically for either Delta or Cumulative temporality ExponentialHistogram #3971
I have a low-throughput service and have implemented my own Histogram to measure the duration of an operation. This uses a PeriodicMetricExporter which is configured to export every 60 seconds. When I use Delta temporality, I get an export within 60 seconds of the last histogram recording. I then have no exports until the next observation is made.
When changing to Cumulative temporality I have the exact same experience. For comparison purposes, when using the Golang SDK I get the same behaviour as Python's Delta but, when using Cumulative, I get a metronomic export every 60 seconds regardless of any observations being recorded..
Should the Python PeriodicMetricExporter export every 60 seconds or not, and how does temporality setting play into it? At the moment it causes me a problem because my service has low throughput. My observability backend (New Relic) uses the StartTimeUnixNano value which can be hours in the past. A constant periodic export would help to correct this as the StartTimeUnixNano would be at most 60 seconds in the past.
SDK 1.26.0 includes the fix for this cumulative exponential histogram case in #3978, released July 25, 2024.
My Codex agent executed this example on Python 3.12.10, using SDK 1.25.0 and 1.26.0 with their matching API and semantic conventions. It records once, then collects twice.
With PeriodicExportingMetricReader and an in-memory recording exporter, the agent also observed three cumulative exports after one observation on 1.26.0 and current main (bc3bd9ce). Cumulative StartTimeUnixNano stayed constant across those exports; repeated export does not move the cumulative start time forward.
The New Relic path was not exercised. For the missing cumulative exports, try SDK 1.26.0 or later with AggregationTemporality.CUMULATIVE.
Assisted with Claude Code; I checked and edited it.
Activity
aabmass commentedon Jun 14, 2024
@ocelotl
fix(opentelemetry-sdk): keep synchronous gauge values across cumulati…
fix(opentelemetry-sdk): keep synchronous gauge values across cumulati…
mertefesensoy commentedon Nov 1, 2026
SDK 1.26.0 includes the fix for this cumulative exponential histogram case in #3978, released July 25, 2024.
My Codex agent executed this example on Python 3.12.10, using SDK 1.25.0 and 1.26.0 with their matching API and semantic conventions. It records once, then collects twice.
With
PeriodicExportingMetricReaderand an in-memory recording exporter, the agent also observed three cumulative exports after one observation on 1.26.0 and current main (bc3bd9ce). CumulativeStartTimeUnixNanostayed constant across those exports; repeated export does not move the cumulative start time forward.The New Relic path was not exercised. For the missing cumulative exports, try SDK 1.26.0 or later with
AggregationTemporality.CUMULATIVE.Assisted with Claude Code; I checked and edited it.