-
Notifications
You must be signed in to change notification settings - Fork 802
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 to PushGateway is not pushing any metrics #659
Comments
It makes more sense to ask questions like this on the prometheus-users mailing list or our forums rather than in a GitHub issue. In our community channels, more people are available to potentially respond to your question, and the whole community can benefit from the answers provided. |
It also looks like |
@roidelapluie Thanks for the quick answer. Sorry if I couldn't reply earlier. It would be indeed beneficial if the documentation explicitly say that this is intended for internal use. What I would like to achieve is to define a set of fixed values for my counter (or histogram, etc). Those values do change on every execution of the batch process and are not dimensionally big. I saw in the documentation that I can create the labels using That's a small use case, and I am not sure whether it happens often enough to justify its implementation. 🤷♂️ |
Hello, that is certainly a reasonable use case, and I wonder if this library covers it well enough as is. If not, we can create a new issue that is an enhancement request. Currently the way to create a metric with a fixed set of labels would be like this:
Does a workflow like that enable what you require? |
Hello @csmarchbanks. Naive if me not to think of your proposal. It seems to work just fine. If I encounter issues, I might come back, but for now the case is closed. Thanks! |
Awesome 🥳 |
Hello,
I have a set of metrics in my batch job, all of them being created in the following way:
In my use case, I have a small set of global labels that I define to every metric when they are created. Then, at the end of the batch job, the metrics are pushed to PushGateway through the
push_to_gateway
function. The command runs successfully. However, in PushGateway, none of the metrics is actually there.While trying to understand why, I crossed with this line in the code. Basically, the created metrics are only added to the given registry
r
when there are no labels given to it. Consequently, the registryr
is empty whenpush_to_gateway
runs.I wonder if this is the intended behaviour. In case positive, is there a way to use the global prometheus registry in
push_to_gateway
(registry
is a required parameter in the function call)?The text was updated successfully, but these errors were encountered: