Skip to content

Instantly share code, notes, and snippets.

@buzztaiki
Last active January 6, 2023 08:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save buzztaiki/ffea817ef37349ab9875b735c1163553 to your computer and use it in GitHub Desktop.
Save buzztaiki/ffea817ef37349ab9875b735c1163553 to your computer and use it in GitHub Desktop.
Grafana の ngalert (unified alert) から設定をエクスポートする

Grafana の ngalert (unified alert) から設定をエクスポートする

ブラウザのコンソールからこんな感じで。

const fetch_and_print = url => fetch(url).then(x => x.text()).then(x => console.log(JSON.stringify(JSON.parse(x), null, 2)));
fetch_and_print("/api/alertmanager/grafana/config/api/v1/alerts")
fetch_and_print("/api/prometheus/grafana/api/v1/rules")

参考

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment