This demo shows how to run Fluent Bit v4.x with HyperDX integration using Docker Compose. The setup includes log collection, processing with OpenTelemetry formatting, and forwarding to HyperDX for observability.
For other Fluent Bit versions:
- Fluent Bit 2.x: See HyperDX Fluent Bit 2.x documentation
- Other versions: This configuration is compatible with Fluent Bit 3.1.x-4.x series
- Runs Fluent Bit in a Docker container
- Collects logs from multiple sources:
- Dummy logs (for testing)
- HTTP endpoint (for real log ingestion)
- Processes logs with OpenTelemetry envelope format
- Forwards processed logs to HyperDX
- Provides monitoring endpoints
- Docker and Docker Compose installed
- A HyperDX account and API key
- Basic familiarity with Docker
- Log into your HyperDX account
- Navigate to your team settings
- Copy your Ingestion API key
You have two options to provide your API key:
Option A: Export environment variable
export HYPERDX_API_KEY=your_actual_api_key_here
Option B: Create a .env file (recommended for demos)
echo "HYPERDX_API_KEY=your_actual_api_key_here" > .env
docker-compose -f docker-compose.fluentbit-hyperdx.yml up
To run in the background:
docker-compose -f docker-compose.fluentbit-hyperdx.yml up -d
The container should start and you'll see logs indicating Fluent Bit is running. Look for messages like:
[info] [fluent bit] version=X.X.X
[info] [input:dummy:dummy.0] initializing
[info] [input:http:http.1] listening on 0.0.0.0:9880
You can send logs to the HTTP input endpoint:
curl -X POST http://localhost:9880/test \
-H "Content-Type: application/json" \
-d '{"timestamp":"2024-01-01T12:00:00Z","level":"info","message":"Test log from HTTP endpoint"}'
- Log into HyperDX
- Navigate to the search page
- You should see logs from the
my-service
service appearing
- 24224: Forward input port (for Docker log driver)
- 9880: HTTP input port (for sending logs via HTTP)
The setup includes:
- OpenTelemetry Envelope: Wraps logs in OpenTelemetry format
- Content Modifier: Adds service name metadata
- Dual Output: Logs go to both stdout (for debugging) and HyperDX
All logs are automatically tagged with service.name: my-service
. You can modify this in the fluent-bit-4.yaml
configuration file.
API Key Not Set
Error: Authorization header missing or invalid
- Ensure
HYPERDX_API_KEY
environment variable is set - Verify the API key is correct and active
Connection Issues
Error: failed to connect to in-otel.hyperdx.io
- Check internet connectivity
- Verify firewall allows outbound HTTPS on port 443
Container Won't Start
Error: port already in use
- Check if ports 24224 or 9880 are already in use
- Stop other services using these ports or modify the docker-compose file
To see Fluent Bit logs:
docker-compose -f docker-compose.fluentbit-hyperdx.yml logs -f
To see only errors:
docker-compose -f docker-compose.fluentbit-hyperdx.yml logs | grep -i error
docker-compose -f docker-compose.fluentbit-hyperdx.yml down
To also remove the built image:
docker-compose -f docker-compose.fluentbit-hyperdx.yml down --rmi local
Edit fluent-bit-4.yaml
and modify the value
under content_modifier
:
- name: content_modifier
context: otel_resource_attributes
action: upsert
key: service.name
value: your-custom-service-name # Change this
You can extend the configuration by adding more inputs to the fluent-bit-4.yaml
file. See the Fluent Bit documentation for available input plugins.
For issues with:
- Fluent Bit configuration: Check the Fluent Bit documentation
- HyperDX integration: Contact HyperDX support
- This demo setup: Review the troubleshooting section above or open a GitHub issue
Once you've verified the demo works:
- Integrate with your actual applications
- Customize the log processing pipeline for your needs
- Set up proper monitoring and alerting in HyperDX
- Consider scaling the setup for production use