A Docker Logging Driver plugin that forwards container logs to an OpenTelemetry (OTLP) Logs endpoint.
The host permission is required to use host level networking.
docker plugin install --disable --grant-all-permissions moritzloewenstein/otel-docker-logging-driver
docker plugin set moritzloewenstein/otel-docker-logging-driver \
OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=http://localhost:4317 \
OTEL_EXPORTER_OTLP_LOGS_PROTOCOL=grpc \
OTEL_EXPORTER_OTLP_LOGS_INSECURE=true
docker plugin enable moritzloewenstein/otel-docker-logging-driver
The host permission is required to use host level networking.
docker plugin install --disable --grant-all-permissions moritzloewenstein/otel-docker-logging-driver
docker plugin set moritzloewenstein/otel-docker-logging-driver \
OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=http://localhost:4318 \
OTEL_EXPORTER_OTLP_LOGS_PROTOCOL=http \
OTEL_EXPORTER_OTLP_LOGS_INSECURE=true
docker plugin enable moritzloewenstein/otel-docker-logging-driver
In /etc/docker/daemon.json:
{
"log-driver": "moritzloewenstein/otel-docker-logging-driver:latest",
"log-opts": {
"include-labels": "true"
}
}
logging:
driver: moritzloewenstein/otel-docker-logging-driver:latest
options:
include-labels: "true"
docker run --log-driver=moritzloewenstein/otel-docker-logging-driver:latest --log-opt include-labels=true nginx
Plugin-level options (set via docker plugin set), defined in plugin/config.json:
OTEL_EXPORTER_OTLP_LOGS_ENDPOINT – OTLP logs endpoint (e.g., http://localhost:4317 or http://localhost:4318).
OTEL_EXPORTER_OTLP_LOGS_PROTOCOL – grpc or http/protobuf. Default is grpc for backward compatibility.
OTEL_EXPORTER_OTLP_LOGS_INSECURE – set true to disable TLS when using http.
OTEL_EXPORTER_OTLP_LOGS_HEADERS – comma-separated headers, k=v,k2=v2.
OTEL_EXPORTER_OTLP_LOGS_COMPRESSION – compression setting for gRPC (e.g., gzip).
TLS (file-based certificates, gRPC only):
OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE – path to CA certificate PEM file enabling TLS. If unset, the generic OTEL_EXPORTER_OTLP_CERTIFICATE is used as a fallback. TLS creds are applied only when a CA certificate is provided (see the implementation in internal/otelx/otel.go).OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE – optional path to client certificate PEM for mTLS.OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY – optional path to client private key PEM for mTLS.Per-container options (set via --log-opt or compose logging.options), implemented in internal/driver/driver.go:
include-labels – true|1|yes to include container labels as docker.label.<key> attributes.The plugin server exposes a Unix socket named otel-logs when started by Docker Plugin runtime.
Content type
Plugin
Digest
sha256:929dc5a68…
Size
10.7 MB
Last updated
10 months ago
docker plugin install moritzloewenstein/otel-docker-logging-driver