알림 프로비저닝(Alerting Provisioning) HTTP API
알림 프로비저닝(Alerting Provisioning) HTTP API
Alerting Provisioning HTTP API는 Grafana 관리형 알림(Grafana-managed alerts)과 관련된 리소스를 생성, 수정, 삭제하는 데 사용할 수 있어요. 이 API는 Grafana Terraform 프로바이더가 사용하는 API예요.
Grafana Enterprise를 사용 중이라면 일부 엔드포인트에 특정 권한을 추가해야 해요. 자세한 내용은 "Role-based access control permissions" 문서를 참조해요.
⚠️ 이 API의 contact points, notification policies, notification template groups, mute timings 엔드포인트는 더 이상 사용되지 않으며(deprecated) 향후 릴리스에서 제거될 예정이에요. 대신 "Grafana App Platform alerting APIs"를 사용해요.
⚠️ Grafana 13부터
/api엔드포인트가/apis라우트로 대체되어 더 이상 사용되지 않게(deprecated) 되고 있어요. Grafana가 기존 API를 마이그레이션하는 동안 현재 사용 중인 레거시 API와 정확히 일치하지 않을 수 있어요. 이 변경으로 현재 설정이 중단되거나 깨지지는 않아요. 레거시 API는 비활성화되지 않으며 완전히 접근·사용 가능하지만,/api라우트는 더 이상 업데이트되지 않아요. 자세한 내용은 "Grafana의 새 API 구조" 문서를 참조해요.
출처: 문서
본문
Grafana 관리형 엔드포인트
💡 Alerting provisioning HTTP API에서 엔드포인트는
export엔드포인트가 반환하는 형식과 다른 JSON 형식을 사용해요.
export엔드포인트를 사용하면 파일을 통한 프로비저닝에 적합한 JSON 형식으로 알림 리소스를 내보낼 수 있어요. 그러나 이 형식은 HTTP API로 리소스를 업데이트하는 데는 사용할 수 없어요.
Alert rules
다음 엔드포인트는 경고 규칙(alert rules)과 기록 규칙(recording rules)을 모두 관리하는 데 사용할 수 있어요. 기록 규칙을 만들려면 condition 필드 대신 요청에 record 블록을 포함해요.
| Method | URI | Name | Summary |
|---|---|---|---|
| DELETE | /api/v1/provisioning/alert-rules/:uid | route delete alert rule | UID로 특정 알람 규칙 삭제. |
| GET | /api/v1/provisioning/alert-rules/:uid | route get alert rule | UID로 특정 알람 규칙 가져오기. |
| POST | /api/v1/provisioning/alert-rules | route post alert rule | 새 경고 규칙 생성. |
| PUT | /api/v1/provisioning/alert-rules/:uid | route put alert rule | 기존 경고 규칙 업데이트. |
| GET | /api/v1/provisioning/alert-rules/:uid/export | route get alert rule export | 프로비저닝 파일 형식으로 경고 규칙 내보내기. |
| DELETE | /api/v1/provisioning/folder/:folderUid/rule-groups/:group | route delete alert rule group | 규칙 그룹 삭제. |
| GET | /api/v1/provisioning/folder/:folderUid/rule-groups/:group | route get alert rule group | 규칙 그룹 가져오기. |
| PUT | /api/v1/provisioning/folder/:folderUid/rule-groups/:group | route put alert rule group | 규칙 그룹 생성 또는 업데이트. |
| GET | /api/v1/provisioning/folder/:folderUid/rule-groups/:group/export | route get alert rule group export | 프로비저닝 파일 형식으로 규칙 그룹 내보내기. |
| GET | /api/v1/provisioning/alert-rules | route get alert rules | 모든 경고 규칙 가져오기. |
| GET | /api/v1/provisioning/alert-rules/export | route get alert rules export | 프로비저닝 파일 형식으로 모든 경고 규칙 내보내기. |
새 경고 규칙 예제 요청:
POST /api/v1/provisioning/alert-rules
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIj...ZYbk
{
"title": "TEST-API_1",
"ruleGroup": "API",
"folderUID": "SET_FOLDER_UID",
"noDataState": "OK",
"execErrState": "OK",
"for": "5m",
"keepFiringFor": "2m",
"orgId": 1,
"uid": "",
"condition": "B",
"annotations": {
"summary": "test_api_1"
},
"labels": {
"API": "test1"
},
"data": [
{
"refId": "A",
"queryType": "",
"relativeTimeRange": {
"from": 600,
"to": 0
},
"datasourceUid": "XXXXXXXXX-XXXXXXXXX-XXXXXXXXXX",
"model": {
"expr": "up",
"hide": false,
"intervalMs": 1000,
"maxDataPoints": 43200,
"refId": "A"
}
},
{
"refId": "B",
"queryType": "",
"relativeTimeRange": {
"from": 0,
"to": 0
},
"datasourceUid": "-100",
"model": {
"conditions": [
{
"evaluator": {
"params": [6],
"type": "gt"
},
"operator": {
"type": "and"
},
"query": {
"params": ["A"]
},
"reducer": {
"params": [],
"type": "last"
},
"type": "query"
}
],
"datasource": {
"type": "__expr__",
"uid": "-100"
},
"hide": false,
"intervalMs": 1000,
"maxDataPoints": 43200,
"refId": "B",
"type": "classic_conditions"
}
}
]
}
예제 응답:
HTTP/1.1 201 Created
Content-Type: application/json
{
"id": 1,
"uid": "XXXXXXXXX",
"orgID": 1,
"folderUID": "SET_FOLDER_UID",
"ruleGroup": "API3",
"title": "TEST-API_1",
"condition": "B",
"data": [
{
"refId": "A",
"queryType": "",
"relativeTimeRange": {
"from": 600,
"to": 0
},
"datasourceUid": "XXXXXXXXX-XXXXXXXXX-XXXXXXXXXX",
"model": {
"expr": "up",
"hide": false,
"intervalMs": 1000,
"maxDataPoints": 43200,
"refId": "A"
}
},
{
"refId": "B",
"queryType": "",
"relativeTimeRange": {
"from": 0,
"to": 0
},
"datasourceUid": "-100",
"model": {
"conditions": [
{
"evaluator": {
"params": [
6
],
"type": "gt"
},
"operator": {
"type": "and"
},
"query": {
"params": [
"A"
]
},
"reducer": {
"params": [],
"type": "last"
},
"type": "query"
}
],
"datasource": {
"type": "__expr__",
"uid": "-100"
},
"hide": false,
"intervalMs": 1000,
"maxDataPoints": 43200,
"refId": "B",
"type": "classic_conditions"
}
}
],
"updated": "2024-08-02T13:19:32.609640048Z",
"noDataState": "OK",
"execErrState": "OK",
"for": "5m",
"keepFiringFor": "2m",
"annotations": {
"summary": "test_api_1"
},
"labels": {
"API": "test1"
},
"provenance": "api",
"isPaused": false,
"notification_settings": null,
"record": null
}
Recording rules
기록 규칙(recording rules)을 사용하면 자주 사용하거나 계산 비용이 높은 쿼리를 미리 계산하고 결과를 새 시계열 메트릭으로 저장할 수 있어요. 동일한 경고 규칙 프로비저닝 엔드포인트는 condition, noDataState, execErrState 같은 경고 전용 필드 대신 record 필드를 포함해 기록 규칙 생성을 지원해요.
새 기록 규칙 예제 요청:
POST /api/v1/provisioning/alert-rules
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIj...ZYbk
{
"title": "my_recording_rule",
"ruleGroup": "recording_rules_group",
"folderUID": "SET_FOLDER_UID",
"for": "0s",
"orgId": 1,
"uid": "",
"labels": {
"team": "backend"
},
"data": [
{
"refId": "A",
"queryType": "",
"relativeTimeRange": {
"from": 600,
"to": 0
},
"datasourceUid": "PROMETHEUS_DATASOURCE_UID",
"model": {
"expr": "sum(rate(http_requests_total[5m]))",
"intervalMs": 1000,
"maxDataPoints": 43200,
"refId": "A"
}
}
],
"record": {
"metric": "http_requests:rate5m:sum",
"from": "A",
"target_datasource_uid": "TARGET_PROMETHEUS_UID"
}
}
예제 응답:
HTTP/1.1 201 Created
Content-Type: application/json
{
"id": 2,
"uid": "YYYYYYYYY",
"orgID": 1,
"folderUID": "SET_FOLDER_UID",
"ruleGroup": "recording_rules_group",
"title": "my_recording_rule",
"for": "0s",
"data": [
{
"refId": "A",
"queryType": "",
"relativeTimeRange": {
"from": 600,
"to": 0
},
"datasourceUid": "PROMETHEUS_DATASOURCE_UID",
"model": {
"expr": "sum(rate(http_requests_total[5m]))",
"intervalMs": 1000,
"maxDataPoints": 43200,
"refId": "A"
}
}
],
"updated": "2024-08-02T14:30:15.123456789Z",
"labels": {
"team": "backend"
},
"provenance": "api",
"isPaused": false,
"record": {
"metric": "http_requests:rate5m:sum",
"from": "A",
"target_datasource_uid": "TARGET_PROMETHEUS_UID"
}
}
기록 규칙에 대한 중요한 참고 사항:
metric필드는 유효한 Prometheus 메트릭 이름이어야 하며 공백을 포함할 수 없어요.from필드는 기록된 메트릭의 소스로 사용할 쿼리 참조(refId)를 지정해요.target_datasource_uid는 결과를 쓸 Prometheus 호환 데이터 소스를 지정해요. 지정하지 않으면[recording_rules].default_datasource_uid에 구성된 기본 데이터 소스가 사용돼요.- 기록 규칙은
condition,noDataState,execErrState,notification_settings필드를 지원하지 않아요. - 기록 규칙은 보류(pending) 상태가 없으므로
for를0s로 설정해요.
Contact points
| Method | URI | Name | Summary |
|---|---|---|---|
| DELETE | /api/v1/provisioning/contact-points/:uid | route delete contactpoints | 접점(contact point) 삭제. |
| GET | /api/v1/provisioning/contact-points | route get contactpoints | 모든 접점 가져오기. |
| POST | /api/v1/provisioning/contact-points | route post contactpoints | 접점 생성. |
| PUT | /api/v1/provisioning/contact-points/:uid | route put contactpoint | 기존 접점 업데이트. |
| GET | /api/v1/provisioning/contact-points/export | route get contactpoints export | 프로비저닝 파일 형식으로 모든 접점 내보내기. |
모든 접점 예제 요청:
GET /api/v1/provisioning/contact-points
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIj...k
예제 응답:
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"uid": "",
"name": "email receiver",
"type": "email",
"settings": {
"addresses": "<[email protected]>"
},
"disableResolveMessage": false
}
]
Receiver 권한
receiver 권한 엔드포인트는 접점 receiver에 대한 접근 제어를 관리해요. 이러한 엔드포인트를 사용해 특정 receiver에 대해 사용자, 팀 또는 기본 역할(built-in role)에 권한을 할당할 수 있어요.
| Method | URI | Name | Summary |
|---|---|---|---|
| POST | /api/access-control/receivers/:uid/users/:userID | route set user receiver permission | 특정 receiver에 대한 사용자 권한 설정. |
| POST | /api/access-control/receivers/:uid/teams/:teamID | route set team receiver permission | 특정 receiver에 대한 팀 권한 설정. |
| POST | /api/access-control/receivers/:uid/builtInRoles/:builtInRole | route set builtin receiver permission | 특정 receiver에 대한 기본 역할 권한 설정. |
사용자에게 권한을 할당하는 예제 요청:
POST /api/access-control/receivers/abc123/users/5
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIj...ZYbk
{
"permission": "Edit"
}
예제 응답:
HTTP/1.1 200 OK
Content-Type: application/json
{
"message": "Permission updated"
}
팀에서 권한을 제거하는 예제 요청:
POST /api/access-control/receivers/abc123/teams/3
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIj...ZYbk
{
"permission": ""
}
예제 응답:
HTTP/1.1 200 OK
Content-Type: application/json
{
"message": "Permission removed"
}
기본 역할에 권한을 할당하는 예제 요청:
POST /api/access-control/receivers/abc123/builtInRoles/Viewer
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIj...ZYbk
{
"permission": "View"
}
예제 응답:
HTTP/1.1 200 OK
Content-Type: application/json
{
"message": "Permission updated"
}
사용 가능한 권한 집합:
View- receiver에 대한 읽기 전용 접근.alert.notifications.receivers:read권한 부여.Edit- receiver를 업데이트하고 테스트할 수 있는 권한.Viewaction에 더해:alert.notifications.receivers:write,alert.notifications.receivers:delete,alert.notifications.receivers.test:create.Admin- 권한 관리와 비밀 읽기를 포함한 전체 접근.Editaction에 더해:alert.notifications.receivers.secrets:read,receivers.permissions:read,receivers.permissions:write,alert.notifications.receivers.protected:write.- 빈 문자열 (
"") - 권한을 제거.
Notification policies
| Method | URI | Name | Summary |
|---|---|---|---|
| DELETE | /api/v1/provisioning/policies | route reset policy tree | 알림 정책 트리 지우기. |
| GET | /api/v1/provisioning/policies | route get policy tree | 알림 정책 트리 가져오기. |
| PUT | /api/v1/provisioning/policies | route put policy tree | 알림 정책 트리 설정. |
| GET | /api/v1/provisioning/policies/export | route get policy tree export | 프로비저닝 파일 형식으로 알림 정책 트리 내보내기. |
YAML 형식으로 알림 정책 트리를 내보내는 예제 요청:
GET /api/v1/provisioning/policies/export?format=yaml
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIj...k
예제 응답:
HTTP/1.1 200 OK
Content-Type: text/yaml
apiVersion: 1
policies:
- orgId: 1
receiver: My Contact Email Point
group_by:
- grafana_folder
- alertname
routes:
- receiver: My Contact Email Point
object_matchers:
- - monitor
- =
- testdata
mute_time_intervals:
- weekends
Notification template groups
템플릿 그룹(template groups)을 사용하면 단일 그룹 안에 여러 알림 템플릿({{ define "" }})을 정의할 수 있어요. Grafana Alerting UI에서 관리할 수 있어요.
| Method | URI | Name | Summary |
|---|---|---|---|
| DELETE | /api/v1/provisioning/templates/:name | route delete template | 알림 템플릿 그룹 삭제. |
| GET | /api/v1/provisioning/templates/:name | route get template | 알림 템플릿 그룹 가져오기. |
| GET | /api/v1/provisioning/templates | route get template | 모든 알림 템플릿 그룹 가져오기. |
| PUT | /api/v1/provisioning/templates/:name | route put template | 알림 템플릿 그룹 생성 또는 업데이트. |
모든 알림 템플릿 그룹 예제 요청:
GET /api/v1/provisioning/templates
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIj...k
예제 응답:
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"name": "custom_email.message",
"template": "{{ define \"custom_email.message\" }}\n Custom alert!\n{{ end }}",
"provenance": "file"
},
{
"name": "custom_email.subject",
"template": "{{ define \"custom_email.subject\" }}\n{{ len .Alerts.Firing }} firing alert(s), {{ len .Alerts.Resolved }} resolved alert(s)\n{{ end }}",
"provenance": "file"
}
]
Mute timings
| Method | URI | Name | Summary |
|---|---|---|---|
| DELETE | /api/v1/provisioning/mute-timings/:name | route delete mute timing | 뮤트 타이밍 삭제. |
| GET | /api/v1/provisioning/mute-timings/:name | route get mute timing | 뮤트 타이밍 가져오기. |
| GET | /api/v1/provisioning/mute-timings | route get mute timings | 모든 뮤트 타이밍 가져오기. |
| POST | /api/v1/provisioning/mute-timings | route post mute timing | 새 뮤트 타이밍 생성. |
| PUT | /api/v1/provisioning/mute-timings/:name | route put mute timing | 기존 뮤트 타이밍 교체. |
| GET | /api/v1/provisioning/mute-timings/export | route get mute timings export | 프로비저닝 파일 형식으로 모든 뮤트 타이밍 내보내기. |
| GET | /api/v1/provisioning/mute-timings/:name/export | route get mute timing export | 프로비저닝 파일 형식으로 뮤트 타이밍 내보내기. |
모든 뮤트 타이밍 예제 요청:
GET /api/v1/provisioning/mute-timings
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIj...k
예제 응답:
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"name": "weekends",
"time_intervals": [
{
"weekdays": [
"saturday",
"sunday"
]
}
],
"version": "",
"provenance": "file"
}
]
Grafana UI에서 리소스 편집하기
기본적으로 API로 프로비저닝된 알림 리소스는 Grafana에서 편집할 수 없어요.
이러한 리소스를 Grafana UI에서 편집할 수 있게 하려면 다음 API 요청에 X-Disable-Provenance: true 헤더를 추가해요:
PUT /api/v1/provisioning/folder/{FolderUID}/rule-groups/{Group}: 이 작업은 규칙 그룹과 그 안의 모든 경고 규칙의 provenance도 설정해요.POST /api/v1/provisioning/alert-rules: 새 경고 규칙의 provenance는 규칙 그룹에 구성된 provenance 값과 일치해야 해요.POST /api/v1/provisioning/contact-pointsPOST /api/v1/provisioning/mute-timingsPUT /api/v1/provisioning/templates/{name}PUT /api/v1/provisioning/policies
알림 정책 트리를 기본값으로 재설정하고 Grafana UI에서 편집할 수 있게 잠금을 해제하려면 다음을 사용해요:
DELETE /api/v1/provisioning/policies
데이터 소스 관리형 리소스
⚠️ Grafana Cloud에서 사전 프로비저닝된 Loki, Prometheus 데이터 소스 관리형 알림은 더 이상 사용되지 않으며(deprecated) 새 스택에서 생성할 수 없어요.
새 Grafana Cloud 스택은 기본적으로 Grafana 관리형 알림(GMA)을 사용해요. 데이터 소스 관리형 알림(DMA)은 새 스택에서 프로비저닝되지 않아요. 기존 스택은 영향을 받지 않아요.
이는 Grafana Labs가 관리하는 기본 Loki, Prometheus Grafana Cloud 데이터 소스와 Cloud Alertmanager에 적용되며, 더 이상 사용할 수 없고 Grafana도 해당 데이터 소스를 프로비저닝하지 않아요. 자체 Mimir, Loki, Alertmanager 데이터 소스를 추가하면 데이터 소스 관리형 알림을 계속 사용할 수 있어요.
Cloud 사용자는 가져오기 도구로 DMA 규칙을 GMA 규칙으로 가져올 수 있어요. 방법은 "import data source-managed alerts to Grafana-managed alerts" 문서를 참조해요.
경로 (Routes)
UID로 특정 경고 규칙 삭제. (RouteDeleteAlertRule)
DELETE /api/v1/provisioning/alert-rules/:uid
⚠️ 이 API는 deprecated이며 향후 릴리스에서 제거될 예정이에요. Grafana App Platform alerting APIs를 대신 사용해요: 경고 규칙은
/apis/rules.alerting.grafana.app/v0alpha1/namespaces/{namespace}/alertrules/{name}, 기록 규칙은/apis/rules.alerting.grafana.app/v0alpha1/namespaces/{namespace}/recordingrules/{name}.
매개변수
| Name | Source | Type | Go type | Required | Default | Description |
|---|---|---|---|---|---|---|
| UID | path | string | string | ✓ | Alert rule UID | |
| X-Disable-Provenance: true | header | string | string | Grafana UI에서 프로비저닝된 리소스 편집 허용 |
모든 응답
| Code | Status | Description | Has headers | Schema |
|---|---|---|---|---|
| 204 | No Content | 경고 규칙이 성공적으로 삭제되었음. | schema |
규칙 그룹 삭제. (RouteDeleteAlertRuleGroup)
DELETE /api/v1/provisioning/folder/:folderUid/rule-groups/:group
⚠️ 이 API는 deprecated이며 향후 릴리스에서 제거될 예정이에요. Grafana App Platform alerting APIs를 대신 사용해요: 경고 규칙은
/apis/rules.alerting.grafana.app/v0alpha1/namespaces/{namespace}/alertrules, 기록 규칙은/apis/rules.alerting.grafana.app/v0alpha1/namespaces/{namespace}/recordingrules.
매개변수
| Name | Source | Type | Go type | Required | Default | Description |
|---|---|---|---|---|---|---|
| FolderUID | path | string | string | ✓ | ||
| Group | path | string | string | ✓ | ||
| X-Disable-Provenance: true | header | string | string | Grafana UI에서 프로비저닝된 리소스 편집 허용 |
모든 응답
| Code | Status | Description | Has headers | Schema |
|---|---|---|---|---|
| 204 | No Content | 규칙 그룹이 성공적으로 삭제되었음. | schema | |
| 403 | Forbidden | ForbiddenError | schema | |
| 404 | Not Found | NotFound | schema |
접점 삭제. (RouteDeleteContactpoints)
DELETE /api/v1/provisioning/contact-points/:uid
⚠️ 이 API는 deprecated이며 향후 릴리스에서 제거될 예정이에요. Grafana App Platform alerting APIs를 대신 사용해요: receiver는
/apis/notifications.alerting.grafana.app/v1beta1/namespaces/{namespace}/receivers/{name}.
매개변수
| Name | Source | Type | Go type | Required | Default | Description |
|---|---|---|---|---|---|---|
| UID | path | string | string | ✓ | UID is the contact point unique identifier |
모든 응답
| Code | Status | Description | Has headers | Schema |
|---|---|---|---|---|
| 204 | No Content | 접점이 성공적으로 삭제되었음. | schema |
뮤트 타이밍 삭제. (RouteDeleteMuteTiming)
DELETE /api/v1/provisioning/mute-timings/:name
⚠️ 이 API는 deprecated이며 향후 릴리스에서 제거될 예정이에요. Grafana App Platform alerting APIs를 대신 사용해요: 뮤트 타이밍은
/apis/notifications.alerting.grafana.app/v1beta1/namespaces/{namespace}/timeintervals/{name}.
매개변수
| Name | Source | Type | Go type | Required | Default | Description |
|---|---|---|---|---|---|---|
| name | path | string | string | ✓ | Mute timing name | |
| version | query | string | string | 리소스의 현재 버전. 낙관적 동시성 검증에 사용됨. 검증을 건너뛰려면 비워 둠. |
모든 응답
| Code | Status | Description | Has headers | Schema |
|---|---|---|---|---|
| 204 | No Content | 뮤트 타이밍이 성공적으로 삭제되었음. | schema | |
| 409 | Conflict | GenericPublicError | schema |
알림 템플릿 그룹 삭제. (RouteDeleteTemplate)
DELETE /api/v1/provisioning/templates/:name
⚠️ 이 API는 deprecated이며 향후 릴리스에서 제거될 예정이에요. Grafana App Platform alerting APIs를 대신 사용해요: 알림 템플릿 그룹은
/apis/notifications.alerting.grafana.app/v1beta1/namespaces/{namespace}/templategroups/{name}.
매개변수
| Name | Source | Type | Go type | Required | Default | Description |
|---|---|---|---|---|---|---|
| name | path | string | string | ✓ | 템플릿 그룹 이름 | |
| version | query | string | string | 리소스의 현재 버전. 낙관적 동시성 검증에 사용됨. 검증을 건너뛰려면 비워 둠. |
모든 응답
| Code | Status | Description | Has headers | Schema |
|---|---|---|---|---|
| 204 | No Content | 템플릿이 성공적으로 삭제되었음. | schema | |
| 409 | Conflict | GenericPublicError | schema |
UID로 특정 경고 규칙 가져오기. (RouteGetAlertRule)
GET /api/v1/provisioning/alert-rules/:uid
⚠️ 이 API는 deprecated이며 향후 릴리스에서 제거될 예정이에요. Grafana App Platform alerting APIs를 대신 사용해요: 경고 규칙은
/apis/rules.alerting.grafana.app/v0alpha1/namespaces/{namespace}/alertrules/{name}, 기록 규칙은/apis/rules.alerting.grafana.app/v0alpha1/namespaces/{namespace}/recordingrules/{name}.
매개변수
| Name | Source | Type | Go type | Required | Default | Description |
|---|---|---|---|---|---|---|
| UID | path | string | string | ✓ | Alert rule UID |
모든 응답
| Code | Status | Description | Has headers | Schema |
|---|---|---|---|---|
| 200 | OK | ProvisionedAlertRule | schema | |
| 404 | Not Found | Not found. | schema |
프로비저닝 파일 형식으로 경고 규칙 내보내기. (RouteGetAlertRuleExport)
GET /api/v1/provisioning/alert-rules/:uid/export
생성 (Produces)
application/jsonapplication/yamlapplication/terraform+hcltext/yamltext/hcl
이 출력은 파일 프로비저닝 또는 Terraform 프로비저닝용이며, 이들(JSON 출력 포함)은 HTTP API로 리소스를 업데이트하는 데 사용할 수 없어요.
매개변수
| Name | Source | Type | Go type | Required | Default | Description |
|---|---|---|---|---|---|---|
| UID | path | string | string | ✓ | Alert rule UID | |
| download | query | boolean | bool | 파일 다운로드를 시작할지 여부. | ||
| format | query | string | string | yaml | 다운로드한 파일의 형식, yaml, json 또는 hcl. Accept 헤더도 사용할 수 있지만 쿼리 매개변수가 우선함. |
모든 응답
| Code | Status | Description | Has headers | Schema |
|---|---|---|---|---|
| 200 | OK | AlertingFileExport | schema | |
| 404 | Not Found | Not found. | schema |
규칙 그룹 가져오기. (RouteGetAlertRuleGroup)
GET /api/v1/provisioning/folder/:folderUid/rule-groups/:group
⚠️ 이 API는 deprecated이며 향후 릴리스에서 제거될 예정이에요. Grafana App Platform alerting APIs를 대신 사용해요: 경고 규칙은
/apis/rules.alerting.grafana.app/v0alpha1/namespaces/{namespace}/alertrules, 기록 규칙은/apis/rules.alerting.grafana.app/v0alpha1/namespaces/{namespace}/recordingrules.
매개변수
| Name | Source | Type | Go type | Required | Default | Description |
|---|---|---|---|---|---|---|
| FolderUID | path | string | string | ✓ | ||
| Group | path | string | string | ✓ |
모든 응답
| Code | Status | Description | Has headers | Schema |
|---|---|---|---|---|
| 200 | OK | AlertRuleGroup | schema | |
| 404 | Not Found | Not found. | schema |
프로비저닝 파일 형식으로 규칙 그룹 내보내기. (RouteGetAlertRuleGroupExport)
GET /api/v1/provisioning/folder/:folderUid/rule-groups/:group/export
생성 (Produces)
application/jsonapplication/yamlapplication/terraform+hcltext/yamltext/hcl
이 출력은 파일 프로비저닝 또는 Terraform 프로비저닝용이며, 이들(JSON 출력 포함)은 HTTP API로 리소스를 업데이트하는 데 사용할 수 없어요.
매개변수
| Name | Source | Type | Go type | Required | Default | Description |
|---|---|---|---|---|---|---|
| FolderUID | path | string | string | ✓ | ||
| Group | path | string | string | ✓ | ||
| download | query | boolean | bool | 파일 다운로드를 시작할지 여부. | ||
| format | query | string | string | yaml | 다운로드한 파일의 형식, yaml, json 또는 hcl. Accept 헤더도 사용할 수 있지만 쿼리 매개변수가 우선함. |
모든 응답
| Code | Status | Description | Has headers | Schema |
|---|---|---|---|---|
| 200 | OK | AlertingFileExport | schema | |
| 404 | Not Found | Not found. | schema |
모든 경고 규칙 가져오기. (RouteGetAlertRules)
GET /api/v1/provisioning/alert-rules
⚠️ 이 API는 deprecated이며 향후 릴리스에서 제거될 예정이에요. Grafana App Platform alerting APIs를 대신 사용해요: 경고 규칙은
/apis/rules.alerting.grafana.app/v0alpha1/namespaces/{namespace}/alertrules, 기록 규칙은/apis/rules.alerting.grafana.app/v0alpha1/namespaces/{namespace}/recordingrules.
모든 응답
| Code | Status | Description | Has headers | Schema |
|---|---|---|---|---|
| 200 | OK | ProvisionedAlertRules | schema |
프로비저닝 파일 형식으로 모든 경고 규칙 내보내기. (RouteGetAlertRulesExport)
GET /api/v1/provisioning/alert-rules/export
생성 (Produces)
application/jsonapplication/yamlapplication/terraform+hcltext/yamltext/hcl
이 출력은 파일 프로비저닝 또는 Terraform 프로비저닝용이며, 이들(JSON 출력 포함)은 HTTP API로 리소스를 업데이트하는 데 사용할 수 없어요.
매개변수
| Name | Source | Type | Go type | Required | Default | Description |
|---|---|---|---|---|---|---|
| download | query | boolean | bool | 파일 다운로드를 시작할지 여부. | ||
| format | query | string | string | yaml | 다운로드한 파일의 형식, yaml, json 또는 hcl. Accept 헤더도 사용할 수 있지만 쿼리 매개변수가 우선함. |
모든 응답
| Code | Status | Description | Has headers | Schema |
|---|---|---|---|---|
| 200 | OK | AlertingFileExport | schema | |
| 404 | Not Found | Not found. | schema |
모든 접점 가져오기. (RouteGetContactpoints)
GET /api/v1/provisioning/contact-points
⚠️ 이 API는 deprecated이며 향후 릴리스에서 제거될 예정이에요. Grafana App Platform alerting APIs를 대신 사용해요: receiver는
/apis/notifications.alerting.grafana.app/v1beta1/namespaces/{namespace}/receivers.
매개변수
| Name | Source | Type | Go type | Required | Default | Description |
|---|---|---|---|---|---|---|
| name | query | string | string | 이름으로 필터링 |
모든 응답
| Code | Status | Description | Has headers | Schema |
|---|---|---|---|---|
| 200 | OK | ContactPoints | schema |
프로비저닝 파일 형식으로 모든 접점 내보내기. (RouteGetContactpointsExport)
GET /api/v1/provisioning/contact-points/export
생성 (Produces)
application/jsonapplication/yamlapplication/terraform+hcltext/yamltext/hcl
이 출력은 파일 프로비저닝 또는 Terraform 프로비저닝용이며, 이들(JSON 출력 포함)은 HTTP API로 리소스를 업데이트하는 데 사용할 수 없어요.
매개변수
| Name | Source | Type | Go type | Required | Default | Description |
|---|---|---|---|---|---|---|
| decrypt | query | boolean | bool | 포함된 보안 설정을 복호화할지 아니면 편집(redact)할지 여부. 편집된 설정에는 대신 RedactedValue가 포함됨. 현재 조직 admin만 복호화된 보안 설정을 볼 수 있음. | ||
| download | query | boolean | bool | 파일 다운로드를 시작할지 여부. | ||
| format | query | string | string | yaml | 다운로드한 파일의 형식, yaml, json 또는 hcl. Accept 헤더도 사용할 수 있지만 쿼리 매개변수가 우선함. | |
| name | query | string | string | 이름으로 필터링 |
모든 응답
| Code | Status | Description | Has headers | Schema |
|---|---|---|---|---|
| 200 | OK | AlertingFileExport | schema | |
| 403 | Forbidden | PermissionDenied | schema |
특정 receiver에 대한 사용자 권한 설정. (RouteSetUserReceiverPermission)
POST /api/access-control/receivers/:uid/users/:userID
이 엔드포인트는 receiver에 대한 특정 사용자의 권한을 설정하거나 제거해요. 권한을 제거하려면 permission 값으로 빈 문자열을 보내요.
💡 이 엔드포인트는 Grafana Enterprise가 필요하며, 사용자는 지정된 receiver에 대해
receivers.permissions:write권한이 있어야 해요.
매개변수
| Name | Source | Type | Go type | Required | Default | Description |
|---|---|---|---|---|---|---|
| uid | path | string | string | ✓ | receiver의 UID | |
| userID | path | int64 | int64 | ✓ | 권한을 할당할 사용자의 ID | |
| body | body | object | object | ✓ | permission 필드가 있는 JSON body: View, Edit, Admin, 또는 "" (제거하려면 비움) |
모든 응답
| Code | Status | Description | Has headers | Schema |
|---|---|---|---|---|
| 200 | OK | Permission updated | schema | |
| 400 | Bad Request | Invalid request | schema | |
| 403 | Forbidden | Permission denied | schema |
응답
200 - Permission updated
{
"message": "Permission updated"
}
특정 receiver에 대한 팀 권한 설정. (RouteSetTeamReceiverPermission)
POST /api/access-control/receivers/:uid/teams/:teamID
이 엔드포인트는 receiver에 대한 특정 팀의 권한을 설정하거나 제거해요. 권한을 제거하려면 permission 값으로 빈 문자열을 보내요.
💡 이 엔드포인트는 Grafana Enterprise가 필요하며, 사용자는 지정된 receiver에 대해
receivers.permissions:write권한이 있어야 해요.
매개변수
| Name | Source | Type | Go type | Required | Default | Description |
|---|---|---|---|---|---|---|
| uid | path | string | string | ✓ | receiver의 UID | |
| teamID | path | int64 | int64 | ✓ | 권한을 할당할 팀의 ID | |
| body | body | object | object | ✓ | permission 필드가 있는 JSON body: View, Edit, Admin, 또는 "" (제거하려면 비움) |
모든 응답
| Code | Status | Description | Has headers | Schema |
|---|---|---|---|---|
| 200 | OK | Permission updated | schema | |
| 400 | Bad Request | Invalid request | schema | |
| 403 | Forbidden | Permission denied | schema |
응답
200 - Permission updated
{
"message": "Permission updated"
}
특정 receiver에 대한 기본 역할 권한 설정. (RouteSetBuiltinReceiverPermission)
POST /api/access-control/receivers/:uid/builtInRoles/:builtInRole
이 엔드포인트는 receiver에 대한 기본 역할(built-in role)의 권한을 설정하거나 제거해요. 권한을 제거하려면 permission 값으로 빈 문자열을 보내요.
💡 이 엔드포인트는 Grafana Enterprise가 필요하며, 사용자는 지정된 receiver에 대해
receivers.permissions:write권한이 있어야 해요.
매개변수
| Name | Source | Type | Go type | Required | Default | Description |
|---|---|---|---|---|---|---|
| uid | path | string | string | ✓ | receiver의 UID | |
| builtInRole | path | string | string | ✓ | 기본 역할 이름: Viewer, Editor, 또는 Admin | |
| body | body | object | object | ✓ | permission 필드가 있는 JSON body: View, Edit, Admin, 또는 "" (제거하려면 비움) |
모든 응답
| Code | Status | Description | Has headers | Schema |
|---|---|---|---|---|
| 200 | OK | Permission updated | schema | |
| 400 | Bad Request | Invalid request | schema | |
| 403 | Forbidden | Permission denied | schema |
응답
200 - Permission updated
{
"message": "Permission updated"
}
뮤트 타이밍 가져오기. (RouteGetMuteTiming)
GET /api/v1/provisioning/mute-timings/:name
⚠️ 이 API는 deprecated이며 향후 릴리스에서 제거될 예정이에요. Grafana App Platform alerting APIs를 대신 사용해요: 뮤트 타이밍은
/apis/notifications.alerting.grafana.app/v1beta1/namespaces/{namespace}/timeintervals/{name}.
매개변수
| Name | Source | Type | Go type | Required | Default | Description |
|---|---|---|---|---|---|---|
| name | path | string | string | ✓ | Mute timing name |
모든 응답
| Code | Status | Description | Has headers | Schema |
|---|---|---|---|---|
| 200 | OK | MuteTimeInterval | schema | |
| 404 | Not Found | Not found. | schema |
모든 뮤트 타이밍 가져오기. (RouteGetMuteTimings)
GET /api/v1/provisioning/mute-timings
⚠️ 이 API는 deprecated이며 향후 릴리스에서 제거될 예정이에요. Grafana App Platform alerting APIs를 대신 사용해요: 뮤트 타이밍은
/apis/notifications.alerting.grafana.app/v1beta1/namespaces/{namespace}/timeintervals.
모든 응답
| Code | Status | Description | Has headers | Schema |
|---|---|---|---|---|
| 200 | OK | MuteTimings | schema |
프로비저닝 파일 형식으로 모든 뮤트 타이밍 내보내기. (RouteGetMuteTimingsExport)
GET /api/v1/provisioning/mute-timings/export
생성 (Produces)
application/jsonapplication/yamlapplication/terraform+hcltext/yamltext/hcl
이 출력은 파일 프로비저닝 또는 Terraform 프로비저닝용이며, 이들(JSON 출력 포함)은 HTTP API로 리소스를 업데이트하는 데 사용할 수 없어요.
매개변수
| Name | Source | Type | Go type | Required | Default | Description |
|---|---|---|---|---|---|---|
| download | query | boolean | bool | 파일 다운로드를 시작할지 여부. | ||
| format | query | string | string | yaml | 다운로드한 파일의 형식, yaml, json 또는 hcl. Accept 헤더도 사용할 수 있지만 쿼리 매개변수가 우선함. |
모든 응답
| Code | Status | Description | Has headers | Schema |
|---|---|---|---|---|
| 200 | OK | MuteTimingsExport | schema | |
| 403 | Forbidden | PermissionDenied | schema |
프로비저닝 파일 형식으로 뮤트 타이밍 내보내기. (RouteGetMuteTimingExport)
GET /api/v1/provisioning/mute-timings/:name/export
생성 (Produces)
application/jsonapplication/yamlapplication/terraform+hcltext/yamltext/hcl
이 출력은 파일 프로비저닝 또는 Terraform 프로비저닝용이며, 이들(JSON 출력 포함)은 HTTP API로 리소스를 업데이트하는 데 사용할 수 없어요.
매개변수
| Name | Source | Type | Go type | Required | Default | Description |
|---|---|---|---|---|---|---|
| name | path | string | string | ✓ | Mute timing name. | |
| download | query | boolean | bool | 파일 다운로드를 시작할지 여부. | ||
| format | query | string | string | yaml | 다운로드한 파일의 형식, yaml, json 또는 hcl. Accept 헤더도 사용할 수 있지만 쿼리 매개변수가 우선함. |
모든 응답
| Code | Status | Description | Has headers | Schema |
|---|---|---|---|---|
| 200 | OK | MuteTimingExport | schema | |
| 403 | Forbidden | PermissionDenied | schema |
알림 정책 트리 가져오기. (RouteGetPolicyTree)
GET /api/v1/provisioning/policies
⚠️ 이 API는 deprecated이며 향후 릴리스에서 제거될 예정이에요. Grafana App Platform alerting APIs를 대신 사용해요: 알림 정책은
/apis/notifications.alerting.grafana.app/v1beta1/namespaces/{namespace}/routingtrees.
모든 응답
| Code | Status | Description | Has headers | Schema |
|---|---|---|---|---|
| 200 | OK | Route | schema |
프로비저닝 파일 형식으로 알림 정책 트리 내보내기. (RouteGetPolicyTreeExport)
GET /api/v1/provisioning/policies/export
생성 (Produces)
application/jsonapplication/yamlapplication/terraform+hcltext/yamltext/hcl
이 출력은 파일 프로비저닝 또는 Terraform 프로비저닝용이며, 이들(JSON 출력 포함)은 HTTP API로 리소스를 업데이트하는 데 사용할 수 없어요.
매개변수
| Name | Source | Type | Go type | Required | Default | Description |
|---|---|---|---|---|---|---|
| download | query | boolean | bool | 파일 다운로드를 시작할지 여부. | ||
| format | query | string | string | yaml | 다운로드한 파일의 형식, yaml, json 또는 hcl. Accept 헤더도 사용할 수 있지만 쿼리 매개변수가 우선함. | |
| routeName | query | string | string | 내보낼 특정 라우팅 트리 이름. 생략하면 기본 정책 트리가 내보내짐. |
모든 응답
| Code | Status | Description | Has headers | Schema |
|---|---|---|---|---|
| 200 | OK | AlertingFileExport | schema | |
| 404 | Not Found | NotFound | schema |
알림 템플릿 그룹 가져오기. (RouteGetTemplate)
GET /api/v1/provisioning/templates/:name
⚠️ 이 API는 deprecated이며 향후 릴리스에서 제거될 예정이에요. Grafana App Platform alerting APIs를 대신 사용해요: 알림 템플릿 그룹은
/apis/notifications.alerting.grafana.app/v1beta1/namespaces/{namespace}/templategroups/{name}.
매개변수
| Name | Source | Type | Go type | Required | Default | Description |
|---|---|---|---|---|---|---|
| name | path | string | string | ✓ | 템플릿 그룹 이름 |
모든 응답
| Code | Status | Description | Has headers | Schema |
|---|---|---|---|---|
| 200 | OK | NotificationTemplate | schema | |
| 404 | Not Found | GenericPublicError | schema |
모든 알림 템플릿 그룹 가져오기. (RouteGetTemplates)
GET /api/v1/provisioning/templates
⚠️ 이 API는 deprecated이며 향후 릴리스에서 제거될 예정이에요. Grafana App Platform alerting APIs를 대신 사용해요: 알림 템플릿 그룹은
/apis/notifications.alerting.grafana.app/v1beta1/namespaces/{namespace}/templategroups.
모든 응답
| Code | Status | Description | Has headers | Schema |
|---|---|---|---|---|
| 200 | OK | NotificationTemplates | schema |
새 경고 규칙 생성. (RoutePostAlertRule)
POST /api/v1/provisioning/alert-rules
⚠️ 이 API는 deprecated이며 향후 릴리스에서 제거될 예정이에요. Grafana App Platform alerting APIs를 대신 사용해요: 경고 규칙은
/apis/rules.alerting.grafana.app/v0alpha1/namespaces/{namespace}/alertrules, 기록 규칙은/apis/rules.alerting.grafana.app/v0alpha1/namespaces/{namespace}/recordingrules.
이 작업은 새 경고 규칙을 생성해요.
새 규칙의 provenance(X-Disable-Provenance)는 해당 규칙 그룹에 구성된 provenance와 일치해야 해요. 같은 규칙 그룹 안에서 프로비저닝된 경고 규칙과 프로비저닝되지 않은 경고 규칙을 혼합하는 것은 허용되지 않아요.
매개변수
| Name | Source | Type | Go type | Required | Default | Description |
|---|---|---|---|---|---|---|
| X-Disable-Provenance: true | header | string | string | Grafana UI에서 프로비저닝된 리소스 편집 허용 | ||
| Body | body | ProvisionedAlertRule | models.ProvisionedAlertRule |
모든 응답
| Code | Status | Description | Has headers | Schema |
|---|---|---|---|---|
| 201 | Created | ProvisionedAlertRule | schema | |
| 400 | Bad Request | ValidationError | schema |
접점 생성. (RoutePostContactpoints)
POST /api/v1/provisioning/contact-points
⚠️ 이 API는 deprecated이며 향후 릴리스에서 제거될 예정이에요. Grafana App Platform alerting APIs를 대신 사용해요: receiver는
/apis/notifications.alerting.grafana.app/v1beta1/namespaces/{namespace}/receivers.
접점을 생성할 때 EmbeddedContactPoint.name 속성은 새 접점이 기존 접점에 추가되는지 여부를 결정해요. UI에서는 이름이 같은 접점들이 단일 접점 아래에 함께 그룹화돼요.
매개변수
| Name | Source | Type | Go type | Required | Default | Description |
|---|---|---|---|---|---|---|
| X-Disable-Provenance: true | header | string | string | Grafana UI에서 프로비저닝된 리소스 편집 허용 | ||
| Body | body | EmbeddedContactPoint | models.EmbeddedContactPoint |
모든 응답
| Code | Status | Description | Has headers | Schema |
|---|---|---|---|---|
| 202 | Accepted | EmbeddedContactPoint | schema | |
| 400 | Bad Request | ValidationError | schema |
새 뮤트 타이밍 생성. (RoutePostMuteTiming)
POST /api/v1/provisioning/mute-timings
⚠️ 이 API는 deprecated이며 향후 릴리스에서 제거될 예정이에요. Grafana App Platform alerting APIs를 대신 사용해요: 뮤트 타이밍은
/apis/notifications.alerting.grafana.app/v1beta1/namespaces/{namespace}/timeintervals.
매개변수
| Name | Source | Type | Go type | Required | Default | Description |
|---|---|---|---|---|---|---|
| X-Disable-Provenance: true | header | string | string | Grafana UI에서 프로비저닝된 리소스 편집 허용 | ||
| Body | body | MuteTimeInterval | models.MuteTimeInterval |
모든 응답
| Code | Status | Description | Has headers | Schema |
|---|---|---|---|---|
| 201 | Created | MuteTimeInterval | schema | |
| 400 | Bad Request | ValidationError | schema |
기존 경고 규칙 업데이트. (RoutePutAlertRule)
PUT /api/v1/provisioning/alert-rules/:uid
⚠️ 이 API는 deprecated이며 향후 릴리스에서 제거될 예정이에요. Grafana App Platform alerting APIs를 대신 사용해요: 경고 규칙은
/apis/rules.alerting.grafana.app/v0alpha1/namespaces/{namespace}/alertrules/{name}, 기록 규칙은/apis/rules.alerting.grafana.app/v0alpha1/namespaces/{namespace}/recordingrules/{name}.
매개변수
| Name | Source | Type | Go type | Required | Default | Description |
|---|---|---|---|---|---|---|
| UID | path | string | string | ✓ | Alert rule UID | |
| X-Disable-Provenance: true | header | string | string | Grafana UI에서 프로비저닝된 리소스 편집 허용 | ||
| Body | body | ProvisionedAlertRule | models.ProvisionedAlertRule |
모든 응답
| Code | Status | Description | Has headers | Schema |
|---|---|---|---|---|
| 200 | OK | ProvisionedAlertRule | schema | |
| 400 | Bad Request | ValidationError | schema |
규칙 그룹 생성 또는 업데이트. (RoutePutAlertRuleGroup)
PUT /api/v1/provisioning/folder/:folderUid/rule-groups/:group
⚠️ 이 API는 deprecated이며 향후 릴리스에서 제거될 예정이에요. Grafana App Platform alerting APIs를 대신 사용해요: 경고 규칙은
/apis/rules.alerting.grafana.app/v0alpha1/namespaces/{namespace}/alertrules, 기록 규칙은/apis/rules.alerting.grafana.app/v0alpha1/namespaces/{namespace}/recordingrules.
이 작업은 알림 그룹 안의 모든 경고 규칙의 provenance 설정(X-Disable-Provenance)도 변경해요.
매개변수
| Name | Source | Type | Go type | Required | Default | Description |
|---|---|---|---|---|---|---|
| FolderUID | path | string | string | ✓ | ||
| Group | path | string | string | ✓ | ||
| X-Disable-Provenance: true | header | string | string | Grafana UI에서 프로비저닝된 리소스 편집 허용. 이는 알림 그룹 안의 모든 경고 규칙에도 적용됨. | ||
| Body | body | AlertRuleGroup | models.AlertRuleGroup | 이 작업은 멱등이며 이 body에 포함된 규칙이 그룹의 구성된 규칙을 덮어씀 |
모든 응답
| Code | Status | Description | Has headers | Schema |
|---|---|---|---|---|
| 200 | OK | AlertRuleGroup | schema | |
| 400 | Bad Request | ValidationError | schema |
기존 접점 업데이트. (RoutePutContactpoint)
PUT /api/v1/provisioning/contact-points/:uid
⚠️ 이 API는 deprecated이며 향후 릴리스에서 제거될 예정이에요. Grafana App Platform alerting APIs를 대신 사용해요: receiver는
/apis/notifications.alerting.grafana.app/v1beta1/namespaces/{namespace}/receivers/{name}.
매개변수
| Name | Source | Type | Go type | Required | Default | Description |
|---|---|---|---|---|---|---|
| UID | path | string | string | ✓ | UID is the contact point unique identifier | |
| X-Disable-Provenance: true | header | string | string | Grafana UI에서 프로비저닝된 리소스 편집 허용 | ||
| Body | body | EmbeddedContactPoint | models.EmbeddedContactPoint |
모든 응답
| Code | Status | Description | Has headers | Schema |
|---|---|---|---|---|
| 202 | Accepted | Ack | schema | |
| 400 | Bad Request | ValidationError | schema |
기존 뮤트 타이밍 교체. (RoutePutMuteTiming)
PUT /api/v1/provisioning/mute-timings/:name
⚠️ 이 API는 deprecated이며 향후 릴리스에서 제거될 예정이에요. Grafana App Platform alerting APIs를 대신 사용해요: 뮤트 타이밍은
/apis/notifications.alerting.grafana.app/v1beta1/namespaces/{namespace}/timeintervals/{name}.
매개변수
| Name | Source | Type | Go type | Required | Default | Description |
|---|---|---|---|---|---|---|
| name | path | string | string | ✓ | Mute timing name | |
| X-Disable-Provenance: true | header | string | string | Grafana UI에서 프로비저닝된 리소스 편집 허용 | ||
| Body | body | MuteTimeInterval | models.MuteTimeInterval |
모든 응답
| Code | Status | Description | Has headers | Schema |
|---|---|---|---|---|
| 200 | OK | MuteTimeInterval | schema | |
| 400 | Bad Request | ValidationError | schema | |
| 409 | Conflict | GenericPublicError | schema |
알림 정책 트리 설정. (RoutePutPolicyTree)
⚠️ 정책 트리는 단일 리소스이므로 이를 프로비저닝하면 알림 정책 트리의 모든 정책을 덮어써요. 그러나 경고 규칙이 접점을 직접 선택할 때 생성되는 내부 정책에는 영향을 주지 않아요.
PUT /api/v1/provisioning/policies
⚠️ 이 API는 deprecated이며 향후 릴리스에서 제거될 예정이에요. Grafana App Platform alerting APIs를 대신 사용해요: 알림 정책은
/apis/notifications.alerting.grafana.app/v1beta1/namespaces/{namespace}/routingtrees.
매개변수
| Name | Source | Type | Go type | Required | Default | Description |
|---|---|---|---|---|---|---|
| X-Disable-Provenance: true | header | string | string | Grafana UI에서 프로비저닝된 리소스 편집 허용 | ||
| Body | body | Route | models.Route | 사용할 새 알림 라우팅 트리 |
모든 응답
| Code | Status | Description | Has headers | Schema |
|---|---|---|---|---|
| 202 | Accepted | Ack | schema | |
| 400 | Bad Request | ValidationError | schema |
알림 템플릿 그룹 생성 또는 업데이트. (RoutePutTemplate)
PUT /api/v1/provisioning/templates/:name
⚠️ 이 API는 deprecated이며 향후 릴리스에서 제거될 예정이에요. Grafana App Platform alerting APIs를 대신 사용해요: 알림 템플릿 그룹은
/apis/notifications.alerting.grafana.app/v1beta1/namespaces/{namespace}/templategroups/{name}.
매개변수
| Name | Source | Type | Go type | Required | Default | Description |
|---|---|---|---|---|---|---|
| name | path | string | string | ✓ | 템플릿 그룹 이름 | |
| X-Disable-Provenance: true | header | string | string | Grafana UI에서 프로비저닝된 리소스 편집 허용 | ||
| Body | body | NotificationTemplateContent | models.NotificationTemplateContent |
모든 응답
| Code | Status | Description | Has headers | Schema |
|---|---|---|---|---|
| 202 | Accepted | NotificationTemplate | schema | |
| 400 | Bad Request | GenericPublicError | schema | |
| 409 | Conflict | GenericPublicError | schema |
알림 정책 트리 지우기. (RouteResetPolicyTree)
DELETE /api/v1/provisioning/policies
⚠️ 이 API는 deprecated이며 향후 릴리스에서 제거될 예정이에요. Grafana App Platform alerting APIs를 대신 사용해요: 알림 정책은
/apis/notifications.alerting.grafana.app/v1beta1/namespaces/{namespace}/routingtrees.
모든 응답
| Code | Status | Description | Has headers | Schema |
|---|---|---|---|---|
| 202 | Accepted | Ack | schema |
모델 (Models)
Ack
interface{}
AlertQuery
속성:
| Name | Type | Go type | Required | Default | Description | Example |
|---|---|---|---|---|---|---|
| datasourceUid | string | string | Grafana 데이터 소스 고유 식별자; 서버 사이드 표현식(Server Side Expression) 연산이면 'expr'이어야 함. | |||
| model | interface{} | interface{} | JSON은 원본 JSON 쿼리이며 위 속성과 사용자 정의 속성을 포함함. | |||
| queryType | string | string | QueryType는 쿼리 유형의 선택적 식별자. 서로 다른 유형의 쿼리를 구분하는 데 사용할 수 있음. | |||
| refId | string | string | RefID는 프론트엔드 호출이 설정하는 쿼리의 고유 식별자. | |||
| relativeTimeRange | RelativeTimeRange | RelativeTimeRange |
AlertQueryExport
속성:
| Name | Type | Go type | Required | Default | Description | Example |
|---|---|---|---|---|---|---|
| datasourceUid | string | string | ||||
| model | interface{} | interface{} | ||||
| queryType | string | string | ||||
| refId | string | string | ||||
| relativeTimeRange | RelativeTimeRange | RelativeTimeRange |
AlertRuleExport
속성:
| Name | Type | Go type | Required | Default | Description | Example |
|---|---|---|---|---|---|---|
| annotations | map of string | map[string]string | ||||
| condition | string | string | ||||
| dashboardUid | string | string | ||||
| data | []AlertQueryExport | []*AlertQueryExport | ||||
| execErrState | string | string | ||||
| for | Duration | Duration | ||||
| keepFiringFor | Duration | Duration | 조건이 더 이상 충족되지 않아도 경고가 계속 발화하는 시간. 경고 플래핑(alarming flapping)을 방지함. | 2m | ||
| isPaused | boolean | bool | ||||
| labels | map of string | map[string]string | ||||
| noDataState | string | string | ||||
| panelId | int64 (formatted integer) | int64 | ||||
| title | string | string | ||||
| uid | string | string |
AlertRuleGroup
속성:
| Name | Type | Go type | Required | Default | Description | Example |
|---|---|---|---|---|---|---|
| folderUid | string | string | ||||
| interval | int64 (formatted integer) | int64 | ||||
| rules | []ProvisionedAlertRule | []*ProvisionedAlertRule | ||||
| title | string | string |
AlertRuleGroupExport
속성:
| Name | Type | Go type | Required | Default | Description | Example |
|---|---|---|---|---|---|---|
| folder | string | string | ||||
| interval | Duration | Duration | ||||
| name | string | string | ||||
| orgId | int64 (formatted integer) | int64 | ||||
| rules | []AlertRuleExport | []*AlertRuleExport |
AlertingFileExport
속성:
| Name | Type | Go type | Required | Default | Description | Example |
|---|---|---|---|---|---|---|
| apiVersion | int64 (formatted integer) | int64 | ||||
| contactPoints | []ContactPointExport | []*ContactPointExport | ||||
| groups | []AlertRuleGroupExport | []*AlertRuleGroupExport | ||||
| policies | []NotificationPolicyExport | []*NotificationPolicyExport |
ContactPointExport
속성:
| Name | Type | Go type | Required | Default | Description | Example |
|---|---|---|---|---|---|---|
| name | string | string | ||||
| orgId | int64 (formatted integer) | int64 | ||||
| receivers | []ReceiverExport | []*ReceiverExport |
ContactPoints
[]EmbeddedContactPoint
Duration
| Name | Type | Go type | Default | Description | Example |
|---|---|---|---|---|---|
| Duration | string | int64 |
EmbeddedContactPoint
EmbeddedContactPoint는 Grafana 관리형 알림에서 사용하는 접점 유형이에요.
접점을 생성할 때 EmbeddedContactPoint.name 속성은 새 접점이 기존 접점에 추가되는지 여부를 결정해요. UI에서는 이름이 같은 접점들이 단일 접점 아래에 함께 그룹화돼요.
속성:
| Name | Type | Go type | Required | Default | Description | Example |
|---|---|---|---|---|---|---|
| disableResolveMessage | boolean | bool | false | |||
| name | string | string | name은 UI에서 같은 이름의 여러 접점을 그룹화함. | webhook_1 | ||
| provenance | string | string | ||||
| settings | JSON | JSON | ✓ | |||
| type | string | string | ✓ | webhook | ||
| uid | string | string | UID는 접점의 고유 식별자. UID는 사용자가 설정할 수 있음. | my_external_reference |
Json
interface{}
MatchRegexps
MatchRegexps
MatchType
| Name | Type | Go type | Default | Description | Example |
|---|---|---|---|---|---|
| MatchType | int64 (formatted integer) | int64 |
Matcher
속성:
| Name | Type | Go type | Required | Default | Description | Example |
|---|---|---|---|---|---|---|
| Name | string | string | ||||
| Type | MatchType | MatchType | ||||
| Value | string | string |
Matchers
Matchers는 정렬할 수 있고 Stringer를 구현하며, slice 안의 모든 Matchers에 대해 LabelSet을 매칭하는 Matches 메서드를 제공하는 Matcher의 slice예요. 주의: Matchers의 일부 사용자는 정렬을 요구할 수 있어요.
[]Matcher
MuteTimeInterval
속성:
| Name | Type | Go type | Required | Default | Description | Example |
|---|---|---|---|---|---|---|
| name | string | string | ||||
| time_intervals | []TimeInterval | []*TimeInterval | ||||
| version | string | string | 리소스 버전 |
MuteTimingExport / MuteTimingsExport
속성:
MuteTimings
[]MuteTimeInterval
NotFound
interface{}
NotificationPolicyExport
속성:
| Name | Type | Go type | Required | Default | Description | Example |
|---|---|---|---|---|---|---|
| Policy | RouteExport | RouteExport | inline | |||
| orgId | int64 (formatted integer) | int64 |
NotificationTemplate
속성:
| Name | Type | Go type | Required | Default | Description | Example |
|---|---|---|---|---|---|---|
| name | string | string | ||||
| provenance | Provenance | Provenance | ||||
| template | string | string | ||||
| version | string | string | 리소스 버전 |
NotificationTemplateContent
속성:
| Name | Type | Go type | Required | Default | Description | Example |
|---|---|---|---|---|---|---|
| template | string | string | ||||
| version | string | string | 리소스 버전. 새 템플릿이면 비어 있어야 함. |
NotificationTemplates
[]NotificationTemplate
ObjectMatchers
Matchers
PermissionDenied
interface{}
Provenance
| Name | Type | Go type | Default | Description | Example |
|---|---|---|---|---|---|
| Provenance | string | string |
ProvisionedAlertRule
속성:
| Name | Type | Go type | Required | Default | Description | Example |
|---|---|---|---|---|---|---|
| annotations | map of string | map[string]string | 선택적 키-값 쌍. __dashboardUid__와 __panelId__는 함께 설정해야 함; 하나만 설정할 수는 없음. | {"runbook_url":"https://supercoolrunbook.com/page/13"} | ||
| condition | string | string | ✓ | A | ||
| data | []AlertQuery | []*AlertQuery | ✓ | [{"datasourceUid":"expr","model":{"conditions":[{"evaluator":{"params":[0,0],"type":"gt"},"operator":{"type":"and"},"query":{"params":[]},"reducer":{"params":[],"type":"avg"},"type":"query"}],"datasource":{"type":"expr","uid":"expr"},"expression":"1 == 1","hide":false,"intervalMs":1000,"maxDataPoints":43200,"refId":"A","type":"math"},"queryType":"","refId":"A","relativeTimeRange":{"from":0,"to":0}}] | ||
| execErrState | string | string | ✓ | |||
| folderUID | string | string | ✓ | project_x | ||
| for | Duration | Duration | ✓ | |||
| id | int64 (formatted integer) | int64 | ||||
| isPaused | boolean | bool | false | |||
| labels | map of string | map[string]string | {"team":"sre-team-1"} | |||
| noDataState | string | string | ✓ | |||
| orgID | int64 (formatted integer) | int64 | ✓ | |||
| provenance | Provenance | Provenance | ||||
| record | Record | Record | 기록 규칙 구성. 있으면 경고 규칙이 아니라 기록 규칙임. | {"metric":"http_requests:rate5m:sum","from":"A","target_datasource_uid":"my-prom"} | ||
| ruleGroup | string | string | ✓ | eval_group_1 | ||
| title | string | string | ✓ | Always firing | ||
| uid | string | string | ||||
| updated | date-time (formatted string) | strfmt.DateTime |
ProvisionedAlertRules
[]ProvisionedAlertRule
RawMessage
interface{}
Record
Record는 쿼리 결과를 미리 계산해 새 시계열 메트릭으로 저장하는 기록 규칙의 구성을 정의해요.
속성:
| Name | Type | Go type | Required | Default | Description | Example |
|---|---|---|---|---|---|---|
| metric | string | string | ✓ | 생성할 새 메트릭의 이름. 공백 없는 유효한 Prometheus 메트릭 이름이어야 함. | http_requests:rate5m:sum | |
| from | string | string | ✓ | 기록된 메트릭의 소스로 사용할 쿼리 참조 ID(refId). | A | |
| target_datasource_uid | string | string | 결과를 쓸 Prometheus 호환 데이터 소스의 UID. 지정하지 않으면 구성된 기본값으로 대체됨. | my-prometheus-datasource-uid |
ReceiverExport
속성:
| Name | Type | Go type | Required | Default | Description | Example |
|---|---|---|---|---|---|---|
| disableResolveMessage | boolean | bool | ||||
| settings | RawMessage | RawMessage | ||||
| type | string | string | ||||
| uid | string | string |
Regexp
Regexp는 Longest 같은 구성 메서드를 제외하고 여러 goroutine이 동시에 사용하기에 안전해요.
interface{}
RelativeTimeRange
RelativeTimeRange는 요청의 쿼리별 시작 및 종료 시간이에요.
속성:
| Name | Type | Go type | Required | Default | Description | Example |
|---|---|---|---|---|---|---|
| from | Duration | Duration | ||||
| to | Duration | Duration |
Route
Route는 알림 처리 방법을 정의하는 노드예요. ObjectMatchers 속성이 추가된다는 점에서 업스트림 alertmanager에서 수정된 것이에요.
속성:
| Name | Type | Go type | Required | Default | Description | Example |
|---|---|---|---|---|---|---|
| continue | boolean | bool | ||||
| group_by | []string | []string | ||||
| group_interval | string | string | ||||
| group_wait | string | string | ||||
| match | map of string | map[string]string | 더 이상 사용되지 않음. v1.0 릴리스 전에 제거. | |||
| match_re | MatchRegexps | MatchRegexps | ||||
| matchers | Matchers | Matchers | ||||
| mute_time_intervals | []string | []string | ||||
| object_matchers | ObjectMatchers | ObjectMatchers | ||||
| provenance | Provenance | Provenance | ||||
| receiver | string | string | ||||
| repeat_interval | string | string | ||||
| routes | []Route | []*Route |
RouteExport
RouteExport는 definitions.Route의 프로비저닝된 파일 내보내기예요. 프로비저닝 파일 형식에서 사용할 수 없는 필드를 숨기는 데 필요해요. 대안으로 이를 제외하는 커스텀 MarshalJSON과 MarshalYAML을 정의하는 방법이 있어요.
속성:
| Name | Type | Go type | Required | Default | Description | Example |
|---|---|---|---|---|---|---|
| continue | boolean | bool | ||||
| group_by | []string | []string | ||||
| group_interval | string | string | ||||
| group_wait | string | string | ||||
| match | map of string | map[string]string | 더 이상 사용되지 않음. v1.0 릴리스 전에 제거. | |||
| match_re | MatchRegexps | MatchRegexps | ||||
| matchers | Matchers | Matchers | ||||
| mute_time_intervals | []string | []string | ||||
| object_matchers | ObjectMatchers | ObjectMatchers | ||||
| receiver | string | string | ||||
| repeat_interval | string | string | ||||
| routes | []RouteExport | []*RouteExport |
TimeInterval
TimeInterval은 시간 구간을 설명해요. ContainsTime은 golang 시간이 구간 안에 포함되는지 알려줘요.
속성:
| Name | Type | Go type | Required | Default | Description | Example |
|---|---|---|---|---|---|---|
| days_of_month | []string | []string | ||||
| location | string | string | ||||
| months | []string | []string | ||||
| times | []TimeRange | []*TimeRange | ||||
| weekdays | []string | []string | ||||
| years | []string | []string |
TimeRange
예를 들어, 오후 4시부터 하루 끝까지는 Begin이 1020, End가 1440이에요.
속성:
| Name | Type | Go type | Required | Default | Description | Example |
|---|---|---|---|---|---|---|
| end_time | string | string | "end_time": "24:00" | |||
| start_time | string | string | "start_time": "18:00" |
ValidationError
속성:
| Name | Type | Go type | Required | Default | Description | Example |
|---|---|---|---|---|---|---|
| msg | string | string | error message |
GenericPublicError
속성:
| Name | Type | Go type | Required | Default | Description | Example |
|---|---|---|---|---|---|---|
| statusCode | string | string | ✓ | HTTP 상태 코드 | ||
| messageId | string | string | ✓ | 오류의 고유 코드 | ||
| message | string | string | 오류 메시지 | |||
| extra | map of any | map[string]any | 오류에 대한 추가 정보. 형식은 오류 코드에 따라 다름. |
더 알아보기 (Learn more)
- Grafana 알림(Alerting) 개요
- Grafana Terraform 프로바이더
- Grafana App Platform alerting APIs
- Grafana의 새 API 구조