Skip to content
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

Round values #198

Open
camelstrike opened this issue Feb 17, 2021 · 4 comments
Open

Round values #198

camelstrike opened this issue Feb 17, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@camelstrike
Copy link

Hello all,

I just set up some alerts and im pretty happy with the results although some values look kinda off for my human eye when multiple alerts fire up at the same time.

Was thinking if it wouldn't be better to round queries where operators are use and compared to integers.

For example:

round(sum by (name,instance,job) (rate(node_network_receive_bytes_total[2m])) / 1024 / 1024) > 100

108

Instead of:

sum by (name,instance,job) (rate(node_network_receive_bytes_total[2m])) / 1024 / 1024 > 100

108.47109491560195

Are they any pros and cons you can think of?

@samber
Copy link
Owner

samber commented Feb 18, 2021

I agree with this issue. And we already had this feedback here.

Do you have some spare time to address this issue?
I would like to divide the work between a few contributors.

@camelstrike
Copy link
Author

Sure, let me know how and I'll be more than glad to help

@samber
Copy link
Owner

samber commented Feb 21, 2021

I have no idea how much time it takes to check every query. The last time I went through a large refacto (adding a custom for), it took me probably 3 or 4 hours.

In that case, it may affect only rules using (i)rate, avg, predict_linear and divisions.

⚠️ Not sure round is always the best solution. What about ceil + floor?

I just figured out that round accepts 2 arguments:

image

For percentage rules, we can use round(whatever, 0.01).

I will find some time this week to work on this. You can start with the exporters you know. ;)

Basic resource monitoring (88 rules)

  • Prometheus self-monitoring
  • Host and hardware
  • Docker containers
  • Blackbox
  • Windows Server
  • VMware
  • Netdata

Databases and brokers (129 rules)

  • MySQL
  • PostgreSQL
  • SQL Server
  • PGBouncer
  • Redis
  • MongoDB
  • RabbitMQ
  • Elasticsearch
  • Cassandra
  • Zookeeper
  • Kafka

Reverse proxies and load balancers (43 rules)

  • Nginx
  • Apache
  • HaProxy
  • Traefik

Runtimes (3 rules)

  • PHP-FPM
  • JVM
  • Sidekiq

Orchestrators (62 rules)

  • Kubernetes
  • Nomad
  • Consul
  • Etcd
  • Linkerd
  • Istio

Network and storage (26 rules)

  • Ceph
  • SpeedTest
  • ZFS
  • OpenEBS
  • Minio
  • SSL/TLS
  • Juniper
  • CoreDNS

Other (3 rules)

  • Thanos

// @TODO

  • Improve CONTRIBUTING.md
  • Add a short PR template

@samber samber added the enhancement New feature or request label Jun 14, 2022
@meoww-bot
Copy link
Contributor

I saw there are some round cases in rule config file, for example:
{{ printf \"%.0f\" $value }} used in alert HostEdacCorrectableErrorsDetected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants