Integrating Databrain with New Relic
This guide explains how to send OpenTelemetry traces, metrics, and logs from your self-hosted Databrain instance to New Relic.Prerequisites
- Databrain self-hosted version with OpenTelemetry support
- New Relic account (free tier available)
- New Relic License Key or Ingest Key
Configuration
1. Get Your New Relic Ingest Key
- Log into New Relic
- Click on your name → API Keys
- Copy your Ingest - License key
- Note your account’s data center (US or EU)
2. Determine Your OTLP Endpoint
| Data Center | OTLP HTTP Endpoint |
|---|---|
| US | https://otlp.nr-data.net:4318 |
| EU | https://otlp.eu01.nr-data.net:4318 |
3. Configure Databrain Environment Variables
Add these environment variables to your Databrain backend:4. Docker Compose Configuration
Update yourdocker-compose.yml:
NEW_RELIC_LICENSE_KEY in a .env file:
5. Kubernetes Configuration
For Kubernetes deployments:Advanced: Using New Relic’s OpenTelemetry Collector
For better control and additional features, deploy the New Relic OpenTelemetry Collector:Docker Compose with Collector
Collector Configuration
Createotel-collector-config.yaml:
What Gets Sent to New Relic
Once configured, Databrain automatically sends:| Telemetry Type | New Relic Product | Description |
|---|---|---|
| Traces | Distributed Tracing | API request spans with timing, status codes, and errors |
| Metrics | Metrics & Events | Request latency histograms, error rates, throughput |
| Logs | Logs | Correlated logs with trace context (trace_id, span_id) |
Verification
1. Restart Databrain
2. Generate Test Traffic
3. Check New Relic UI
-
Distributed Tracing:
- Navigate to APM & Services → Select databrain-api
- Click Distributed tracing
- You should see traces within 1-2 minutes
-
Service Map:
- Go to APM & Services → databrain-api → Service map
- View dependencies and relationships
-
Metrics:
- Navigate to Metrics & events
- Query:
FROM Metric SELECT * WHERE service.name = 'databrain-api'
-
Logs:
- Go to Logs
- Filter:
service.name = databrain-api - Click any log to see correlated traces
4. Check Backend Logs
Look for the initialization message:Custom Attributes and Tags
Add custom attributes to all telemetry:New Relic Query Language (NRQL)
Use NRQL to create custom dashboards and alerts:Example Queries
Average Response Time:Create Alerts
Set up alerts in New Relic:High Error Rate Alert
- Go to Alerts & AI → Alert conditions (policies)
- Create a new alert condition
- Use NRQL query:
- Set threshold: Critical when query returns value > 5 for at least 5 minutes
- Add notification channel (email, Slack, PagerDuty, etc.)
High Latency Alert
Troubleshooting
| Issue | Solution |
|---|---|
| No data in New Relic | Verify OTEL_ENABLED=true and License Key is correct |
| 403 Forbidden | Check License Key has ingest permissions |
| Connection refused | Verify OTLP endpoint URL matches your data center (US/EU) |
| Missing traces | Wait 2-3 minutes; check backend logs for errors |
| High data ingest costs | Implement sampling in collector configuration |
Debug Mode
Enable detailed logging:[Telemetry] OpenTelemetry initialized- Connection errors to New Relic endpoint
- Trace export confirmations
Verify Collector (if using)
Check collector logs:Dashboard Templates
New Relic provides pre-built dashboard templates for OpenTelemetry:- Go to Dashboards → Import dashboard
- Search for “OpenTelemetry” templates
- Import the “Service Performance” template
- Customize filters to show
service.name = databrain-api
Best Practices
1. Use Sampling for High Traffic
Configure head-based sampling in the collector:2. Add Business Context
Include business-relevant attributes:3. Use Service Levels (SLIs/SLOs)
Create SLIs in New Relic:- Go to Service levels
- Define SLI: “95% of requests complete in < 1s”
- Track SLO compliance over time
Pricing Considerations
New Relic pricing is based on:- Data Ingest: GB of data ingested per month
- User Seats: Number of full platform users
- Use sampling (doesn’t affect metrics accuracy)
- Set appropriate data retention periods
- Filter out low-value spans (health checks)
- Use the collector for local aggregation
Support
- New Relic Documentation: https://docs.newrelic.com/docs/more-integrations/open-source-telemetry-integrations/opentelemetry/
- New Relic Support: https://support.newrelic.com/
- Community Forum: https://discuss.newrelic.com/

