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
Implement deletion of Gauge metrics based on partially specified labels #1118
In many cases, the labels of a Gauge are fixed and known, but sometimes it’s hard to keep track of all labels, for example with an HTTP request collector per endpoint.
It would be very useful to have a method to delete metrics by matching a subset of labels. For example, deleting all metrics with status_code="200" regardless of other labels.
I ran into this issue myself when scraping disk data from multiple instances. On reset I wanted to remove only a specific instance's metrics, but ended up removing all.
changed the title [-]Enable deletion of Gauge metrics based on partially specified labels[/-][+]Implement deletion of Gauge metrics based on partially specified labels[/+]on Jul 11, 2025
Hi, I’m interested in implementing partial label removal (remove_matching) for Gauge (and other metric types if applicable).
I’ve done a local prototype that allows deleting all time series that match a subset of labels.
Example:
Hey @hazel-shen , that really sounds like exactly what I was looking for.
I had thought about looking into how it could be implemented myself, but I just don’t have the time or focus for it right now.
So I really appreciate you taking the initiative to create a PR for this.
Activity
[-]Enable deletion of Gauge metrics based on partially specified labels[/-][+]Implement deletion of Gauge metrics based on partially specified labels[/+]hazel-shen commentedon Aug 12, 2025
Hi, I’m interested in implementing partial label removal (remove_matching) for Gauge (and other metric types if applicable).
I’ve done a local prototype that allows deleting all time series that match a subset of labels.
Example:
I’ll prepare a PR including:
removefunction)Please let me know if this approach works for you before I proceed.
TheGameProfi commentedon Aug 12, 2025
Hey @hazel-shen , that really sounds like exactly what I was looking for.
I had thought about looking into how it could be implemented myself, but I just don’t have the time or focus for it right now.
So I really appreciate you taking the initiative to create a PR for this.