Comments (7)
It seems the alertname
variable is only available as a groupLabel in a notification template, and you can't template webhooks. 😕
Any suggestions?
from prometheus-config.
currently i moved from annotations in alert rules to alerta telegram template
mine now is
{% if customer %}Customer: `{{customer}}` {% endif %}
*[{{ status.capitalize() }}] {{ environment }} {{ severity.capitalize() }}*
{{ event | replace("_","\_") }} {{ resource.capitalize() }}
\`\`\`
{{ text }}
\`\`\`
{% if status == 'open' %}[Runbook](https://XXXX/display/NOCRUN/{{ event | replace("_","") }}){% endif %}
It works but that is not what i'm expected to see.
Btw that issue not for solving but probably about fixing doc to bee less frustrating
from prometheus-config.
That's very interesting. How is that template picked up? Can you paste an example Prometheus and Alertmanager config file so that I can understand how it all hangs together? Thanks.
from prometheus-config.
I've updated the README (by deleting all references to runbook) and the example config (by adding a note) to reflect that alertname
is not supported in annotation.
from prometheus-config.
@freeseacher your opinion on alerta/alerta#732 would be appreciated. Thanks.
from prometheus-config.
That's very interesting. How is that template picked up? Can you paste an example Prometheus and Alertmanager config file so that I can understand how it all hangs together? Thanks.
alertmanager.yaml
global:
http_config:
proxy_url: 'http://proxy:3128'
smtp_smarthost: mysmtp
smtp_from: mymail
smtp_require_tls: false
smtp_hello: prom
smtp_auth_username: yyy
smtp_auth_password: xxx
inhibit_rules:
- source_match:
severity: 'critical'
target_match:
severity: 'warning'
# Apply inhibition if the alertname is the same.
equal: ['alertname']
route:
group_wait: 30s
group_interval: 1m
receiver: 'alerta'
routes:
- receiver: 'alerta'
continue: true
- receiver: "infra-alert"
match:
scope: infra
- receiver: "system-alert"
match:
scope: system
receivers:
- name: "alerta"
webhook_configs:
- url: 'https://alerta.XXX/api/webhooks/prometheus?api-key=XXXX'
send_resolved: true
- name: "system-alert"
email_configs:
- to: system-alert@XXX
send_resolved: true
- name: "infra-alert"
email_configs:
- to: infra-alert@XXX
send_resolved: true
prometheus.yaml
....
rule_files:
- rules/*.rules.yml
alerting:
alert_relabel_configs:
- target_label: environment
source_labels: ['env']
alertmanagers:
- static_configs:
- targets:
- alertmanager:9093
tg.tmpl loaded as usual on docker container starts and telegram plugin installed.
from prometheus-config.
Thanks for that. I don't quite understand how tg.tmpl
is used by the alerta webhook though. Or am I misunderstanding what is happening there?
Either way, I've added support for python templating in the webhook so {{ $labels.alertname }}
can simply be replaced with {alertname}
now.
from prometheus-config.
Related Issues (20)
- Prometheus alert notification to OMNIBUS HOT 1
- README is out-of-date HOT 1
- Alertmanager Cluster HOT 10
- Getting - {"code":400,"errors":null,"message":"no alerts in Prometheus notification payload","status":"error"} HOT 5
- No data available in alerta web HOT 9
- Cannot able to see the critical alerts in Alerta dashboard. HOT 5
- How to altera list type field convert to a Prometheus rule configuration HOT 1
- Alertmanager (v0.19.0) can't send alerts. The response are always HTTP 400 HOT 14
- Alerta in HA with Alertmanager in HA
- Permission or scope for user HOT 1
- Multiple sources support (Alertmanager webhooks) HOT 3
- can we have multiple urls in alertmanager config HOT 1
- labels.__name__ not work HOT 1
- "customer" variable need to be an annotation, not a label HOT 4
- Looking for file or path to database in prometheus where alerts are stored in json or other format that reflects in grafana
- Can't access to /management/metrics with Alerta Docker HOT 1
- Prometheus Webhook error with AlertManager 0.8.0 version HOT 14
- Typos in readme.md
- Please explain in readme the following in more detail HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prometheus-config.