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

MeshTraces 정책 구성 레퍼런스

원문 보기 위키 갱신

MeshTraces 정책 구성 레퍼런스 (MeshTraces Policy Configuration Reference)

이 문서는 Kuma의 MeshTrace 정책에 사용할 수 있는 모든 설정 옵션을 스키마 형태로 정리해 보여줘요. Zipkin, Datadog, OpenTelemetry 같은 트레이싱 백엔드를 구성하는 방법과 각 필드의 의미를 하나씩 설명해요. 메시에서 트레이싱 정책을 직접 작성하거나 수정하려는 분들에게 유용한 참고 자료예요.

출처: 문서

본문

구성

{
  "description": "Spec is the specification of the Kuma MeshTrace resource.",
  "properties": {
    "default": {
      "description": "MeshTrace configuration.",
      "properties": {
        "backends": {
          "description": "A one element array of backend definition.\nEnvoy allows configuring only 1 backend, so the natural way of\nrepresenting that would be just one object. Unfortunately due to the\nreasons explained in MADR 009-tracing-policy this has to be a one element\narray for now.",
          "items": {
            "description": "Only one of zipkin, datadog or openTelemetry can be used.",
            "properties": {
              "datadog": {
                "description": "Datadog backend configuration.",
                "properties": {
                  "splitService": {
                    "default": false,
                    "description": "Determines if datadog service name should be split based on traffic\ndirection and destination. For example, with `splitService: true` and a\n`backend` service that communicates with a couple of databases, you would\nget service names like `backend_INBOUND`, `backend_OUTBOUND_db1`, and\n`backend_OUTBOUND_db2` in Datadog.",
                    "type": "boolean"
                  },
                  "url": {
                    "description": "Address of Datadog collector, only host and port are allowed (no paths,\nfragments etc.)",
                    "type": "string"
                  }
                },
                "required": [
                  "url"
                ],
                "type": "object"
              },
              "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": "Address of OpenTelemetry collector.\n\nDeprecated: use BackendRef instead.",
                    "example": "otel-collector:4317",
                    "type": "string"
                  }
                },
                "type": "object"
              },
              "type": {
                "enum": [
                  "Zipkin",
                  "Datadog",
                  "OpenTelemetry"
                ],
                "type": "string"
              },
              "zipkin": {
                "description": "Zipkin backend configuration.",
                "properties": {
                  "apiVersion": {
                    "default": "httpJson",
                    "description": "Version of the API.\nhttps://github.com/envoyproxy/envoy/blob/v1.22.0/api/envoy/config/trace/v3/zipkin.proto#L66",
                    "enum": [
                      "httpJson",
                      "httpProto"
                    ],
                    "type": "string"
                  },
                  "sharedSpanContext": {
                    "default": true,
                    "description": "Determines whether client and server spans will share the same span\ncontext.\nhttps://github.com/envoyproxy/envoy/blob/v1.22.0/api/envoy/config/trace/v3/zipkin.proto#L63",
                    "type": "boolean"
                  },
                  "traceId128bit": {
                    "default": false,
                    "description": "Generate 128bit traces.",
                    "type": "boolean"
                  },
                  "url": {
                    "description": "Address of Zipkin collector.",
                    "type": "string"
                  }
                },
                "required": [
                  "url"
                ],
                "type": "object"
              }
            },
            "required": [
              "type"
            ],
            "type": "object"
          },
          "maxItems": 1,
          "type": "array"
        },
        "sampling": {
          "description": "Sampling configuration.\nSampling is the process by which a decision is made on whether to\nprocess/export a span or not.",
          "properties": {
            "client": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "string"
                }
              ],
              "description": "Target percentage of requests that will be force traced if the\n'x-client-trace-id' header is set. Mirror of client_sampling in Envoy\nhttps://github.com/envoyproxy/envoy/blob/v1.22.0/api/envoy/config/filter/network/http_connection_manager/v2/http_connection_manager.proto#L127-L133\nEither int or decimal represented as string.\nIf not specified then the default value is 100.",
              "x-kubernetes-int-or-string": true
            },
            "overall": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "string"
                }
              ],
              "description": "Target percentage of requests will be traced\nafter all other sampling checks have been applied (client, force tracing,\nrandom sampling). This field functions as an upper limit on the total\nconfigured sampling rate. For instance, setting client to 100\nbut overall to 1 will result in only 1% of client requests with\nthe appropriate headers to be force traced. Mirror of\noverall_sampling in Envoy\nhttps://github.com/envoyproxy/envoy/blob/v1.22.0/api/envoy/config/filter/network/http_connection_manager/v2/http_connection_manager.proto#L142-L150\nEither int or decimal represented as string.\nIf not specified then the default value is 100.",
              "x-kubernetes-int-or-string": true
            },
            "random": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "string"
                }
              ],
              "description": "Target percentage of requests that will be randomly selected for trace\ngeneration, if not requested by the client or not forced.\nMirror of random_sampling in Envoy\nhttps://github.com/envoyproxy/envoy/blob/v1.22.0/api/envoy/config/filter/network/http_connection_manager/v2/http_connection_manager.proto#L135-L140\nEither int or decimal represented as string.\nIf not specified then the default value is 100.",
              "x-kubernetes-int-or-string": true
            }
          },
          "type": "object"
        },
        "tags": {
          "description": "Custom tags configuration. You can add custom tags to traces based on\nheaders or literal values.",
          "items": {
            "description": "Custom tags configuration.\nOnly one of literal or header can be used.",
            "properties": {
              "header": {
                "description": "Tag taken from a header.",
                "properties": {
                  "default": {
                    "description": "Default value to use if header is missing.\nIf the default is missing and there is no value the tag will not be\nincluded.",
                    "type": "string"
                  },
                  "name": {
                    "description": "Name of the header.",
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ],
                "type": "object"
              },
              "literal": {
                "description": "Tag taken from literal value.",
                "type": "string"
              },
              "name": {
                "description": "Name of the tag.",
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "type": "object"
          },
          "type": "array"
        }
      },
      "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 inplace.",
      "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)