Metering & Billing 플러그인 설정 레퍼런스
Metering & Billing 플러그인 설정 레퍼런스 (Metering & Billing Plugin Configuration Reference)
이 문서는 Kong의 Metering & Billing 플러그인에서 설정할 수 있는 파라미터를 스키마 형태로 정리한 설정 레퍼런스예요. 사용량 이벤트를 보낼 ingest 엔드포인트와 인증용 API 토큰, 청구 기준이 되는 커스텀 속성, 허용할 상태 코드 범위 같은 핵심 필드를 하나씩 설명해요. AI Gateway 요청의 LLM 토큰 사용량 미터링 여부나 일반 API 요청 미터링 옵션, 큐와 연결 유지 시간 같은 세부 설정도 함께 다뤄요. 각 필드의 기본값과 볼트 참조 가능 여부, 암호화 지원 여부까지 한눈에 확인할 수 있어요
출처: 문서
본문
{
"properties": {
"config": {
"properties": {
"allow_status_codes": {
"description": "List of status code ranges that are allowed to be logged in usage events.",
"items": {
"type": "string"
},
"type": "array"
},
"api_token": {
"description": "Bearer token for authenticating with the ingest endpoint. \nThis field is [referenceable](/gateway/entities/vault/#how-do-i-reference-secrets-stored-in-a-vault). \nThis field is [encrypted](/gateway/keyring/).",
"type": "string",
"x-encrypted": true,
"x-referenceable": true
},
"attributes": {
"description": "Capture custom properties to the usage event data payload for pricing dimensions or reporting. Attributes add dimensions like provider, department or project that your billing model needs for tiered or per-dimension pricing.",
"items": {
"properties": {
"event_property_name": {
"description": "The property name in the usage event data payload.",
"type": "string"
},
"look_up_value_in": {
"description": "The header name or query parameter that contains the value, e.g 'x-department-id'",
"type": "string"
},
"source": {
"description": "Where to find this attribute in the request.",
"enum": [
"header",
"query"
],
"type": "string"
}
},
"required": [
"event_property_name",
"look_up_value_in",
"source"
],
"type": "object"
},
"type": "array"
},
"ingest_endpoint": {
"description": "The HTTP endpoint where usage events are sent. \nThis field is [referenceable](/gateway/entities/vault/#how-do-i-reference-secrets-stored-in-a-vault).",
"type": "string",
"x-referenceable": true
},
"keepalive": {
"default": 60000,
"description": "How long in milliseconds an idle connection to the ingest endpoint is kept open before being closed.",
"type": "number"
},
"meter_ai_token_usage": {
"default": true,
"description": "Emit events for LLM input and output tokens on AI Gateway requests.",
"type": "boolean"
},
"meter_api_requests": {
"default": true,
"description": "Emit a usage event for each API Gateway request.",
"type": "boolean"
},
"queue": {
"properties": {
"breaker_cooldown": {
"default": 60,
"description": "Time in seconds the circuit breaker stays open (fast-shedding entries) before it allows a single batch through to probe whether the destination has recovered.",
"maximum": 1000000,
"minimum": 0,
"type": "number"
},
"concurrency_limit": {
"default": 1,
"description": "The number of of queue delivery timers. -1 indicates unlimited.",
"enum": [
-1,
1
],
"type": "integer"
},
"failure_threshold": {
"default": 0,
"description": "Number of consecutive failed batches after which the queue opens its circuit breaker and drops entries instead of retrying. 0 disables the circuit breaker.",
"maximum": 1000000,
"minimum": 0,
"type": "integer"
},
"initial_retry_delay": {
"default": 0.01,
"description": "Time in seconds before the initial retry is made for a failing batch.",
"maximum": 1000000,
"minimum": 0.001,
"type": "number"
},
"max_batch_size": {
"default": 1,
"description": "Maximum number of entries that can be processed at a time.",
"maximum": 1000000,
"minimum": 1,
"type": "integer"
},
"max_bytes": {
"description": "Maximum number of bytes that can be waiting on a queue, requires string content.",
"type": "integer"
},
"max_coalescing_delay": {
"default": 1,
"description": "Maximum number of (fractional) seconds to elapse after the first entry was queued before the queue starts calling the handler.",
"maximum": 3600,
"minimum": 0,
"type": "number"
},
"max_entries": {
"default": 10000,
"description": "Maximum number of entries that can be waiting on the queue.",
"maximum": 1000000,
"minimum": 1,
"type": "integer"
},
"max_retry_delay": {
"default": 60,
"description": "Maximum time in seconds between retries, caps exponential backoff.",
"maximum": 1000000,
"minimum": 0.001,
"type": "number"
},
"max_retry_time": {
"default": 60,
"description": "Time in seconds before the queue gives up calling a failed handler for a batch.",
"type": "number"
}
},
"type": "object"
},
"ssl_verify": {
"default": true,
"description": "Verify the TLS certificate presented by the ingest endpoint.",
"type": "boolean"
},
"subject": {
"description": "The subject identifies who gets billed for each request. Choose where the plugin should look for the customer identifier.",
"properties": {
"field": {
"description": "The header name, query parameter, consumer field, or application field that contains the customer identifier, e.g. 'x-customer-id'",
"type": "string"
},
"look_up_value_in": {
"default": "consumer",
"description": "Where to find the customer identifier in the request.",
"enum": [
"application",
"consumer",
"header",
"query"
],
"type": "string"
}
},
"type": "object"
},
"timeout": {
"default": 10000,
"description": "Maximum time in milliseconds to wait for a response from the ingest endpoint.",
"type": "number"
}
},
"required": [
"api_token",
"ingest_endpoint"
],
"type": "object"
},
"consumer": {
"additionalProperties": false,
"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.",
"properties": {
"id": {
"type": "string"
}
},
"type": "object"
},
"expressions": {
"additionalProperties": true,
"type": "object"
},
"protocols": {
"default": [
"grpc",
"grpcs",
"http",
"https"
],
"description": "A set of strings representing protocols.",
"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"
},
"type": "array"
},
"route": {
"additionalProperties": false,
"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.",
"properties": {
"id": {
"type": "string"
}
},
"type": "object"
},
"service": {
"additionalProperties": false,
"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.",
"properties": {
"id": {
"type": "string"
}
},
"type": "object"
}
},
"required": [
"config"
]
}
관련 리소스
더 알아보기 (Learn more)
- Metering & Billing 기능의 전체 개요와 구성 방식을 소개해요 — Konnect Metering & Billing
- API 사용량을 수집하고 미터링하는 동작 방식을 자세히 설명해요 — Konnect metering
- Consumer별 API 요청을 미터링하는 실습 가이드로 설정을 직접 따라 해볼 수 있어요 — Meter API requests by Consumer with Metering & Billing
- 사용량 한도를 강제하는 연동 플러그인을 소개해요 — Entitlement Enforcement plugin
- api_token 같은 필드를 볼트에 저장된 시크릿으로 참조하는 방법을 설명해요 — referenceable
- 민감한 설정 값의 키링 암호화 동작을 설명해요 — encrypted