LogService Plugin
By default, Ambassador Edge Stack puts the access logs on stdout; such
that the can be read using kubectl logs. The format of those logs,
and the local destination of them, can be configured using the
envoy_log_ settings in the ambassador
Module. However, the
options there only allow for logging local to Ambassador's Pod. By
configuring a LogService, you can configure Ambassador Edge Stack to
report its access logs to a remote service, in addition to the usual
ambassador Module configured logging.
The remote access log service (or ALS) must implement the
AccessLogService gRPC interface, defined in Envoy's als.proto.
---apiVersion: getambassador.io/v2kind: LogServicemetadata:name: example-log-servicespec:# Common to all Ambassador resourcesambassador_id: # optional; default is ["default"]- "string"ambassador_id: "string" # no need for a list if there's only one value# LogService specificservice: "string" # requireddriver: "enum-string:[tcp, http]" # requireddriver_config: # requiredadditional_log_headers: # optional; default is [] (only for `driver: http`)- header_name: string # requiredduring_request: boolean # optional; default is trueduring_response: boolean # optional; default is trueduring_trailer: boolean # optional; default is trueflush_interval_time: int-seconds # optional; default is 1flush_interval_byte_size: integer # optional; default is 16384grpc: boolean # optional; default is false
serviceis where to route the access log gRPC requests todriveridentifies which type of accesses to log; HTTP requests ("http") or TLS connections ("tcp").driver_configstores the configuration that is specific to thedriver:driver: tcphas no additional configuration; the config must be set asdriver_config: {}.driver: httpadditional_log_headersidentifies HTTP headers to include in the access log, and when in the logged-request's lifecycle to include them.
flush_interval_timeis the maximum number of seconds to buffer accesses for before sending them to the ALS. The logs will be flushed to the ALS every time this duration is reached, or when the buffered data reachesflush_interval_byte_size, whichever comes first. See the Envoy documentation onbuffer_flush_intervalfor more information.flush_interval_byte_sizeis a soft size limit for the access log buffer. The logs will be flushed to the ALS every time the buffered data reaches this size, or wheneverflush_interval_timeelapses, whichever comes first. See the Envoy documentation onbuffer_size_bytesfor more information.grpcmust betrue.
Example
---apiVersion: getambassador.io/v2kind: LogServicemetadata:name: alsspec:service: "als.default:3000"driver: httpdriver_config: {} # NB: driver_config must be set, even if it's emptygrpc: true # NB: grpc must be true
Questions?
We’re here to help. If you have questions, join our Slack or contact us.