alertmanager icon indicating copy to clipboard operation
alertmanager copied to clipboard

Is that my configuration properly?

Open guxia opened this issue 10 years ago • 3 comments

global:
  smtp_smarthost: 'smtp.126.com:25'
  smtp_from: '[email protected]'
  smtp_auth_username: '[email protected]'
  smtp_auth_password: 'xxxxxxx'
  hipchat_auth_token: '1234556789'           -->What this is mean?And is it vital?
  hipchat_url: 'https://hipchat.foobar.org/'     -->What this is mean?And is it vital?
templates: 
- '~/myGopath/src/github.com/prometheus/alertmanager/template/*.tmpl'
route:
  group_by: ['alertname', 'cluster', 'service']
  group_wait: 30s
  group_interval: 5m
  repeat_interval: 3h 
  receiver: team-X-mails
  routes:
  - match_re:
      service: ^(foo1|foo2|baz)$
    receiver: team-X-mails
    routes:
    - match:
        severity: critical
      receiver: team-X-pager
  - match:
      service: files
    receiver: team-Y-mails
    routes:
    - match:
        severity: critical
      receiver: team-Y-pager
      service: database
    receiver: team-DB-pager
    group_by: [alertname, cluster, database]
    routes:
    - match:
        owner: team-X
      receiver: team-X-pager
    - match:
        owner: team-Y
      receiver: team-Y-pager
inhibit_rules:
- source_match:
    severity: 'critical'
  target_match:
    severity: 'warning'
  equal: ['alertname', 'cluster', 'service']
receivers:
- name: 'team-X-mails'
  email_configs:
  - to: '[email protected]'
- name: 'team-X-pager'
  email_configs:
  - to: '[email protected]'
  pagerduty_configs:
  - service_key: <team-X-key>
- name: 'team-Y-mails'
  email_configs:
  - to: '[email protected]'
- name: 'team-Y-pager'
  pagerduty_configs:
  - service_key: <team-Y-key>
- name: 'team-DB-pager'
  pagerduty_configs:
  - service_key: <team-DB-key>
- name: 'team-X-hipchat'
  hipchat_configs:
  - auth_token: <auth_token>
    room_id: 85
    message_format: html
    notify: true

Prometheus.rules:

ALERT APIHighRequestLatency
  IF histogram_labels_metric_bucket{le="0.5"} > 1
  FOR 1m
  ANNOTATIONS {description="{{ $labels.instance }} has a median request latency above 1s (current value: {{ $value }}s)", summary="High request latency on {{ $labels.instance }}"}

If i want to receive mail use by '[email protected]'。Do I have to do anything else? It seems a little complex for me。Do you have a relevant example configuration?

guxia avatar Apr 28 '16 02:04 guxia

hipchat is an instant message service. If you don't use it, you can comment if out

jhaohai avatar Apr 28 '16 02:04 jhaohai

See my general answer here: https://github.com/prometheus/alertmanager/issues/332#issuecomment-215364153

Hope that helps.

juliusv avatar Apr 28 '16 09:04 juliusv

I assume that the articles linked above give enough of an explanation of how to get started, so I'm closing this issue for now.

Please reopen / open another one if you have more questions, or ideally, ask general questions on the mailing list or IRC (see https://prometheus.io/community/).

juliusv avatar Apr 28 '16 10:04 juliusv