Questions tagged [prometheus-pushgateway]

Pushgateway is part of the official prometheus ecosystem. You don't need to include the tag prometheus unless the question relates to metrics collection. Please, check the official documentation of PushGateway before asking a question.

New to Prometheus ecosystem?

Pushgateway is part of the official ecosystem. It is a metric cache written in Go. Metrics are pushed, updated and deleted through an API. It is not a replacement for push based monitoring like statd. But rather, as explained on GitHub, a proxy to make batch job appear as if they were still running, giving time to Prometheus, which is pull based monitoring, to come and collect the resulting metrics.

Tag usage

When posting questions about Prometheus PushGateway, remember there are three main aspects:

  • the API side to metrics lifetime management
  • the Prometheus collection an exploitation
  • the PushGateway exploitation and design decision

If it is about metrics collection and exploitation, include the tag as well.

For the API side, specif the system you are using for accessing the API and give curl equivalent of the operations you question relates to.

For the exploitation and design decision, please first check the documentation which details the use cases and intent of PushGateway.

70 questions
14
votes
6 answers

How to push metrics with Python and Prometheus Pushgateway

I wish to push a multi-labeled metric into Prometheus using the Pushgateway. The documentation offer a curl example but I need it sent via Python. In addition, I'd like to embed multiple labels into the metric.
FuzzyAmi
  • 7,543
  • 6
  • 45
  • 79
6
votes
0 answers

Spark on Yarn - Prometheus discovery

I'm trying to integrate spark with prometheus. We have both spark 2 and spark 3. For spark 2 I know I can run jmx_exporter. Spark 3 has a new built in PrometheusServlet which is great. We are running spark on prem using YARN, not k8s. My question is…
5
votes
2 answers

How write a python script to send metrics data to pushgateway

I want to send metrics data to the Prometheus push gateway to monitor CPU and memory. What I want is to transfer $ps aux or $htop information to the push gateway. I tried this with a bash script, but I didn't succeed, which is why I'd like to try…
wanwan
  • 55
  • 1
  • 7
5
votes
1 answer

Prometheus intrumentation for distributed accumulated batch jobs

I run a build script multiple times per day. My feeling is that me and my colleagues spend a considerable amount of time waiting for this script to execute. Now I want to know: how much time do we spend per day waiting for the script to execute?. I…
pardahlman
  • 1,394
  • 10
  • 22
4
votes
4 answers

How to set a retention time for Pushgateway for metrics to expire?

I'm using Pushgateway with Prometheus and everything is OK but after a couple of weeks Pushgateway collapses ... giving it a look there are tons of metrics that are not used anymore and delete them manually is practically impossible ... so -> There…
Carlos Saltos
  • 1,385
  • 15
  • 15
4
votes
1 answer

Is there a way to delete from pushgateway using a metric/label value?

I only see how to delete from pushgateway using 'curl -X DELETE http://localhost:9091/metrics/job/some_job/instance/some_instance', but I want to delete metrics that contain a specific label value, how would I do that? UPDATE: I was using python to…
NathanZ
  • 43
  • 1
  • 5
4
votes
2 answers

Monitor the status of batch jobs using metrics in Prometheus

Several of our applications have batch jobs that aggregate data every night. These batch jobs, which are Python scripts, use Prometheus Pushgateway to push metric values to Prometheus, and we have rules that trigger alerts (in Alertmanager) when…
4
votes
3 answers

Access Control for the Prometheus Pushgateway

We have a Prometheus Pushgateway running and listening to metrics push from our AWS Lambda function. However, the URL to the Pushgateway is accessible by the public, which might impose some security issues. We were wondering if there is any way we…
3
votes
0 answers

Prometheus push gateway how to increment message requests

I have a use case where we need to increment the number of requests received on a Nuclio serverless service. Pod is recreated each time the service is invoked. Following the examples from the Prometheus-client library, I am not able to increment…
Masterbuilder
  • 499
  • 2
  • 12
  • 24
3
votes
1 answer

Pushing metrics to pushgateway replaces the old one

We have a java application called MonitorApp that is running in a docker container. The purpose of this app is to perform certain tasks, push the metrics to the Pushgateway and die. This MonitorApp runs as a Kubernetes Cron Job. This means after…
Neelesh
  • 666
  • 6
  • 17
2
votes
2 answers

Postman to prometheus and carriage "\r"?. text format parsing error in line 1: expected float as value, got "1\r"

Just trying to add new metric to Prometheus through the Postman, but getting text format parsing error in line 1: expected float as value, got "1\r" Metric just like "test_metric 1 " (without quotes) Why it happens and how can i remove it from…
Nigrimmist
  • 10,289
  • 4
  • 52
  • 53
2
votes
1 answer

pushgateway - ValueError: Incorrect label count

This is my below code def pushgateway(ip_addr, hostname, env_name, services, type): """Notify prometheus alerts via pushgateway""" registry = CollectorRegistry() label_keys=['ip','hostname','env_name'] label_values=[ip_addr, hostname, env_name] for…
psadi
  • 149
  • 7
2
votes
2 answers

Send metrics with pushgateway (Prometheus) using windows console

I am trying to send metrics to pushgateway from windows. But I get the following error: text format parsing error in line 1: invalid metric name This is the command I run from the console: echo "some_metric 10" | curl --data-binary @ - http: //…
2
votes
0 answers

How can I send CSV rows to Prometheus Pushgateway?

I have a simple csv file with date columns and numbers like this: date | count 2020-09-01 | 3 2020-09-02 | 4 2020-09-03 | 2 ... There is a python script that reads the csv row by row. What I would like to do, using pushgateway, pushgateway…
monstereo
  • 830
  • 11
  • 31
2
votes
1 answer

Invalid Push metric issue while using Prometheus push gateway simpleclient in spring boot

I'm using prometheus simple client for collecting metrics in my system via a spring boot application void insertBatchJob(String request , String[] labelNames, String[] labelValues,String counter) throws Exception { CollectorRegistry…
Vidur Gupta
  • 61
  • 2
  • 7
1
2 3 4 5