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
- Log into Honeycomb
- Go to Account → Team Settings → API Keys
- Create a new API key or copy an existing one
- 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 yourdocker-compose.yml:
.env:
4. Kubernetes Configuration
Alternative: Using OpenTelemetry Collector
For advanced features like sampling and enrichment:Docker Compose with Collector
Collector Configuration for Honeycomb
Createotel-collector-config.yaml:
What Gets Sent to Honeycomb
| Data Type | Description |
|---|---|
| Traces | Full request traces with all spans and timing |
| Spans | Individual operations (DB queries, API calls, etc.) |
| Events | Structured logs that appear as trace events |
| Metrics | Request rates, latencies, error counts |
Verification
1. Restart Databrain
2. Generate Test Traffic
3. View in Honeycomb
- Go to Honeycomb UI
- Select your dataset (e.g.,
databrain-production) - You should see traces within seconds (Honeycomb is real-time!)
- 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:- In Honeycomb, go to your dataset
- Click New Query
- Filter:
WHERE service.name = databrain-api - Visualize:
HEATMAP(duration_ms) - Click on slow requests cluster
- Click BubbleUp → Honeycomb shows which attributes correlate with slowness
2. Tracing Waterfall
View full request lifecycle:- Click on any trace
- See the waterfall view with all spans
- Identify bottlenecks (database queries, external APIs)
- Click on spans to see attributes
3. High-Cardinality Queries
Query on any attribute combination:4. Time-based Comparison
Compare performance across time periods:- Set time range (e.g., last hour)
- Click Compare to → Previous period
- See what changed (requests, latency, errors)
5. Service Map
Visualize service dependencies:- Go to Service Map (if enabled)
- See how databrain-api connects to PostgreSQL, Redis, Hasura, etc.
- 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
- Go to Triggers → New Trigger
- Query:
- Threshold: Alert when
COUNT > 10per minute - Add recipient (email, Slack, PagerDuty)
High Latency
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
- Request Rate
- Error Rate
- Latency Heatmap
- Top Endpoints by Traffic
Database Performance Board
- Query Latency
- Slowest Queries
Markers (Deploy Events)
Track deployments with markers:SLOs (Service Level Objectives)
Create SLOs in Honeycomb:- Go to SLOs → New SLO
- Define SLI (Service Level Indicator):
- Set target: 99.9% over 30 days
- Track SLO compliance and error budgets
Troubleshooting
| Issue | Solution |
|---|---|
| No data in Honeycomb | Verify API key is correct and has write permissions |
| 401 Unauthorized | Check x-honeycomb-team header contains valid API key |
| Data in wrong dataset | Set HONEYCOMB_DATASET explicitly |
| Missing attributes | Ensure Winston logger includes metadata in logs |
| High ingestion costs | Implement tail-based sampling in collector |
Debug Mode
Enable verbose logging:Test API Key
Cost Optimization
Honeycomb pricing is based on event volume (spans/events per month). Free tier: 20M events/month Optimization strategies:- Tail-based sampling: Only send interesting traces (errors, slow requests)
- Filter health checks: Exclude
/healthendpoint - Sample high-throughput endpoints: Sample 10% of common endpoints
- Set retention: Adjust in Honeycomb settings (default 60 days)
Sampling Configuration
In collector config:- 100% of errors
- 100% of slow requests (>1s)
- 5% of everything else
Best Practices
1. Use Wide Events
Include rich context in your logs: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
- Honeycomb Documentation: https://docs.honeycomb.io/
- Honeycomb Community: https://www.honeycomb.io/community
- Honeycomb Support: Available via in-app chat or email

