Skip to main content

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

  1. Log into New Relic
  2. Click on your name → API Keys
  3. Copy your Ingest - License key
  4. Note your account’s data center (US or EU)

2. Determine Your OTLP Endpoint

3. Configure Databrain Environment Variables

Add these environment variables to your Databrain backend:

4. Docker Compose Configuration

Update your docker-compose.yml:
Security: Store your 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

Create otel-collector-config.yaml:

What Gets Sent to New Relic

Once configured, Databrain automatically sends:

Verification

1. Restart Databrain

2. Generate Test Traffic

3. Check New Relic UI

  1. Distributed Tracing:
    • Navigate to APM & Services → Select databrain-api
    • Click Distributed tracing
    • You should see traces within 1-2 minutes
  2. Service Map:
    • Go to APM & Servicesdatabrain-apiService map
    • View dependencies and relationships
  3. Metrics:
    • Navigate to Metrics & events
    • Query: FROM Metric SELECT * WHERE service.name = 'databrain-api'
  4. 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:
These appear in New Relic as filterable attributes.

New Relic Query Language (NRQL)

Use NRQL to create custom dashboards and alerts:

Example Queries

Average Response Time:
Error Rate:
Slowest Endpoints:
Throughput:

Create Alerts

Set up alerts in New Relic:

High Error Rate Alert

  1. Go to Alerts & AIAlert conditions (policies)
  2. Create a new alert condition
  3. Use NRQL query:
  1. Set threshold: Critical when query returns value > 5 for at least 5 minutes
  2. Add notification channel (email, Slack, PagerDuty, etc.)

High Latency Alert

Threshold: Critical when p95 latency > 2000ms for at least 5 minutes

Troubleshooting

Debug Mode

Enable detailed logging:
Check logs for:
  • [Telemetry] OpenTelemetry initialized
  • Connection errors to New Relic endpoint
  • Trace export confirmations

Verify Collector (if using)

Check collector logs:
Successful export logs:

Dashboard Templates

New Relic provides pre-built dashboard templates for OpenTelemetry:
  1. Go to DashboardsImport dashboard
  2. Search for “OpenTelemetry” templates
  3. Import the “Service Performance” template
  4. 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:
These appear in New Relic logs and can be queried.

3. Use Service Levels (SLIs/SLOs)

Create SLIs in New Relic:
  1. Go to Service levels
  2. Define SLI: “95% of requests complete in < 1s”
  3. 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
Free Tier: 100 GB/month data ingest, 1 full platform user Cost Optimization:
  1. Use sampling (doesn’t affect metrics accuracy)
  2. Set appropriate data retention periods
  3. Filter out low-value spans (health checks)
  4. Use the collector for local aggregation

Support

For Databrain configuration issues, contact your Databrain support team.