Questions tagged [prometheus]

The Prometheus monitoring system, including the server, alertmanager, push gateway, exporters, client libraries and other components.

Prometheus is a go-based open-source monitoring system inspired by Google's approach to monitoring.

Prometheus itself is a time-series storage server that periodically pulls metrics from monitored entities. These metrics can then be queried and alerted-upon using simple query and alert languages.

Prometheus comes with a suite of supporting tools like alertmanager, exporters and client libraries, designed to work together in providing a highly scalable and complete monitoring solution. Metric visualizations is usually done with Grafana, which seamlessly connects with Prometheus.

Prometheus's official site.

Read more about Prometheus's approach here:

  • This article explains Prometheus metric gathering approach for beginners.

  • This chapter from the online book "Site Reliability Engineering" describes Google's monitoring system Borgmon. Prometheus is mentioned in this chapter and was designed with Google's approach in mind.

6591 questions
15
votes
2 answers

get time that passed since the last increase of Prometheus counter

Consider a Prometheus metric foo_total that counts the total amount of occurences of an event foo, i.e. the metric will only increase as long as the providing service isn't restarted. Is there any way to get the timespan (e.g. amount of seconds)…
muffel
  • 7,004
  • 8
  • 57
  • 98
15
votes
3 answers

Multiple Targets on prometheus

I've configured prometheus on Centos, version details are follows. prometheus-2.5.0.linux-386 I've added two targets on the prometheus.yml configuration file, all the servers node exporters are running. Config as follows, scrape_configs: -…
user10590355
15
votes
2 answers

Monitoring CPU Utilization using Prometheus

I am trying to monitor the cpu utilization of the machine in which Prometheus is installed and running. I have a metric process_cpu_seconds_total. I can find irate or rate of this metric. But I am not too sure how to come up with the percentage…
Arnav Bose
  • 791
  • 4
  • 13
  • 27
15
votes
2 answers

Configure Prometheus to use non-default port

I would like to install Prometheus on port 8080 instead of 9090 (its normal default). To this end I have edited /etc/systemd/system/prometheus.service to contain this line: ExecStart=/usr/local/bin/prometheus \ --config.file=/etc/prometheus.yaml…
rookie09
  • 736
  • 1
  • 6
  • 18
15
votes
3 answers

What is the maximum scrape_interval in Prometheus

I used Prometheus to measure business metrics like: # HELP items_waiting_total Total number of items in a queue # TYPE items_waiting_total gauge items_waiting_total 149 I would like to keep this data for very long term (5 years retention) and I…
oliver nadj
  • 788
  • 7
  • 21
14
votes
1 answer

Add custom scrape endpoints in helm chart kube-prometheus-stack deployment

First off a little new to using helm... So I'm struggling to get the helm deployment of this: https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack To work the way I would like in my kubernetes cluster. I like…
wesleywh
  • 1,053
  • 1
  • 13
  • 30
14
votes
4 answers

How to merge zero values (vector(0) with metric values in PromQL

I'm using flexlm_exporter to export my license usage to Prometheus and from Prometheus to custom service (Not Graphana). As you know Prometheus hides missing values. However, I need those missing values in my metric values, therefore I added to my…
Vibex
  • 171
  • 1
  • 2
  • 8
14
votes
2 answers

Adding multiple alerts on single grafana panel

I have configured grafana dashboard to monitor promethus metrics for some of the spring boot services. I have a single panel and a prom query for every service on it. Now I want to add alerts for each on of those queries. But I couldn't find a way…
Mandroid
  • 6,200
  • 12
  • 64
  • 134
14
votes
4 answers

How to send alert for every error in my logs using Promtail / Loki - AlertManager?

I'm using Promtail + Loki to collect my logs and I can't figure how can I alert for every error in my log files. I'm also using Prometheus, Alertmanager and Grafana. I've seen some people have managed to achieve that, but none of them explained the…
EnTm
  • 163
  • 1
  • 1
  • 6
14
votes
2 answers

Unexplainable "root" uri in spring boot prometheus metrics

In our Prometheus metrics in our Spring Boot API, there is a very mysterious root "endpoint" that appears to be called sometimes. This looks like someone probing our API, but the endpoint does not exist. The really strange part is that I don't see…
kiwiidb
  • 331
  • 2
  • 10
14
votes
4 answers

Prometheus counters: How to get current value with golang client?

I am using counters to count the number of requests. Is there any way to get current value of a prometheus counter? My aim is to reuse existing counter without allocating another variable. Golang prometheus client version is 1.1.0.
Prisacari Dmitrii
  • 1,985
  • 1
  • 23
  • 33
14
votes
2 answers

custom path for prometheus actuator

I am currently trying to migrate our prometheus lib to spring boot 2.0.3.RELEASE. We use a custom path for prometheus and so far we use a work around to ensure this. As there is the possibility for a custom path for the info- and health-endpoint,…
Ruth
  • 856
  • 2
  • 13
  • 26
14
votes
3 answers

How to set Prometheus Alertmanager external URL via configuration

I'm using a vanilla Docker container to start an Alertmanager. As far as I know, I cannot provide the external URL via parameter in this case, so I have to find another way. Is it possible to set the URL via configuration file or environment…
eventhorizon
  • 2,977
  • 8
  • 33
  • 57
14
votes
1 answer

prometheus rule: check for expression value in range

In a prometheus alert rule, how do I check for a value to be in a certain range? for eg., (x > 80 && x <= 100); when x is a complex expression it feels unnecessary to evaluate it twice. is there another way to represent this expression?
vrtx54234
  • 2,196
  • 3
  • 30
  • 53
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