그라파나에서 alert을 만들 수 있는 api는 provisioning api 밖에 없다.
https://grafana.com/docs/grafana/latest/developers/http_api/alerting_provisioning/
Alerting Provisioning HTTP API | Grafana documentation
Getting started with managing your metrics, logs, and traces using Grafana In this webinar, we’ll demo how to get started using the LGTM Stack: Loki for logs, Grafana for visualization, Tempo for traces, and Mimir for metrics.
grafana.com
provisioning api가 뭐냐? -> provisioned 딱지가 붙으면서 콘솔에서는 수정이 불가하게 만들어짐 (api로는 수정, 삭제 가능)
-> api로 만든 후 콘솔에서 자유롭게 수정하고 싶은데..
다행히 콘솔에서 수정가능케 하는 방법이 있었다.
https://grafana.com/docs/grafana/latest/developers/http_api/alerting_provisioning/#parameters-16
Alerting Provisioning HTTP API | Grafana documentation
Getting started with managing your metrics, logs, and traces using Grafana In this webinar, we’ll demo how to get started using the LGTM Stack: Loki for logs, Grafana for visualization, Tempo for traces, and Mimir for metrics.
grafana.com
결론적으로, 아래 헤더를 추가해서 API를 날리면 된다.
X-Disable-Provenance: true
X-Disable-Provenance 라는 헤더가 포함되기만 하면 provisioned 가 비활되는 것 같다.
문서상으론 contact point와 notification policy도 동일하게 적용된다는것 같은데 적용되지 않았다 ...
(notification policy는 create 아니고 update라 한번 api로 수정되니 콘솔에서 더이상 건들수가 없었고 db에서 직접 설정을 조작해줘야 했다..)
근데 그 둘은 꼭 API로 만들 필요는 없어서 pass했다.
끝
'공부 > Monitoring' 카테고리의 다른 글
| grafana api콜버튼 플러그인 (in helm chart) (1) | 2024.08.28 |
|---|---|
| [Robusta] 직관적인 쿠버네티스 클러스터 알람 받기 (8) | 2024.06.06 |
| [Grafana Mimir] Mimir Helm 설치/셋업 도중 트러블슈팅 (24) | 2024.03.28 |
| [grafana] provisioned Datasource/ContactPoint 제거 (0) | 2023.09.05 |
| [Grafana Loki] Errors loading rules (3) | 2023.07.27 |
댓글