Pushgateway label policy

60 views
Skip to first unread message

Алексей Широких

unread,
May 24, 2021, 6:14:49 AM5/24/21
to Prometheus Users
Hello, we have a problem with the Pushgateway.
Almost everyone can send metrics to it, and we can't enforce any policies on data ingest.
We have an internal agreement that all metrics must have at least a team label or, better have team and product labels.

I was thinking about filtering data on Nginx proxy, but I can see that labels can be set in URL or post data. It will be tricky to make such filtering work as expected.

Nay ideas on how to enforce that kind of policy?

Brian Brazil

unread,
May 24, 2021, 6:18:40 AM5/24/21
to Алексей Широких, Prometheus Users
You could drop any metrics without that label at scrape time with metric_relabel_configs.

--

Алексей Широких

unread,
May 24, 2021, 6:23:35 AM5/24/21
to Prometheus Users
Yep, I can. And I thought about it.
But that will not give any feedback to the user that sends data.
The request will be accepted, and from a user point of view, it must be handled

I was thinking about a way how to give a quick response, like sending 400 errors.
понедельник, 24 мая 2021 г. в 12:18:40 UTC+2, Brian Brazil:

Julien Pivotto

unread,
May 24, 2021, 8:12:34 AM5/24/21
to Алексей Широких, Prometheus Users
I'd only reverse-proxy the requests that start with
http://pushgateway.example.org:9091/metrics/team/
to the client, and return 404 or 503 otherwise.
> --
> You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/08e1bdd0-d919-4a6f-9fcf-40b727457f75n%40googlegroups.com.


--
Julien Pivotto
@roidelapluie

Алексей Широких

unread,
May 25, 2021, 9:46:02 AM5/25/21
to Prometheus Users
Julien, I haven't found a way to send it via prometheus_client. I think it sends everything as PUT to a specified gateway.
Am I the only one who has that kind of requirement? Should it be a Feature request?
понедельник, 24 мая 2021 г. в 14:12:34 UTC+2, Julien Pivotto:
Reply all
Reply to author
Forward
0 new messages