다음을 통해 공유


Prometheus Rule Groups - List By Resource Group

리소스 그룹에서 Prometheus 규칙 그룹 정의를 검색합니다.

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AlertsManagement/prometheusRuleGroups?api-version=2023-03-01

URI 매개 변수

Name In(다음 안에) 필수 형식 Description
resourceGroupName
path True

string

리소스 그룹의 이름. 이름은 대소문자를 구분하지 않습니다.

subscriptionId
path True

string

대상 구독의 ID입니다.

api-version
query True

string

이 작업에 사용할 API 버전입니다.

응답

Name 형식 Description
200 OK

PrometheusRuleGroupResourceCollection

Prometheus 규칙 그룹 목록에 대한 성공적인 요청

Other Status Codes

ErrorResponse

작업이 실패한 이유를 설명하는 오류 응답입니다.

예제

List Resource group PrometheusRuleGroups

Sample Request

GET https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/promResourceGroup/providers/Microsoft.AlertsManagement/prometheusRuleGroups?api-version=2023-03-01

Sample Response

{
  "value": [
    {
      "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/promResourceGroup/providers/Microsoft.AlertsManagement/prometheusRuleGroups/ruleGroupName1",
      "type": "Microsoft.AlertsManagement/prometheusRuleGroups",
      "location": "East US",
      "properties": {
        "description": "This is the description of the following rule group",
        "enabled": true,
        "interval": "PT10M",
        "clusterName": "myClusterName",
        "scopes": [
          "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace"
        ],
        "rules": [
          {
            "record": "job_type:billing_jobs_duration_seconds:99p5m",
            "expression": "histogram_quantile(0.99, sum(rate(jobs_duration_seconds_bucket{service=\"billing-processing\"}[5m])) by (job_type))",
            "labels": {
              "team": "prod"
            }
          },
          {
            "alert": "Billing_Processing_Very_Slow",
            "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30",
            "enabled": true,
            "severity": 2,
            "for": "PT5M",
            "labels": {
              "team": "prod"
            },
            "annotations": {
              "annotationName1": "annotationValue1"
            },
            "resolveConfiguration": {
              "autoResolved": true,
              "timeToResolve": "PT10M"
            },
            "actions": [
              {
                "actionGroupId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myactiongroup",
                "actionProperties": {
                  "key11": "value11",
                  "key12": "value12"
                }
              },
              {
                "actionGroupId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myotheractiongroup",
                "actionProperties": {
                  "key21": "value21",
                  "key22": "value22"
                }
              }
            ]
          }
        ]
      }
    },
    {
      "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/promResourceGroup/providers/Microsoft.AlertsManagement/prometheusRuleGroups/ruleGroupName2",
      "type": "Microsoft.AlertsManagement/prometheusRuleGroups",
      "location": "East US",
      "properties": {
        "description": "This is the description of the following rule group",
        "enabled": true,
        "interval": "PT10M",
        "clusterName": "myClusterName",
        "scopes": [
          "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace"
        ],
        "rules": [
          {
            "record": "job_type:billing_jobs_duration_seconds:99p5m",
            "expression": "histogram_quantile(0.99, sum(rate(jobs_duration_seconds_bucket{service=\"billing-processing\"}[5m])) by (job_type))",
            "labels": {
              "team": "prod"
            }
          },
          {
            "alert": "Billing_Processing_Very_Slow",
            "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30",
            "enabled": true,
            "severity": 2,
            "for": "PT5M",
            "labels": {
              "team": "prod"
            },
            "annotations": {
              "annotationName1": "annotationValue1"
            },
            "resolveConfiguration": {
              "autoResolved": true,
              "timeToResolve": "PT10M"
            },
            "actions": [
              {
                "actionGroupId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myactiongroup",
                "actionProperties": {
                  "key11": "value11",
                  "key12": "value12"
                }
              },
              {
                "actionGroupId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myotheractiongroup",
                "actionProperties": {
                  "key21": "value21",
                  "key22": "value22"
                }
              }
            ]
          }
        ]
      }
    }
  ]
}

정의

Name Description
createdByType

리소스를 만든 ID의 형식입니다.

ErrorAdditionalInfo

리소스 관리 오류 추가 정보입니다.

ErrorDetail

오류 세부 정보입니다.

ErrorResponse

오류 응답

PrometheusRule

Azure Prometheus 경고 또는 기록 규칙.

PrometheusRuleGroupAction

경고 작업입니다. 경고와만 관련이 있습니다.

PrometheusRuleGroupResource

Prometheus 규칙 그룹 리소스입니다.

PrometheusRuleGroupResourceCollection

경고 규칙 리소스의 컬렉션을 나타냅니다.

PrometheusRuleResolveConfiguration

Prometheus 경고 규칙 구성을 지정합니다.

systemData

리소스 만들기 및 마지막 수정과 관련된 메타데이터입니다.

createdByType

리소스를 만든 ID의 형식입니다.

Name 형식 Description
Application

string

Key

string

ManagedIdentity

string

User

string

ErrorAdditionalInfo

리소스 관리 오류 추가 정보입니다.

Name 형식 Description
info

object

추가 정보입니다.

type

string

추가 정보 유형입니다.

ErrorDetail

오류 세부 정보입니다.

Name 형식 Description
additionalInfo

ErrorAdditionalInfo[]

오류 추가 정보입니다.

code

string

오류 코드입니다.

details

ErrorDetail[]

오류 세부 정보입니다.

message

string

오류 메시지입니다.

target

string

오류 대상입니다.

ErrorResponse

오류 응답

Name 형식 Description
error

ErrorDetail

Error 개체.

PrometheusRule

Azure Prometheus 경고 또는 기록 규칙.

Name 형식 Description
actions

PrometheusRuleGroupAction[]

경고 규칙이 활성화되고 경고 조건이 해결될 때 수행되는 작업입니다.

alert

string

경고 규칙 이름입니다.

annotations

object

주석 절은 경고 설명 또는 Runbook 링크와 같은 더 긴 추가 정보를 저장하는 데 사용할 수 있는 정보 레이블 집합을 지정합니다. 주석 값은 템플릿으로 작성할 수 있습니다.

enabled

boolean

규칙을 사용/사용하지 않도록 설정합니다.

expression

string

평가할 PromQL 식입니다. https://prometheus.io/docs/prometheus/latest/querying/basics/. 'interval'에서 지정한 대로 주기적으로 평가되며, 결과는 'record'에서 지정한 메트릭 이름을 사용하여 시계열의 새 집합으로 기록됩니다.

for

string

경고가 발생하기 전에 활성 상태여야 하는 시간입니다.

labels

object

결과를 저장하기 전에 추가하거나 덮어쓸 레이블입니다.

record

string

기록된 메트릭 이름입니다.

resolveConfiguration

PrometheusRuleResolveConfiguration

발생한 경고를 해결하기 위한 구성을 정의합니다. 경고와만 관련이 있습니다.

severity

integer

규칙에 의해 발생한 경고의 심각도입니다. 0에서 4 사이여야 합니다.

PrometheusRuleGroupAction

경고 작업입니다. 경고와만 관련이 있습니다.

Name 형식 Description
actionGroupId

string

사용할 작업 그룹의 리소스 ID입니다.

actionProperties

object

작업 그룹 개체의 속성입니다.

PrometheusRuleGroupResource

Prometheus 규칙 그룹 리소스입니다.

Name 형식 Description
id

string

리소스에 대한 정규화된 리소스 ID입니다. 예 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

location

string

리소스가 있는 지리적 위치

name

string

리소스의 이름입니다.

properties.clusterName

string

특정 클러스터의 데이터에 규칙을 적용합니다.

properties.description

string

규칙 그룹 설명입니다.

properties.enabled

boolean

규칙 그룹을 사용/사용하지 않도록 설정합니다.

properties.interval

string

ISO 8601 기간 형식으로 표시된 Prometheus 규칙 그룹을 실행할 간격입니다. 1~15분 사이여야 합니다.

properties.rules

PrometheusRule[]

Prometheus 규칙 그룹의 규칙을 정의합니다.

properties.scopes

string[]

대상 Azure Monitor 작업 영역 리소스 ID입니다. 이 api-version은 현재 하나의 scope 사용하여 만드는 것으로 제한됩니다. 이는 나중에 변경될 수 있습니다.

systemData

systemData

createdBy 및 modifiedBy 정보가 포함된 Azure Resource Manager 메타데이터입니다.

tags

object

리소스 태그.

type

string

리소스 형식입니다. 예: "Microsoft.Compute/virtualMachines" 또는 "Microsoft.Storage/storageAccounts"

PrometheusRuleGroupResourceCollection

경고 규칙 리소스의 컬렉션을 나타냅니다.

Name 형식 Description
value

PrometheusRuleGroupResource[]

경고 규칙 리소스의 값입니다.

PrometheusRuleResolveConfiguration

Prometheus 경고 규칙 구성을 지정합니다.

Name 형식 Description
autoResolved

boolean

경고 자동 해결을 사용하도록 설정합니다.

timeToResolve

string

경고 자동 해결 시간 제한.

systemData

리소스 만들기 및 마지막 수정과 관련된 메타데이터입니다.

Name 형식 Description
createdAt

string

UTC(리소스 만들기)의 타임스탬프입니다.

createdBy

string

리소스를 만든 ID입니다.

createdByType

createdByType

리소스를 만든 ID의 형식입니다.

lastModifiedAt

string

리소스 마지막 수정의 타임스탬프(UTC)

lastModifiedBy

string

리소스를 마지막으로 수정한 ID입니다.

lastModifiedByType

createdByType

리소스를 마지막으로 수정한 ID 유형입니다.