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

Pushing a metric with a subset or superset of existing label names causes error #26

Open
brettimus opened this issue Aug 3, 2023 · 1 comment

Comments

@brettimus
Copy link

brettimus commented Aug 3, 2023

Hey there!

First off, thanks for your work on this. It's nice to see a well-thought-out solution to getting serverless functions' metrics into Prometheus.

I bumped into an issue pushing metrics of this form:

function_calls_total{function="rabbit",objective_name="animalz"} 1
function_calls_total{function="wildRabbit"} 1

As a workaround, I can set the objective_name label to the empty string whenever it does not exist.

It seems like under the hood, your https://github.com/sinkingpoint/openmetrics-parser library wants for all metrics to have the same labels. (Maybe I should open an issue there instead?)

It gets mad when one metric has a superset or subset of the other's label names.

According to the Prometheus docs, setting a label to the emptystring is the same as not setting it at all.

So, to me, the expected behavior here is that

function_calls_total{function="rabbit",objective_name="animalz"} 1
function_calls_total{function="wildRabbit"} 1

would be equivalent to pushing

function_calls_total{function="rabbit",objective_name="animalz"} 1
function_calls_total{function="wildRabbit",objective_name=""} 1

Curious to hear your thoughts!

@sinkingpoint
Copy link
Owner

Interesting. We sort of assume that labelsets don't change, either up or down. Will take a poke at this this weekend

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

2 participants