Skip to content

Container Log Collection

Starter
Professional

When log processing is enabled, Glouton automatically gathers logs from Docker and Kubernetes containers.

With auto_discovery enabled, all container logs are collected by default. Use the controls below to apply formats, filters, or disable collection for specific containers.

Specifying a log format for a container can be done in two ways:

Use a container label or pod annotation:

docker run --label glouton.log_format=my_app_parser [...]

See this section for more information about labels and annotations.

If you can’t set container labels or pod annotations, use the container_format setting with the container name:

log.opentelemetry.container_format:
my-app-ctr: my_app_parser

Known filters can be applied using the label or annotation:

docker run --label glouton.log_filter=my_app_filter [...]

A mapping between the container name and the known filter can be defined using the container_filter setting:

log.opentelemetry.container_filter:
app-01: app-filter

Filters can also be applied globally with global filters.

For example, to only keep logs from a specific container:

log.opentelemetry.global_filters:
include:
match_type: strict
record_attributes:
- key: 'container.name'
value: 'app-01'

Disable log processing for a specific container, or enable it even when automatic discovery is not active:

docker run --label glouton.log_enable=false [...]
docker run --label glouton.log_enable=true [...]

This label works with both Docker labels and Kubernetes annotations.