-
Hello, I have some metrics that I plan to add, and it might be an antipattern, but ideally I only want to report the data for a certain amount of time then drop it when it isn't useful, rather than doing a 1 or 0. Is there a way with a view or something that you can discard a metric after a period of time? I think I have seen similar questions but I am unsure if they were going after the exact same thing. But ideally it would free up the memory rather than constantly firing all the time when the data source no longer exists. I could arguably restart the entire application to free it up, but that sounds dumb. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
My quick idea it to shutdown old meter provider and create a new one. |
Beta Was this translation helpful? Give feedback.
-
This is an OpenTelemetry wide issue, for what it's worth. In that issue @dashpole made a proposal on how to resolve this using asynchronous instruments that I think you could try here. |
Beta Was this translation helpful? Give feedback.
This is an OpenTelemetry wide issue, for what it's worth. In that issue @dashpole made a proposal on how to resolve this using asynchronous instruments that I think you could try here.