Remove metric series where Label Values are no longer in use. If Label Values are Dynamic, is there a way to remove the previous labels from being reported? #1299
-
Hi team, I have tried to maintain the labels map I want to delete. But the .Delete(labels) deletes the metrics before exporting and hence I don't see anything on the endpoint. I want to delete the labels after I have sent them, so that in the next poll they do not show up.
Now after some time, let's say at time
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi! Yes, you can use BTW: However, looking on your metric, you might want to look at profiling (if interested in aggregation of performance metrics like mem/CPU per struct/ops). That's ofc depending what do you want to achieve (: |
Beta Was this translation helpful? Give feedback.
Hi!
Yes, you can use
Reset
method on all Vec* metric types (e.g. GaugeVec). There are alsoDelete*
methods you can use. (:BTW: However, looking on your metric, you might want to look at profiling (if interested in aggregation of performance metrics like mem/CPU per struct/ops). That's ofc depending what do you want to achieve (: