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

OpenTelemetry 정책 구성 레퍼런스

원문 보기 위키 갱신

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

이 문서는 Kong에서 OpenTelemetry 정책을 구성할 때 설정할 수 있는 옵션을 한눈에 확인할 수 있는 레퍼런스예요. 트레이스와 메트릭을 내보낼 엔드포인트, 메트릭 푸시 주기 같은 기본 설정부터 요청 수, 대역폭, 지연 시간, 업스트림 상태, AI 관련 메트릭의 수집 여부까지 필드별 의미와 기본값을 설명해요. OpenTelemetry로 텔레메트리 데이터를 수집하면서 어떤 값을 조정해야 할지 판단할 때 참고하기 좋아요

출처: 문서

본문

{
  "properties": {
    "config": {
      "type": "object",
      "properties": {
        "traces_endpoint": {
          "type": "string",
          "description": "A string representing a URL, such as https://example.com/path/to/resource?q=search.",
          "x-referenceable": true
        },
        "metrics": {
          "type": "object",
          "properties": {
            "endpoint": {
              "type": "string",
              "description": "An HTTP URL endpoint where metrics are exported.",
              "x-referenceable": true
            },
            "push_interval": {
              "type": "number",
              "description": "The interval in seconds at which metrics are pushed to the OTLP server. This setting is only applicable when `endpoint` is set.",
              "default": 60
            },
            "enable_consumer_attribute": {
              "type": "boolean",
              "description": "A boolean value that determines if `http.server.request.count`, `http.server.request.size` and `http.server.response.size` metrics should fill in the consumer attribute when available.",
              "default": false
            },
            "enable_request_metrics": {
              "type": "boolean",
              "description": "A boolean value that determines if request count metrics should be collected. If enabled, `http.server.request.count` metrics will be exported.",
              "default": false
            },
            "enable_bandwidth_metrics": {
              "type": "boolean",
              "description": "A boolean value that determines if bandwidth metrics should be collected. If enabled, `http.server.request.size` and `http.server.response.size` metrics will be exported.",
              "default": false
            },
            "enable_latency_metrics": {
              "type": "boolean",
              "description": "A boolean value that determines if latency metrics should be collected. If enabled, `kong.latency.total`, `kong.latency.internal` and `kong.latency.upstream` metrics will be exported.",
              "default": false
            },
            "enable_upstream_health_metrics": {
              "type": "boolean",
              "description": "A boolean value that determines if upstream health metrics should be collected. If enabled, `kong.upstream.target.status` metrics will be exported.",
              "default": false
            },
            "enable_ai_metrics": {
              "type": "boolean",
              "description": "A boolean value that determines if AI metrics should be collected. If enabled, `gen_ai.*`, `mcp.*`, `kong.gen_ai.*`, `kong.gen_ai.a2a.*` and `kong.mcp.*` metrics will be exported. To enable latency metrics for AI metrics, `enable_latency_metrics` must also be set to `true`. To enable `error.type` attribute for AI metrics, `enable_request_metrics` must also be set to `true`.",
              "default": false
            }
          }
        },
        "batch_flush_delay": {
          "type": "integer",
          "description": "The delay, in seconds, between two consecutive batches."
        },
        "send_timeout": {
          "type": "integer",
          "maximum": 2147483646,
          "minimum": 0,
          "description": "An integer representing a timeout in milliseconds. Must be between 0 and 2^31-2.",
          "default": 5000
        },
        "logs_endpoint": {
          "type": "string",
          "description": "An HTTP URL endpoint where internal logs are exported.",
          "x-referenceable": true
        },
        "access_logs": {
          "type": "object",
          "properties": {
            "endpoint": {
              "type": "string",
              "description": "An HTTP URL endpoint where access logs (e.g. request/response, route/service, latency, etc.) are exported.",
              "x-referenceable": true
            },
            "custom_attributes_by_lua": {
              "type": "object",
              "additionalProperties": {
                "type": "string",
                "minLength": 1
              },
              "description": "A key-value map that dynamically modifies access log fields using Lua code."
            }
          }
        },
        "resource_attributes": {
          "type": "object",
          "additionalProperties": {
            "type": "string",
            "x-lua-required": true
          }
        },
        "queue": {
          "type": "object",
          "properties": {
            "max_coalescing_delay": {
              "type": "number",
              "maximum": 3600,
              "minimum": 0,
              "description": "Maximum number of (fractional) seconds to elapse after the first entry was queued before the queue starts calling the handler.",
              "default": 1
            },
            "max_entries": {
              "type": "integer",
              "maximum": 1000000,
              "minimum": 1,
              "description": "Maximum number of entries that can be waiting on the queue.",
              "default": 10000
            },
            "max_bytes": {
              "type": "integer",
              "description": "Maximum number of bytes that can be waiting on a queue, requires string content."
            },
            "max_retry_time": {
              "type": "number",
              "description": "Time in seconds before the queue gives up calling a failed handler for a batch.",
              "default": 60
            },
            "initial_retry_delay": {
              "type": "number",
              "maximum": 1000000,
              "minimum": 0.001,
              "description": "Time in seconds before the initial retry is made for a failing batch.",
              "default": 0.01
            },
            "max_retry_delay": {
              "type": "number",
              "maximum": 1000000,
              "minimum": 0.001,
              "description": "Maximum time in seconds between retries, caps exponential backoff.",
              "default": 60
            },
            "concurrency_limit": {
              "type": "integer",
              "enum": [
                -1,
                1
              ],
              "description": "The number of of queue delivery timers. -1 indicates unlimited.",
              "default": 1
            },
            "max_batch_size": {
              "type": "integer",
              "maximum": 1000000,
              "minimum": 1,
              "description": "Maximum number of entries that can be processed at a time.",
              "default": 200
            }
          },
          "default": {
            "max_batch_size": 200
          }
        },
        "read_timeout": {
          "type": "integer",
          "maximum": 2147483646,
          "minimum": 0,
          "description": "An integer representing a timeout in milliseconds. Must be between 0 and 2^31-2.",
          "default": 5000
        },
        "http_response_header_for_traceid": {
          "type": "string"
        },
        "sampling_rate": {
          "type": "number",
          "maximum": 1,
          "minimum": 0,
          "description": "Tracing sampling rate for configuring the probability-based sampler. When set, this value supersedes the global `tracing_sampling_rate` setting from kong.conf."
        },
        "headers": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "The custom headers to be added in the HTTP request sent to the OTLP server. This setting is useful for adding the authentication headers (token) for the APM backend."
        },
        "batch_span_count": {
          "type": "integer",
          "description": "The number of spans to be sent in a single batch."
        },
        "client_certificate": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            }
          },
          "description": "Certificate to use as the mTLS client certificate when connecting to a configured HTTPS endpoint. It applies to every signal: traces, logs, access_logs and metrics.",
          "x-foreign": true
        },
        "connect_timeout": {
          "type": "integer",
          "maximum": 2147483646,
          "minimum": 0,
          "description": "An integer representing a timeout in milliseconds. Must be between 0 and 2^31-2.",
          "default": 1000
        },
        "header_type": {
          "type": "string",
          "enum": [
            "aws",
            "b3",
            "b3-single",
            "datadog",
            "gcp",
            "ignore",
            "instana",
            "jaeger",
            "ot",
            "preserve",
            "w3c"
          ],
          "default": "preserve"
        },
        "propagation": {
          "type": "object",
          "properties": {
            "extract": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "aws",
                  "b3",
                  "datadog",
                  "gcp",
                  "instana",
                  "jaeger",
                  "ot",
                  "w3c"
                ]
              },
              "description": "Header formats used to extract tracing context from incoming requests. If multiple values are specified, the first one found will be used for extraction. If left empty, Kong will not extract any tracing context information from incoming requests and generate a trace with no parent and a new trace ID."
            },
            "clear": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Header names to clear after context extraction. This allows to extract the context from a certain header and then remove it from the request, useful when extraction and injection are performed on different header formats and the original header should not be sent to the upstream. If left empty, no headers are cleared."
            },
            "inject": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "aws",
                  "b3",
                  "b3-single",
                  "datadog",
                  "gcp",
                  "instana",
                  "jaeger",
                  "ot",
                  "preserve",
                  "w3c"
                ]
              },
              "description": "Header formats used to inject tracing context. The value `preserve` will use the same header format as the incoming request. If multiple values are specified, all of them will be used during injection. If left empty, Kong will not inject any tracing context information in outgoing requests."
            },
            "default_format": {
              "type": "string",
              "enum": [
                "aws",
                "b3",
                "b3-single",
                "datadog",
                "gcp",
                "instana",
                "jaeger",
                "ot",
                "w3c"
              ],
              "description": "The default header format to use when extractors did not match any format in the incoming headers and `inject` is configured with the value: `preserve`. This can happen when no tracing header was found in the request, or the incoming tracing header formats were not included in `extract`.",
              "default": "w3c"
            }
          },
          "default": {
            "default_format": "w3c"
          }
        },
        "sampling_strategy": {
          "type": "string",
          "enum": [
            "parent_drop_probability_fallback",
            "parent_probability_fallback"
          ],
          "description": "The sampling strategy to use for OTLP `traces`. Set `parent_drop_probability_fallback` if you want parent-based sampling when the parent span contains a `false` sampled flag, and fallback to probability-based sampling otherwise. Set `parent_probability_fallback` if you want parent-based sampling when the parent span contains a valid sampled flag (`true` or `false`), and fallback to probability-based sampling otherwise.",
          "default": "parent_drop_probability_fallback"
        }
      }
    }
  }
}

관련 자료

더 알아보기 (Learn more)