Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing label values for gauges #27

Open
JeremyMahieu opened this issue May 3, 2024 · 0 comments
Open

Changing label values for gauges #27

JeremyMahieu opened this issue May 3, 2024 · 0 comments

Comments

@JeremyMahieu
Copy link

JeremyMahieu commented May 3, 2024

I'm looking for a feature where if the label changes, that the previous metric is deleted. And a new one with the new label value is created. I understand that the current behavior is also favorable for some scenarios. For counters this would make sense not for gauges.

Current behavior:
Let's say you set a metric with label A to 100. If you now change the label to B you get two lines.

metric{label="A"} 100
metric{label="B"} 100

Wanted behavior:
Let's say you set a metric with label A to 100. If you now change the label to B you get one line.

metric{label="B"} 100

This way if you do sum(metric) you always get 100, instead of 200 with the previous method.
However this should not always be the case. You can have some labels that do this, some that don't
Let's say you have two power meters that have a tarrif. If the tarrif changes, you don't want extra lines, however you do want two lines, one for each meter.

power{meter="1", tariff="B"} 100
power{meter="2", tariff="A"} 50

Now if you do sum by (tariff) (power) you get A=50, B=100

If there was some way to delete a metric, or do a label update without creating a new line, this would be possible.
Or perhaps you could configure which labels are changeable and which labels branch out the metric.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant