Skip to main content

Integrating Databrain with Honeycomb

This guide explains how to send OpenTelemetry traces and events from your self-hosted Databrain instance to Honeycomb.

Why Honeycomb?

Honeycomb is purpose-built for OpenTelemetry and excels at:
  • High-cardinality data: Query on any attribute combination
  • BubbleUp: Automatically surface anomalies and outliers
  • Distributed tracing: Full request lifecycle visibility
  • Real-time analysis: Sub-second query performance

Prerequisites

  • Databrain self-hosted version with OpenTelemetry support
  • Honeycomb account (free tier available)
  • Honeycomb API key

Configuration

1. Get Your Honeycomb API Key

  1. Log into Honeycomb
  2. Go to AccountTeam SettingsAPI Keys
  3. Create a new API key or copy an existing one
  4. Note your dataset name (or create a new one)

2. Configure Databrain Environment Variables

Honeycomb supports OpenTelemetry natively, making configuration simple:

3. Docker Compose Configuration

Update your docker-compose.yml:
Security: Store your API key in .env:

4. Kubernetes Configuration

Alternative: Using OpenTelemetry Collector

For advanced features like sampling and enrichment:

Docker Compose with Collector

Collector Configuration for Honeycomb

Create otel-collector-config.yaml:

What Gets Sent to Honeycomb

Verification

1. Restart Databrain

2. Generate Test Traffic

3. View in Honeycomb

  1. Go to Honeycomb UI
  2. Select your dataset (e.g., databrain-production)
  3. You should see traces within seconds (Honeycomb is real-time!)
  4. Click on Recent Traces to explore

4. Check Backend Logs

Look for:

Using Honeycomb Features

1. BubbleUp - Find Anomalies

BubbleUp automatically identifies what makes slow or failing requests different:
  1. In Honeycomb, go to your dataset
  2. Click New Query
  3. Filter: WHERE service.name = databrain-api
  4. Visualize: HEATMAP(duration_ms)
  5. Click on slow requests cluster
  6. Click BubbleUp → Honeycomb shows which attributes correlate with slowness

2. Tracing Waterfall

View full request lifecycle:
  1. Click on any trace
  2. See the waterfall view with all spans
  3. Identify bottlenecks (database queries, external APIs)
  4. Click on spans to see attributes

3. High-Cardinality Queries

Query on any attribute combination:

4. Time-based Comparison

Compare performance across time periods:
  1. Set time range (e.g., last hour)
  2. Click Compare toPrevious period
  3. See what changed (requests, latency, errors)

5. Service Map

Visualize service dependencies:
  1. Go to Service Map (if enabled)
  2. See how databrain-api connects to PostgreSQL, Redis, Hasura, etc.
  3. Click on connections to see request rates and error rates

Example Queries

Slowest Endpoints

Error Analysis

User Experience Analysis

Database Query Performance

Compare Error Rates Over Time

Creating Triggers (Alerts)

Set up alerts in Honeycomb:

High Error Rate

  1. Go to TriggersNew Trigger
  2. Query:
  1. Threshold: Alert when COUNT > 10 per minute
  2. Add recipient (email, Slack, PagerDuty)

High Latency

Threshold: Alert when P95(duration_ms) > 2000

Anomaly Detection

Use Honeycomb’s Anomaly Detection trigger:
  • Automatically learns normal behavior
  • Alerts on statistical anomalies
  • No manual threshold setting required

Boards (Dashboards)

Create custom boards in Honeycomb:

Service Health Board

  1. Request Rate
  1. Error Rate
  1. Latency Heatmap
  1. Top Endpoints by Traffic

Database Performance Board

  1. Query Latency
  1. Slowest Queries

Markers (Deploy Events)

Track deployments with markers:
Markers appear as vertical lines in time-series graphs, making it easy to correlate performance changes with deployments.

SLOs (Service Level Objectives)

Create SLOs in Honeycomb:
  1. Go to SLOsNew SLO
  2. Define SLI (Service Level Indicator):
Example: Availability SLO (99.9%)
  1. Set target: 99.9% over 30 days
  2. Track SLO compliance and error budgets

Troubleshooting

Debug Mode

Enable verbose logging:
Check logs for export confirmations.

Test API Key

Should return team information if valid.

Cost Optimization

Honeycomb pricing is based on event volume (spans/events per month). Free tier: 20M events/month Optimization strategies:
  1. Tail-based sampling: Only send interesting traces (errors, slow requests)
  2. Filter health checks: Exclude /health endpoint
  3. Sample high-throughput endpoints: Sample 10% of common endpoints
  4. Set retention: Adjust in Honeycomb settings (default 60 days)

Sampling Configuration

In collector config:
This keeps:
  • 100% of errors
  • 100% of slow requests (>1s)
  • 5% of everything else

Best Practices

1. Use Wide Events

Include rich context in your logs:
All these attributes become queryable in Honeycomb.

2. Add Custom Instrumentation

For critical business logic, add custom spans:

3. Use Derived Columns

Create computed columns in Honeycomb:
  • Error rate: COUNT_DISTINCT(status.code = ERROR) / COUNT_DISTINCT(trace.id)
  • Apdex score: Custom formula for user satisfaction
  • Business KPIs: Revenue per request, conversion rate, etc.

Support

For Databrain configuration issues, contact your Databrain support team.