Repository navigation
Alerting Setup
Flag Responder reacts to Flagsmith Feature Health events. This page connects real monitoring to them.
flowchart LR
P["Prometheus<br/>alert rule with labels<br/>flagsmith_feature, flagsmith_environment"] --> AM["Alertmanager<br/>webhook receiver"]
AM --> FH["Flagsmith Feature Health<br/>'Grafana' provider webhook"]
G["Grafana alerting,<br/>Datadog, a script…"] --> FH2["Flagsmith Feature Health<br/>'Webhook' provider"]
FH --> E[("Health events")]
FH2 --> E
E --> R["Flag Responder<br/>🔥 on the code"]
Hover any flag check, click Alert rule, and pick an environment. Flag Responder:
- creates the project's Grafana Feature Health provider if there isn't one (after asking you);
- opens a YAML file with a Prometheus alerting rule and an Alertmanager receiver, also copied to your clipboard.
groups:
- name: flagsmith-feature-health
rules:
- alert: NewCheckoutUnhealthy
expr: '<your query: when is this feature unhealthy?>'
for: 2m
labels:
flagsmith_feature: "new_checkout"
flagsmith_environment: "Production"
---
receivers:
- name: flagsmith-feature-health
webhook_configs:
- url: "<the provider's webhook URL>"
send_resolved: trueReplace the example expr with a query for your feature, add the rule to Prometheus and the receiver to Alertmanager. send_resolved: true matters: the resolved alert is what makes Flag Responder offer the restore.
Keep the labels exact. flagsmith_environment must match the environment's name in Flagsmith, capitals included. Anything else marks the flag unhealthy for the whole project. Flag Responder then shows it in every environment where the flag is on, which is safe but less precise.
Keep the webhook URL secret. Anyone with it can mark your flags unhealthy.
Create a Webhook provider in Flagsmith (Project settings → Feature Health), then POST JSON to its URL:
{ "feature": "new_checkout", "environment": "Production", "status": "unhealthy",
"reason": { "text_blocks": [{ "title": "Checkout error rate", "text": "12.4% failing" }],
"url_blocks": [{ "title": "Dashboard", "url": "https://grafana.example/d/checkout" }] } }Send the same with "status": "healthy" when it recovers. demo-app/simulate-incident.mjs does exactly this, so it's a good template.
Flagsmith can't push to the editor, so Flag Responder checks for new events every flaglens.pollSeconds (15 by default). Expect the 🔥 line within one interval of the alert reaching Flagsmith.
Repository · Latest release · Report an issue · Wiki sources live in docs/wiki: edit them there and republish.