Giter Club home page Giter Club logo

Comments (5)

Zhang21 avatar Zhang21 commented on May 27, 2024

一个示例的收集:收集数据库的机器,将机器分组为 dba;收集中间件的机器,将机器分组为 mw。

- labels:
    hostgroup: dba
    hostname: mysql-demo-01
  targerts:
    - 127.0.0.1:9100
    - 127.0.0.1:9256
    - ...

- labels:
    hostgroup: mw
    hostname: es-demo-01
  targerts:
    - 127.0.0.1:9100
    - 127.0.0.1:9256
    - ...

from prometheusalert.

Zhang21 avatar Zhang21 commented on May 27, 2024

一个示例的告警:不填写告警通知对象,程序从 labels.hostgroup 获取告警组。

  - alert: CPU负载大于2Cores
    expr: node_load1 > (instance:node_cpus:count * 2) 
    for: 4m
    labels:
      severity: critical
      level: 3
    annotations:
      description: "主机 {{ $labels.hostname }} CPU负载 {{ $value }}"

from prometheusalert.

Zhang21 avatar Zhang21 commented on May 27, 2024

PrometheusAlert 发送告警的时候,从 labels.hostgroup 获取主机组作为告警组,然后从 app.conf 中取得对应组的通知地址(wxurl, ddurl, fsurl, phone...),发送告警。

如果 labels.hostgroup 为空,则还是使用之前发送告警的逻辑。

from prometheusalert.

Zhang21 avatar Zhang21 commented on May 27, 2024

这样是不是可行,有没有必要?

from prometheusalert.

Zhang21 avatar Zhang21 commented on May 27, 2024

暂时不太需要!

from prometheusalert.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.