Event Gateway 구성 참조
Event Gateway 구성 참조 (Event Gateway configuration reference)
Kong Event Gateway 데이터 플레인 노드는 시작 시점에 구성할 수 있어요. 데이터 플레인을 시작할 때 파라미터를 전달해서 컨트롤 플레인 연결, 관측성, 로깅 레벨 등을 지정하는 방법을 소개해요. 환경 변수와 YAML 구성 파일 사용법, 설정 우선순위, 그리고 전체 구성 파라미터 참조까지 함께 확인할 수 있어요.
출처: 문서
본문
데이터 플레인을 시작할 때는 파라미터를 전달해서 컨트롤 플레인에 연결하는 방법을 지정하고, 관측성(observability), 로깅 레벨 등을 설정할 수 있어요.
구성 적용하기
환경 변수나 YAML 구성 파일을 전달해서 Kong Event Gateway 데이터 플레인을 시작 시점에 구성할 수 있어요.
Event Gateway는 다음과 같은 우선순위에 따라 데이터 플레인 노드의 설정을 읽어요:
- 환경 변수
- YAML 구성 파일
- 기본 파라미터
참고: 구성은 데이터 플레인 노드 시작 시점에만 적용할 수 있어요. 구성을 조정해야 한다면 새 데이터 플레인을 시작하거나, 데이터 플레인을 중지한 후 새 파일이나 환경 변수로 다시 시작하세요.
환경 변수 사용하기
Event Gateway 데이터 플레인의 모든 구성 파라미터는 환경 변수로 관리할 수 있어요.
환경 변수로 설정을 구성하려면 설정 이름과 같은 이름의 환경 변수를 선언하세요.
- 관측성, 디버깅과 같이 데이터 플레인에 특정한 파라미터에는
KEG__접두사를 붙여야 해요. - 데이터 플레인과 컨트롤 플레인 간의 연결을 정의하는 파라미터에는
KONG_KONNECT_접두사를 붙여야 해요.
설정해야 하는 구체적인 환경 변수는 각 구성 파라미터 항목을 참고하세요.
예를 들어 로그 레벨을 error로 설정하려면, 시작 시 기본 파라미터에 KEG__OBSERVABILITY__LOG_FLAGS를 추가해서 다음과 같이 설정해요:
docker run -d \
-e "KONG_KONNECT_REGION=us" \
-e "KONG_KONNECT_DOMAIN=konghq.com" \
-e "KONG_KONNECT_GATEWAY_CLUSTER_ID=your-gateway-id" \
-e "KONG_KONNECT_CLIENT_CERT=example-cert" \
-e "KONG_KONNECT_CLIENT_KEY=example-key" \
-e "KEG__OBSERVABILITY__LOG_FLAGS=error" \
-p 19092-19101:19092-19101 \
kong/kong-event-gateway:latest
구성 파일 사용하기
참고: 로컬 구성 파일 사용은 내부 개발 및 테스트 목적으로만 사용하도록 만들어졌어요.
Event Gateway를 구성하려면 YAML 형식의 구성 파일을 만들면 돼요.
예를 들어, 다음은 기본 데이터 플레인 노드 설정에 로그 레벨 설정을 추가하는 기본적인 구성 파일이에요:
cat <<EOF > bootstrap.yaml
konnect:
region: us
domain: konghq.com
gateway_cluster_id: example-gateway-uuid
client_cert: |
example-cert
client_key: |
example-key
observability:
log_flags: error
EOF
파일을 적용하려면 파일을 컨테이너에 마운트하고 run 명령어에 --bootstrap 플래그를 전달하세요.
예를 들면 다음과 같아요:
docker run \
-v /host/path/bootstrap.yaml:/container/path/bootstrap.yaml \
kong/kong-event-gateway:latest \
--bootstrap /container/path/bootstrap.yaml
구성 파라미터
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "BootstrapConfig",
"type": "object",
"properties": {
"konnect": {
"description": "Base Konnect configuration.\n\nContains all the necessary information to connect to Konnect,\nincluding TLS configuration for mTLS authentication.",
"type": "object",
"properties": {
"region": {
"description": "The Konnect region to connect to (e.g., \"us\", \"eu\")",
"type": "string"
},
"domain": {
"description": "The Konnect domain (e.g., \"konghq.com\", \"konghq.tech\")",
"type": "string",
"default": "konghq.com"
},
"gateway_cluster_id": {
"description": "The Gateway Cluster ID (also known as Control Plane ID)",
"type": "string"
},
"api_request_timeout": {
"description": "Timeout for API requests to Konnect (in seconds)",
"type": "string",
"pattern": "^\\d+(\\.\\d+)?(ns|us|µs|ms|s|m|h)$",
"examples": [
"5s",
"100ms",
"1h30m"
],
"default": "5s"
},
"insecure_skip_verify": {
"description": "Skip TLS verification (insecure, for testing only)",
"type": "boolean",
"default": false
},
"client_cert": {
"description": "Client certificate for mTLS (PEM format)",
"type": [
"string",
"null"
]
},
"client_cert_path": {
"description": "Path to client certificate file",
"type": [
"string",
"null"
]
},
"client_key": {
"description": "Client private key for mTLS (PEM format)",
"anyOf": [
{
"description": "Wrapper for sensitive values that redacts content in debug output.\n\nThis type wraps the `secrecy` crate's `SecretString` and adds `JsonSchema`\nsupport for configuration schema generation. The underlying value is\nzeroized on drop for memory protection.",
"type": "string"
},
{
"type": "null"
}
]
},
"client_key_path": {
"description": "Path to client private key file",
"type": [
"string",
"null"
]
}
},
"required": [
"region",
"gateway_cluster_id"
],
"allOf": [
{
"oneOf": [
{
"required": [
"client_cert"
]
},
{
"required": [
"client_cert_path"
]
}
]
},
{
"oneOf": [
{
"required": [
"client_key"
]
},
{
"required": [
"client_key_path"
]
}
]
}
]
},
"config_poll_interval": {
"description": "The interval at which to poll for configuration updates\n\nEnvironment variable: `KEG__CONFIG_POLL_INTERVAL`",
"type": "string",
"pattern": "^\\d+(\\.\\d+)?(ns|us|µs|ms|s|m|h)$",
"examples": [
"5s",
"100ms",
"1h30m"
],
"default": "5s"
},
"runtime": {
"description": "Runtime configuration",
"type": "object",
"properties": {
"drain_duration": {
"description": "Duration to wait for existing connections to drain. It is the time between\n\nEnvironment variable: `KEG__RUNTIME__DRAIN_DURATION`",
"type": "string",
"pattern": "^\\d+(\\.\\d+)?(ns|us|µs|ms|s|m|h)$",
"examples": [
"5s",
"100ms",
"1h30m"
],
"default": "5s"
},
"shutdown_timeout": {
"description": "Timeout for graceful shutdown. It is the time between sending the shutdown\nsignal and forcefully terminating the process.\n\nEnvironment variable: `KEG__RUNTIME__SHUTDOWN_TIMEOUT`",
"type": "string",
"pattern": "^\\d+(\\.\\d+)?(ns|us|µs|ms|s|m|h)$",
"examples": [
"5s",
"100ms",
"1h30m"
],
"default": "10s"
},
"health_listener_address_port": {
"description": "Address and port for the health listener.\n\nEnvironment variable: `KEG__RUNTIME__HEALTH_LISTENER_ADDRESS_PORT`",
"type": "array",
"items": {
"type": "string"
},
"default": [
"127.0.0.1:8080",
"[::1]:8080"
]
}
},
"additionalProperties": false
},
"observability": {
"description": "Observability configuration",
"type": "object",
"properties": {
"log_flags": {
"description": "Configure the log level. Possible levels are: \"trace\", \"debug\", \"info\", \"warn\", \"error\"\n\nThe format is a comma-separated list of log levels for different modules, e.g., `info,keg=debug,my_module=trace`\nIf only a single level is provided, it applies to all modules.\n\nEnvironment variable: `KEG__OBSERVABILITY__LOG_FLAGS`",
"type": "string",
"default": "info"
},
"log_format": {
"description": "Configure the log format.\n\nEnvironment variable: `KEG__OBSERVABILITY__LOG_FORMAT`",
"type": "string",
"enum": [
"logfmt",
"json"
]
},
"metrics_rollup_allow_map": {
"description": "Configure the metrics rollup allow map, this is to avoid high cardinality metrics for example `messaging.operation.name`, `messaging.destination.name` or `messaging.destination.partition.id`.\nThe format is `<label_key>=<allowed_value1>,<allowed_value2>|<label_key2>=<allowed_value3>,<allowed_value4>`\nNon-allowed values will be mapped to \"other\"\n\nEnvironment variable: `KEG__OBSERVABILITY__METRICS_ROLLUP_ALLOW_MAP`",
"type": "string",
"default": "messaging.operation.name=produce,fetch"
},
"policy_errors_info_log_interval": {
"description": "Interval for INFO-level logging of policy errors (time-based sampling).\nSet to \"0s\" to disable.\n\nEnvironment variable: `KEG__OBSERVABILITY__POLICY_ERRORS_INFO_LOG_INTERVAL`",
"type": "string",
"pattern": "^\\d+(\\.\\d+)?(ns|us|µs|ms|s|m|h)$",
"examples": [
"5s",
"100ms",
"1h30m"
],
"default": "1s"
},
"otel": {
"description": "OTLP exporter configuration for all signals.\n\nFollows the [OpenTelemetry OTLP exporter specification](https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/).\nSignal-specific environment variables (e.g., `OTEL_EXPORTER_OTLP_TRACES_*`) take\nprecedence over base variables (`OTEL_EXPORTER_OTLP_*`).\n\nEnvironment variables:\n- Base: `OTEL_EXPORTER_OTLP_ENDPOINT`, `OTEL_EXPORTER_OTLP_PROTOCOL`, `OTEL_EXPORTER_OTLP_TIMEOUT`\n- Traces: `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT`, `OTEL_EXPORTER_OTLP_TRACES_PROTOCOL`, `OTEL_EXPORTER_OTLP_TRACES_TIMEOUT`\n - Sampler: `OTEL_TRACES_SAMPLER`, `OTEL_TRACES_SAMPLER_ARG`\n- Metrics: `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT`, `OTEL_EXPORTER_OTLP_METRICS_PROTOCOL`, `OTEL_EXPORTER_OTLP_METRICS_TIMEOUT`\n- Logs: `OTEL_EXPORTER_OTLP_LOGS_ENDPOINT`, `OTEL_EXPORTER_OTLP_LOGS_PROTOCOL`, `OTEL_EXPORTER_OTLP_LOGS_TIMEOUT`",
"type": "object",
"properties": {
"traces": {
"description": "Trace signal configuration: OTLP exporter settings plus sampler configuration.",
"type": "object",
"properties": {
"endpoint": {
"description": "OTLP endpoint URL.\n\nFor HTTP protocols, should include the full path (e.g., `http://localhost:4318/v1/{signal}`).\nFor gRPC, should be the base URL (e.g., `http://localhost:4317`).\n\nIf not set, the signal is considered disabled.",
"type": [
"string",
"null"
],
"default": null
},
"protocol": {
"description": "OTLP transport protocol.\n\nWraps `opentelemetry_otlp::Protocol` with serde and schema support.",
"oneOf": [
{
"description": "gRPC protocol",
"type": "string",
"const": "grpc"
},
{
"description": "HTTP protocol with binary encoding (default)",
"type": "string",
"const": "http/binary"
},
{
"description": "HTTP protocol with JSON encoding",
"type": "string",
"const": "http/json"
}
]
},
"timeout": {
"description": "Request timeout for the OTLP exporter.",
"type": "string",
"pattern": "^\\d+(\\.\\d+)?(ns|us|µs|ms|s|m|h)$",
"examples": [
"5s",
"100ms",
"1h30m"
],
"default": "10s"
},
"headers": {
"description": "Additional headers to send with OTLP requests.\n\nHeaders are specified as key-value pairs.",
"type": "object",
"additionalProperties": {
"type": "string"
},
"default": {}
},
"traces_sampler": {
"description": "Trace sampler strategy.\n\nCorresponds to the `OTEL_TRACES_SAMPLER` environment variable defined in the\n[OpenTelemetry SDK environment variables specification](https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/#general-sdk-configuration).",
"oneOf": [
{
"description": "Always-On sampler",
"type": "string",
"const": "always_on"
},
{
"description": "Always-Off sampler",
"type": "string",
"const": "always_off"
},
{
"description": "Trace ID ratio-based sampler.",
"type": "string",
"const": "traceidratio"
},
{
"description": "Parent-based Always-On sampler.",
"type": "string",
"const": "parentbased_always_on"
},
{
"description": "Parent-based Always-Off sampler.",
"type": "string",
"const": "parentbased_always_off"
},
{
"description": "Parent-based trace ID ratio sampler.",
"type": "string",
"const": "parentbased_traceidratio"
}
]
},
"traces_sampler_arg": {
"description": "Trace sampler argument.",
"type": "string",
"default": "1.0"
}
}
},
"metrics": {
"description": "Metrics signal configuration: OTLP exporter settings for metrics.\n\nAll fields from [`OtelSignalConfig`] are available via `#[serde(flatten)]`.",
"type": "object",
"properties": {
"endpoint": {
"description": "OTLP endpoint URL.\n\nFor HTTP protocols, should include the full path (e.g., `http://localhost:4318/v1/{signal}`).\nFor gRPC, should be the base URL (e.g., `http://localhost:4317`).\n\nIf not set, the signal is considered disabled.",
"type": [
"string",
"null"
],
"default": null
},
"protocol": {
"description": "OTLP transport protocol.\n\nWraps `opentelemetry_otlp::Protocol` with serde and schema support.",
"oneOf": [
{
"description": "gRPC protocol",
"type": "string",
"const": "grpc"
},
{
"description": "HTTP protocol with binary encoding (default)",
"type": "string",
"const": "http/binary"
},
{
"description": "HTTP protocol with JSON encoding",
"type": "string",
"const": "http/json"
}
]
},
"timeout": {
"description": "Request timeout for the OTLP exporter.",
"type": "string",
"pattern": "^\\d+(\\.\\d+)?(ns|us|µs|ms|s|m|h)$",
"examples": [
"5s",
"100ms",
"1h30m"
],
"default": "10s"
},
"headers": {
"description": "Additional headers to send with OTLP requests.\n\nHeaders are specified as key-value pairs.",
"type": "object",
"additionalProperties": {
"type": "string"
},
"default": {}
}
}
},
"logs": {
"description": "Logs signal configuration: OTLP exporter settings for logs.\n\nAll fields from [`OtelSignalConfig`] are available via `#[serde(flatten)]`.",
"type": "object",
"properties": {
"endpoint": {
"description": "OTLP endpoint URL.\n\nFor HTTP protocols, should include the full path (e.g., `http://localhost:4318/v1/{signal}`).\nFor gRPC, should be the base URL (e.g., `http://localhost:4317`).\n\nIf not set, the signal is considered disabled.",
"type": [
"string",
"null"
],
"default": null
},
"protocol": {
"description": "OTLP transport protocol.\n\nWraps `opentelemetry_otlp::Protocol` with serde and schema support.",
"oneOf": [
{
"description": "gRPC protocol",
"type": "string",
"const": "grpc"
},
{
"description": "HTTP protocol with binary encoding (default)",
"type": "string",
"const": "http/binary"
},
{
"description": "HTTP protocol with JSON encoding",
"type": "string",
"const": "http/json"
}
]
},
"timeout": {
"description": "Request timeout for the OTLP exporter.",
"type": "string",
"pattern": "^\\d+(\\.\\d+)?(ns|us|µs|ms|s|m|h)$",
"examples": [
"5s",
"100ms",
"1h30m"
],
"default": "10s"
},
"headers": {
"description": "Additional headers to send with OTLP requests.\n\nHeaders are specified as key-value pairs.",
"type": "object",
"additionalProperties": {
"type": "string"
},
"default": {}
}
}
}
}
}
},
"additionalProperties": false
},
"enable_debug_endpoints": {
"description": "Enables debug endpoints:\n\n- /debug/pprof/allocs endpoint\n Additionally, you need to enable jemalloc profiling like this `MALLOC_CONF=\"prof:true,prof_active:true,lg_prof_sample:19\"`\n\nEnvironment variable: `KEG__ENABLE_DEBUG_ENDPOINTS`",
"type": "boolean",
"default": false
}
},
"additionalProperties": false
}
더 알아보기 (Learn more)
이 문서에는 원문에서 추출한 별도의 관련 문서 링크가 없어요.