Integrating Databrain with Datadog
This guide explains how to send OpenTelemetry traces, metrics, and logs from your self-hosted Databrain instance to Datadog.Prerequisites
- Databrain self-hosted version with OpenTelemetry support
- Datadog account with APM enabled
- Datadog API key
Configuration
1. Get Your Datadog API Key
- Log into your Datadog account
- Navigate to Organization Settings → API Keys
- Copy an existing API key or create a new one
2. Determine Your Datadog Site
Identify your Datadog site (region):3. Configure Databrain Environment Variables
Add these environment variables to your Databrain backend:4. Docker Compose Configuration
Update yourdocker-compose.yml:
DD_API_KEY in a .env file, not directly in docker-compose.yml.
5. Kubernetes Configuration
For Kubernetes deployments:Alternative: Using Datadog Agent
For better performance and additional features, use the Datadog Agent as an OTLP collector:1. Deploy Datadog Agent
Docker Compose:What Gets Sent to Datadog
Once configured, Databrain automatically sends:Verification
1. Restart Databrain
2. Generate Test Traffic
Make a few API requests to your Databrain instance:3. Check Datadog UI
-
APM Traces:
- Navigate to APM → Traces
- Filter by
service:databrain-api - You should see traces within 1-2 minutes
-
Service Map:
- Go to APM → Service Map
- Look for
databrain-apiand its dependencies (PostgreSQL, Redis, etc.)
-
Metrics:
- Navigate to Metrics → Explorer
- Search for
trace.http.request.durationorhttp.server.duration
-
Logs:
- Go to Logs → Search
- Filter by
service:databrain-api - Click on a log entry to see correlated traces
Custom Tags and Attributes
Add custom tags to all telemetry:Advanced Configuration
Sampling Configuration
To reduce costs, configure trace sampling in the Datadog Agent:Resource Attributes
Databrain automatically includes these resource attributes:service.name- Your service name (databrain-api)service.version- Databrain versiondeployment.environment- From DD_ENVhost.name- Container/pod hostname
Troubleshooting
Debug Mode
Enable debug logging to troubleshoot:Verify Agent Connectivity (if using Agent)
Check Datadog Agent logs:Datadog Features
APM Dashboard
Datadog APM provides:- Service Overview: Latency percentiles (p50, p75, p95, p99), throughput, error rates
- Flame Graphs: Visual representation of trace spans
- Deployment Tracking: Compare performance before/after deployments
- Error Tracking: Automatic error detection and grouping
Log Correlation
Click on any trace in Datadog APM to see:- All logs generated during that request
- Database queries executed
- External API calls made
- Full request/response context
Alerts
Set up monitors in Datadog:Pricing Considerations
Datadog pricing is based on:- Indexed Spans: Number of traces retained for search
- Ingested Spans: Total spans sent (used for metrics)
- Custom Metrics: Number of unique metric timeseries
- Use sampling to reduce indexed spans (keeps metrics accurate)
- Filter low-value traces (health checks, static assets)
- Use the Datadog Agent for local aggregation
- Set retention periods appropriately
Support
- Datadog Documentation: https://docs.datadoghq.com/tracing/
- Datadog Support: Available via in-app chat or email
- OpenTelemetry Compatibility: https://docs.datadoghq.com/tracing/trace_collection/otel_instrumentation/

