Docker/Docker Compose
To send logs directly from Docker or Docker Compose, you'll need to configure the Docker Fluentd logging driver (opens in a new tab).
This Guide Integrates:
✅ Logs | ✖️ Metrics | ✖️ Traces |
To send over metrics or APM/traces, you'll need to add the corresponding language integration to your application as well.
Docker Compose
Within Docker Compose, you'll want to add a new logging driver to your existing services. We'll be using Docker's Fluentd logging driver with TLS.
Within each service you'll want to specify logging: *hyperdx-logging
and add
both the hyperdx-key
anchor to the labels, as well as a new label defining the
service.name
(ex. service.name: db
).
Full Example:
version: '3.3'
# Add the following YAML anchors, which can be referenced from services later
x-hyperdx-logging: &hyperdx-logging
driver: fluentd
options:
fluentd-address: tls://in-otel.hyperdx.io:24225
labels: '__HDX_API_KEY,service.name'
x-hyperdx-key: &hyperdx-key
__HDX_API_KEY: <YOUR_API_KEY_HERE>
services:
caddy:
# Configure the logging driver for the service
logging: *hyperdx-logging
image: caddy:alpine
labels:
# Add the key and service name labels
<<: *hyperdx-key
service.name: caddy
After running docker compose up
you'll be able to see your logs within
HyperDX.
Troubleshooting
If you get an error of invalid fluentd-address
, you'll want to make sure your
docker version
shows an engine version newer than 23.0.0
. Otherwise, older
versions of Docker did not come with TLS
support for Fluentd, you can contact
support for more assistance.
Docker
With Docker, you'll want to configure the logging driver directly via the CLI:
docker run --log-driver=fluentd \
--log-opt fluentd-address=tls://in-otel.hyperdx.io:24225 \
--log-opt labels='__HDX_API_KEY,service.name' \
--label service.name=my_docker_service \
--label __HDX_API_KEY=<YOUR_API_KEY_HERE> \
-t alpine echo "Testing a log message"
Troubleshooting
If you get an error of invalid fluentd-address
, you'll want to make sure your
docker version
shows an engine version newer than 23.0.0
. Otherwise, older
versions of Docker did not come with TLS
support for Fluentd, you can contact
support for more assistance.