본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

MeshMetrics 정책 구성 참조

원문 보기 위키 갱신

MeshMetrics 정책 구성 참조 (MeshMetrics Policy Configuration Reference)

이 문서는 Kuma의 MeshMetric 리소스를 구성할 때 사용하는 설정 항목을 정리한 참조 자료예요. Dataplane 프록시가 메트릭을 스크랩할 애플리케이션 목록을 정의하는 applications 필드와, 수집된 메트릭을 전송할 OpenTelemetry 백엔드를 지정하는 backends 필드의 구조를 다뤄요. 각 속성의 타입, 기본값, 필수 여부가 JSON 스키마 형태로 정리되어 있어서 정책을 작성할 때 그대로 참고하면 좋아요

출처: 문서

본문

구성

{
  "description": "Spec is the specification of the Kuma MeshMetric resource.",
  "properties": {
    "default": {
      "description": "MeshMetric configuration.",
      "properties": {
        "applications": {
          "description": "Applications is a list of applications that Dataplane Proxy will scrape.\nIgnored on zone-proxy-only Dataplanes (zone ingress/egress exist without a co-located workload).",
          "items": {
            "properties": {
              "address": {
                "description": "Address on which an application listens.",
                "type": "string"
              },
              "name": {
                "description": "Name of the application to scrape",
                "type": "string"
              },
              "path": {
                "default": "/metrics",
                "description": "Path on which an application expose HTTP endpoint with metrics.",
                "type": "string"
              },
              "port": {
                "description": "Port on which an application expose HTTP endpoint with metrics.",
                "format": "int32",
                "type": "integer"
              }
            },
            "required": [
              "port"
            ],
            "type": "object"
          },
          "type": "array"
        },
        "backends": {
          "description": "Backends list that will be used to collect metrics.",
          "items": {
            "properties": {
              "openTelemetry": {
                "description": "OpenTelemetry backend configuration",
                "properties": {
                  "backendRef": {
                    "description": "BackendRef is a reference to a MeshOpenTelemetryBackend resource that\ndefines the collector endpoint. Mutually exclusive with Endpoint.",
                    "properties": {
                      "kind": {
                        "description": "Kind of the backend resource.",
                        "enum": [
                          "MeshOpenTelemetryBackend"
                        ],
                        "type": "string"
                      },
                      "labels": {
                        "additionalProperties": {
                          "type": "string"
                        },
                        "description": "Labels to match the referenced resource. When multiple resources match,\nthe oldest by creation time wins.",
                        "type": "object"
                      }
                    },
                    "required": [
                      "kind"
                    ],
                    "type": "object"
                  },
                  "endpoint": {
                    "default": "",
                    "description": "Endpoint for OpenTelemetry collector.\n\nDeprecated: use BackendRef instead.",
                    "type": "string"
                  },
                  "refreshInterval": {
                    "description": "RefreshInterval defines how frequent metrics should be pushed to collector",
                    "type": "string"
                  }
                },
                "type": "object"
              },
              "prometheus": {
                "description": "Prometheus backend configuration.",
                "properties": {
                  "clientId": {
                    "description": "ClientId of the Prometheus backend. Needed when using MADS for DP discovery.",
                    "type": "string"
                  },
                  "path": {
                    "default": "/metrics",
                    "description": "Path on which a dataplane should expose HTTP endpoint with Prometheus metrics.",
                    "type": "string"
                  },
                  "port": {
                    "default": 5670,
                    "description": "Port on which a dataplane should expose HTTP endpoint with Prometheus metrics.",
                    "format": "int32",
                    "type": "integer"
                  },
                  "tls": {
                    "description": "Configuration of TLS for prometheus listener.",
                    "properties": {
                      "mode": {
                        "default": "Disabled",
                        "description": "Configuration of TLS for Prometheus listener.",
                        "enum": [
                          "Disabled",
                          "ProvidedTLS",
                          "ActiveMTLSBackend"
                        ],
                        "type": "string"
                      }
                    },
                    "type": "object"
                  }
                },
                "type": "object"
              },
              "type": {
                "description": "Type of the backend that will be used to collect metrics. At the moment only Prometheus backend is available.",
                "enum": [
                  "Prometheus",
                  "OpenTelemetry"
                ],
                "type": "string"
              }
            },
            "required": [
              "type"
            ],
            "type": "object"
          },
          "type": "array"
        },
        "sidecar": {
          "description": "Sidecar metrics collection configuration",
          "properties": {
            "includeUnused": {
              "description": "IncludeUnused if false will scrape only metrics that has been by sidecar (counters incremented\nat least once, gauges changed at least once, and histograms added to at\nleast once). If true will scrape all metrics (even the ones with zeros).\nIf not specified then the default value is false.",
              "type": "boolean"
            },
            "profiles": {
              "description": "Profiles allows to customize which metrics are published.",
              "properties": {
                "appendProfiles": {
                  "description": "AppendProfiles allows to combine the metrics from multiple predefined profiles.",
                  "items": {
                    "properties": {
                      "name": {
                        "description": "Name of the predefined profile, one of: all, basic, none",
                        "enum": [
                          "All",
                          "Basic",
                          "None"
                        ],
                        "type": "string"
                      }
                    },
                    "required": [
                      "name"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "exclude": {
                  "description": "Exclude makes it possible to exclude groups of metrics from a resulting profile.\nExclude is subordinate to Include.",
                  "items": {
                    "properties": {
                      "match": {
                        "description": "Match is the value used to match using particular Type",
                        "type": "string"
                      },
                      "type": {
                        "description": "Type defined the type of selector, one of: prefix, regex, exact",
                        "enum": [
                          "Prefix",
                          "Regex",
                          "Exact",
                          "Contains"
                        ],
                        "type": "string"
                      }
                    },
                    "required": [
                      "match",
                      "type"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "include": {
                  "description": "Include makes it possible to include additional metrics in a selected profiles.\nInclude takes precedence over Exclude.",
                  "items": {
                    "properties": {
                      "match": {
                        "description": "Match is the value used to match using particular Type",
                        "type": "string"
                      },
                      "type": {
                        "description": "Type defined the type of selector, one of: prefix, regex, exact",
                        "enum": [
                          "Prefix",
                          "Regex",
                          "Exact",
                          "Contains"
                        ],
                        "type": "string"
                      }
                    },
                    "required": [
                      "match",
                      "type"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                }
              },
              "type": "object"
            }
          },
          "type": "object"
        }
      },
      "type": "object"
    },
    "targetRef": {
      "description": "TargetRef is a reference to the resource the policy takes an effect on.\nThe resource could be either a real store object or virtual resource\ndefined in-place.",
      "properties": {
        "kind": {
          "description": "Kind of the referenced resource",
          "enum": [
            "Mesh",
            "MeshSubset",
            "MeshGateway",
            "MeshService",
            "MeshExternalService",
            "MeshMultiZoneService",
            "MeshServiceSubset",
            "MeshHTTPRoute",
            "Dataplane"
          ],
          "type": "string"
        },
        "labels": {
          "additionalProperties": {
            "type": "string"
          },
          "description": "Labels are used to select group of MeshServices that match labels. Either Labels or\nName and Namespace can be used.",
          "type": "object"
        },
        "mesh": {
          "description": "Mesh is reserved for future use to identify cross mesh resources.",
          "type": "string"
        },
        "name": {
          "description": "Name of the referenced resource. Can only be used with kinds: `MeshService`,\n`MeshServiceSubset` and `MeshGatewayRoute`",
          "type": "string"
        },
        "namespace": {
          "description": "Namespace specifies the namespace of target resource. If empty only resources in policy namespace\nwill be targeted.",
          "type": "string"
        },
        "proxyTypes": {
          "description": "ProxyTypes specifies the data plane types that are subject to the policy. When not specified,\nall data plane types are targeted by the policy.",
          "items": {
            "enum": [
              "Sidecar",
              "Gateway"
            ],
            "type": "string"
          },
          "type": "array"
        },
        "sectionName": {
          "description": "SectionName is used to target specific section of resource.\nFor example, you can target port from MeshService.ports[] by its name. Only traffic to this port will be affected.",
          "type": "string"
        },
        "tags": {
          "additionalProperties": {
            "type": "string"
          },
          "description": "Tags used to select a subset of proxies by tags. Can only be used with kinds\n`MeshSubset` and `MeshServiceSubset`",
          "type": "object"
        }
      },
      "required": [
        "kind"
      ],
      "type": "object"
    }
  },
  "type": "object"
}

관련 리소스

더 알아보기 (Learn more)