Skip to main content

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

  1. Log into your Datadog account
  2. Navigate to Organization SettingsAPI Keys
  3. 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 your docker-compose.yml:
Security Note: Store your 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:
Kubernetes (using Datadog Operator):
Then configure Databrain:

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

  1. APM Traces:
    • Navigate to APMTraces
    • Filter by service:databrain-api
    • You should see traces within 1-2 minutes
  2. Service Map:
    • Go to APMService Map
    • Look for databrain-api and its dependencies (PostgreSQL, Redis, etc.)
  3. Metrics:
    • Navigate to MetricsExplorer
    • Search for trace.http.request.duration or http.server.duration
  4. Logs:
    • Go to LogsSearch
    • Filter by service:databrain-api
    • Click on a log entry to see correlated traces

Custom Tags and Attributes

Add custom tags to all telemetry:
These tags will appear in Datadog and can be used for filtering and grouping.

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 version
  • deployment.environment - From DD_ENV
  • host.name - Container/pod hostname

Troubleshooting

Debug Mode

Enable debug logging to troubleshoot:
Check Databrain logs for:

Verify Agent Connectivity (if using Agent)

Check Datadog Agent logs:
You should see:

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
Cost Optimization Tips:
  1. Use sampling to reduce indexed spans (keeps metrics accurate)
  2. Filter low-value traces (health checks, static assets)
  3. Use the Datadog Agent for local aggregation
  4. Set retention periods appropriately

Support

For Databrain configuration issues, contact your Databrain support team.