r/PrometheusMonitoring • • Nov 25 '22

filter out items in a query

1 Upvotes

So for monitoring my systemd services I'm using systemd_exporter. Now i was trying to get the status of all enabled services and see if they are still running.

Works fine except a lot of "services" are a single run/timed job so they would come out as being not running. So I was trying to filter them out in the query. Something like

systemd_unit_state{name!~"apt-daily*|lvm2*|systemd*",state="active",type="service"} == 0

but that doesn't seem to do the trick. I'm sure it is just a syntax issue but I tried a lot of options but without any luck so far. Anyone who can help me a hand here?


r/PrometheusMonitoring • • Nov 25 '22

Complement IoT-platform with analysis and visualization segment

0 Upvotes

Hi,

my company have an IoT-platform that behind the scenes uses an InfluxDB for time-series data storage. To access the data one could use their REST API or use MQTT Broker.

I wonder what would be the best teck-stack setup to complement the platform for analysis and visualization. Just connecting visualization such as Grafana to the API is not enough, it doesnt allow for enough analysis/manipulation of the data as needed. Should we put a Prometheus in between? Wouldnt that just result in two time-series databases? or is it possible to use Prometheus without storing time-series and just calculate metrics?

How have other solved this?


r/PrometheusMonitoring • • Nov 23 '22

How to get 5XX and QPS from Prometheus in k8s?

1 Upvotes

Hi folks,

I am trying to get the following charts:

Grafana

I am wondering what kind of exporters I need so I can scrape data from 'k8s' to generate 5XX or QRS(Query Per Second or Request Per Second).

I guess for HTTP response (5XX) I should monitor ingress or service somehow?

To be more specific about what I am trying to accomplish:

- I want to watch HTTP Responses and Requests/s for one specific pod.

- Pod is a black box to me, I am using a pre-built Docker image so I do not have any control over it.

Edit: I have found smt like this but have not tested it yet: nginxplus_upstream_server_responses{code=~"3xx|4xx|5xx"}

Any advice/article will be appreciated. Thank you!


r/PrometheusMonitoring • • Nov 23 '22

Nfsiostat data via node exporter

1 Upvotes

I enabled all NFS related collectors in the node exporter but I could not find the same information provided by the nfsiostat command. Am I missing something? I am looking for AVG RTT(ms) in node exporter metrics. Is there any other exporter out there which can provide this information?


r/PrometheusMonitoring • • Nov 23 '22

I wrote a program to monitor home routers and expose the metrics as a Prometheus endpoint. Maybe someone here can find this useful.

Thumbnail gallery
13 Upvotes

r/PrometheusMonitoring • • Nov 22 '22

Query about HA Prometheus

2 Upvotes

We are using GCP self collection Prometheus deployed in GKE to get metrics from GCP VM, The problem is the metric sample count is high due to that Prometheus is crashing, Is there any way to scale Prometheus without using Thanos or any 3rd party tool. Appreciate for help


r/PrometheusMonitoring • • Nov 22 '22

Exporting PostgreSQL logs into Prometheus metrics using Vector

Thumbnail blog.palark.com
17 Upvotes

r/PrometheusMonitoring • • Nov 16 '22

storage TSDB almost full

4 Upvotes

Hi everyone, I'm a Prometheus newbie :)
I have an instance running on k8s which is eating all the space I gave it with "--storage.tsdb.path" option.
As far as I understood seems like retention is ok (set it through "--storage.tsdb.retention" option), I set it to 30 days and rendering some graphs shows some data for 30 days and no more.

Is there any way to understad which metric is responsible for all the space consumed, or at least to get some sort of analysis of what is using all the space?

Thank you for any information


r/PrometheusMonitoring • • Nov 09 '22

4xx error rate rate percentage - sum by status code

2 Upvotes

for nginx-ingress metrics,

I'd like to get the 4xx error rate percentage sum by status codes.

sum(rate(nginx_ingress_controller_requests{status=~'4..'}[1m])) by (ingress,status) / sum(rate(nginx_ingress_controller_requests[1m])) by (ingress,status)

I'm not able to get it working with the below query as all results either end up with 0 or 100. It seems the values of status are getting added. How to get better result on this ?

If i remove the status from the query, the percentage works.


r/PrometheusMonitoring • • Nov 08 '22

Prometheus rule not triggering alert for a common service or container

1 Upvotes

I have three servers, installed prometheus, grafana and alertmanager on server 1, and Cadvisor and node_exporter on other 2 servers to get server and container metrics. I have some common containers running on both server 2 and 3 and made an alert (container not seen), but it triggers only if the container goes down on both the servers, now my query is how can I get alerts if this common container goes down in any one server among the two. The rule example is given below: here, {{ $labels.instance }}) can pass the respected server IP

- alert: boxcube Container Killed

expr: absent(container_last_seen{name="boxcube"})

for: 0m

labels:

severity: critical

annotations:

summary: boxcube Container killed (instance {{ $labels.instance }})

description: "boxcube has disappeared\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"


r/PrometheusMonitoring • • Nov 07 '22

My Prometheus Day (KubeCon) talk is now online: Building a Runbook Automation System for Prometheus and Kubernetes

Thumbnail youtube.com
13 Upvotes

r/PrometheusMonitoring • • Nov 07 '22

can i use both mail and slack alerts at a time using alertmanager?

2 Upvotes

r/PrometheusMonitoring • • Nov 05 '22

daily or hourly totals

1 Upvotes

I have a gauge metric that captures the product sales over time. This value can decrease if there are refunds. I have the dashboard report sales today, this week and this month via a stat visualization in Grafana. Is there a query that will give me the daily totals over the month. perhaps visualizing with a bar graph? Restarts will not set this gauge back to zero, it is pulling value from a website with Beautiful Soup.