Synchronous Memory Metrics #3040
Replies: 4 comments 8 replies
-
Can you link to the code that you've written? It will be helpful to see precisely what you're doing. |
Beta Was this translation helpful? Give feedback.
-
I have created a very simple simulated scenario to depict this. The memory is sawtooth like i.e goes from 100 too 900 and then back again. But when I see this in prometheus it just keep rising. Using a LongUpDownSumObserver shows the correct pattern.
|
Beta Was this translation helpful? Give feedback.
-
That was exactly my understanding. I want to set the current value. add is the only method that LongUpDownCounter has. All I did was replace the LongUpDownSumObserver with LongUpDownCounter and replace the observe method with add. I would hate to have to record the last value and then do addition that way as that would require a lot of housekeeping. That is why my original question was about the synchronous equivalent of LongDownSumObserver. |
Beta Was this translation helpful? Give feedback.
-
Let me know how to join and I would certainly be interested.
…On Thu, Mar 18, 2021 at 5:47 PM John Watson ***@***.***> wrote:
Just FYI, if you're worried about things not working moving forward, you
probably should avoid using the metrics API right now. It's still alpha,
and the OpenTelemetry Metrics SIG is doing a lot of re-thinking on
everything right now. I can almost certainly guarantee that things will
change in the future.
We will almost certainly have views in the future, so it should be
relatively safe to use that approach, if it works.
As to keeping track of timestamps and passing them into the API somehow.
No, there's nothing in the API to support this use-case right now. If
you're interested in influencing the API design, however, please feel free
to join the aforementioned metrics effort. :)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#3040 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB56UZ76KSAB46P5FLWIZJLTEJYGFANCNFSM4ZMXT7CQ>
.
|
Beta Was this translation helpful? Give feedback.
-
I have borrowed code from this:
https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/instrumentation/runtime-metrics/library/src/main/java/io/opentelemetry/instrumentation/runtimemetrics/MemoryPools.java
to export metrics to Prometheus. But in my case I dont use MemoryMxBean as I have my own data structure that has all the data. So I dont want to use the Asynchronous meters LongUpDownSumObserver. I replaced those with the Synchronous equivalent LongUpDownCounter. But the view show the values constantly increasing and never dropping for heap values that actually go up and down.
What is metric to replace with in this case ? Or is there a reset somewhere that I would have to add explicitly ?
Beta Was this translation helpful? Give feedback.
All reactions