{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "#/components/schemas/OpentelemetryPluginConfig", "title": "OpentelemetryPluginConfig", "x-speakeasy-entity": "PluginOpentelemetry", "properties": { "config": { "type": "object", "properties": { "access_logs": { "type": "object", "properties": { "custom_attributes_by_lua": { "description": "A key-value map that dynamically modifies access log fields using Lua code.", "type": "object", "additionalProperties": { "minLength": 1, "type": "string" } }, "endpoint": { "description": "An HTTP URL endpoint where access logs (e.g. request/response, route/service, latency, etc.) are exported.", "type": "string", "x-referenceable": true } } }, "batch_flush_delay": { "description": "The delay, in seconds, between two consecutive batches.", "type": "integer" }, "batch_span_count": { "description": "The number of spans to be sent in a single batch.", "type": "integer" }, "connect_timeout": { "description": "An integer representing a timeout in milliseconds. Must be between 0 and 2^31-2.", "type": "integer", "default": 1000, "maximum": 2147483646, "minimum": 0 }, "header_type": { "type": "string", "default": "preserve", "enum": [ "aws", "b3", "b3-single", "datadog", "gcp", "ignore", "instana", "jaeger", "ot", "preserve", "w3c" ] }, "headers": { "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.", "type": "object", "additionalProperties": { "type": "string" } }, "http_response_header_for_traceid": { "type": "string" }, "logs_endpoint": { "description": "An HTTP URL endpoint where internal logs are exported.", "type": "string", "x-referenceable": true }, "metrics": { "type": "object", "properties": { "enable_ai_metrics": { "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`.", "type": "boolean", "default": false }, "enable_bandwidth_metrics": { "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.", "type": "boolean", "default": false }, "enable_consumer_attribute": { "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.", "type": "boolean", "default": false }, "enable_latency_metrics": { "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.", "type": "boolean", "default": false }, "enable_request_metrics": { "description": "A boolean value that determines if request count metrics should be collected. If enabled, `http.server.request.count` metrics will be exported.", "type": "boolean", "default": false }, "enable_upstream_health_metrics": { "description": "A boolean value that determines if upstream health metrics should be collected. If enabled, `kong.upstream.target.status` metrics will be exported.", "type": "boolean", "default": false }, "endpoint": { "description": "An HTTP URL endpoint where metrics are exported.", "type": "string", "x-referenceable": true }, "push_interval": { "description": "The interval in seconds at which metrics are pushed to the OTLP server. This setting is only applicable when `endpoint` is set.", "type": "number", "default": 60 } } }, "propagation": { "type": "object", "default": { "default_format": "w3c" }, "properties": { "clear": { "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.", "type": "array", "items": { "type": "string" } }, "default_format": { "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`.", "type": "string", "default": "w3c", "enum": [ "aws", "b3", "b3-single", "datadog", "gcp", "instana", "jaeger", "ot", "w3c" ] }, "extract": { "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.", "type": "array", "items": { "enum": [ "aws", "b3", "datadog", "gcp", "instana", "jaeger", "ot", "w3c" ], "type": "string" } }, "inject": { "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.", "type": "array", "items": { "enum": [ "aws", "b3", "b3-single", "datadog", "gcp", "instana", "jaeger", "ot", "preserve", "w3c" ], "type": "string" } } } }, "queue": { "type": "object", "default": { "max_batch_size": 200 }, "properties": { "concurrency_limit": { "description": "The number of of queue delivery timers. -1 indicates unlimited.", "type": "integer", "default": 1, "enum": [ -1, 1 ] }, "initial_retry_delay": { "description": "Time in seconds before the initial retry is made for a failing batch.", "type": "number", "default": 0.01, "maximum": 1000000, "minimum": 0.001 }, "max_batch_size": { "description": "Maximum number of entries that can be processed at a time.", "type": "integer", "default": 200, "maximum": 1000000, "minimum": 1 }, "max_bytes": { "description": "Maximum number of bytes that can be waiting on a queue, requires string content.", "type": "integer" }, "max_coalescing_delay": { "description": "Maximum number of (fractional) seconds to elapse after the first entry was queued before the queue starts calling the handler.", "type": "number", "default": 1, "maximum": 3600, "minimum": 0 }, "max_entries": { "description": "Maximum number of entries that can be waiting on the queue.", "type": "integer", "default": 10000, "maximum": 1000000, "minimum": 1 }, "max_retry_delay": { "description": "Maximum time in seconds between retries, caps exponential backoff.", "type": "number", "default": 60, "maximum": 1000000, "minimum": 0.001 }, "max_retry_time": { "description": "Time in seconds before the queue gives up calling a failed handler for a batch.", "type": "number", "default": 60 } } }, "read_timeout": { "description": "An integer representing a timeout in milliseconds. Must be between 0 and 2^31-2.", "type": "integer", "default": 5000, "maximum": 2147483646, "minimum": 0 }, "resource_attributes": { "type": "object", "additionalProperties": { "type": "string", "x-lua-required": true } }, "sampling_rate": { "description": "Tracing sampling rate for configuring the probability-based sampler. When set, this value supersedes the global `tracing_sampling_rate` setting from kong.conf.", "type": "number", "maximum": 1, "minimum": 0 }, "sampling_strategy": { "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.", "type": "string", "default": "parent_drop_probability_fallback", "enum": [ "parent_drop_probability_fallback", "parent_probability_fallback" ] }, "send_timeout": { "description": "An integer representing a timeout in milliseconds. Must be between 0 and 2^31-2.", "type": "integer", "default": 5000, "maximum": 2147483646, "minimum": 0 }, "traces_endpoint": { "description": "A string representing a URL, such as https://example.com/path/to/resource?q=search.", "type": "string", "x-referenceable": true } } }, "consumer": { "description": "If set, the plugin will activate only for requests where the specified has been authenticated. (Note that some plugins can not be restricted to consumers this way.). Leave unset for the plugin to activate regardless of the authenticated Consumer.", "type": "object", "additionalProperties": false, "properties": { "id": { "type": "string" } } }, "name": { "const": "opentelemetry" }, "protocols": { "description": "A set of strings representing protocols.", "type": "array", "items": { "description": "A string representing a protocol, such as HTTP or HTTPS.", "enum": [ "grpc", "grpcs", "http", "https", "tcp", "tls", "tls_passthrough", "udp", "ws", "wss" ], "type": "string" }, "format": "set", "default": [ "grpc", "grpcs", "http", "https" ] }, "route": { "description": "If set, the plugin will only activate when receiving requests via the specified route. Leave unset for the plugin to activate regardless of the route being used.", "type": "object", "additionalProperties": false, "properties": { "id": { "type": "string" } } }, "service": { "description": "If set, the plugin will only activate when receiving requests via one of the routes belonging to the specified Service. Leave unset for the plugin to activate regardless of the Service being matched.", "type": "object", "additionalProperties": false, "properties": { "id": { "type": "string" } } } } }