How to export metrics when they are created, and not every interval? #3555
Replies: 2 comments
-
We do have an |
Beta Was this translation helpful? Give feedback.
-
Found this discussion while searching for the same thing. One other option is the "hidden" feature implemented in #3059. ie. create the PeriodicExportingMetricReader with an interval of Math.inf and retain the instance somewhere. And then whenever you want to emit, call the .collect() on it. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I am trying to figure out how can I export metrics from python code using opentelemetry.
All the examples I see are using
PeriodicExportingMetricReader
. The issue is that I want to create a metric that will be reported once and thePeriodicExportingMetricReader
is reporting each of my metrics every interval.I tried to use Counters, Histogram and Gauge, but was unable to find a way to export a metric just once without repeating it's value each exporting interval.
Is it possible?
I want to collect metrics about when some function was called, so I need a separate "dot" on the graph for each time the function called, when the "y-axis" of the dot will be the time it took to execute the function (I calculate it manually). But I want to get it only once, without getting the same dot each exporting interval.
Maybe I am looking for something different then metrics, but I will appreciate any suggestion.
Beta Was this translation helpful? Give feedback.
All reactions