본문 바로가기
공부/Monitoring

[grafana api/alert] provisiong api 에서 수정 가능하게 하기

by haejang 2025. 7. 20.
728x90
728x90

 

 

그라파나에서 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했다.

 

 

 

 

728x90
728x90

댓글