Multi-Backend Integration

Why I Send Telemetry to 5 Different Backends

My production setup sends telemetry to:

  1. Jaeger (7 days) - Distributed tracing and debugging

  2. Prometheus (30 days) - Metrics and alerting

  3. AWS CloudWatch (365 days) - Compliance and auditing

  4. Datadog (90 days) - Team collaboration and dashboards

  5. New Relic (30 days) - APM and user experience monitoring

Each serves a specific purpose. Here's how I integrated them all without drowning in complexity.

Sending to Multiple Backends

Configuration Pattern

import { NodeSDK } from '@opentelemetry/sdk-node';
import { BatchSpanProcessor } from '@opentelemetry/sdk-trace-base';
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';
import { PeriodicExportingMetricReader } from '@opentelemetry/sdk-metrics';
import { OTLPMetricExporter } from '@opentelemetry/exporter-metrics-otlp-http';
import { PrometheusExporter } from '@opentelemetry/exporter-prometheus';

// Multiple trace exporters
const jaegerExporter = new OTLPTraceExporter({
  url: 'http://jaeger:4318/v1/traces',
});

const datadogExporter = new OTLPTraceExporter({
  url: 'https://trace.agent.datadoghq.com/v1/traces',
  headers: {
    'DD-API-KEY': process.env.DD_API_KEY!,
  },
});

const newRelicExporter = new OTLPTraceExporter({
  url: 'https://otlp.nr-data.net/v1/traces',
  headers: {
    'api-key': process.env.NEW_RELIC_LICENSE_KEY!,
  },
});

// Multiple metric exporters
const prometheusExporter = new PrometheusExporter({
  port: 9464,
  endpoint: '/metrics',
});

const cloudwatchExporter = new OTLPMetricExporter({
  url: 'http://aws-otel-collector:4318/v1/metrics',
});

const sdk = new NodeSDK({
  // Send traces to multiple backends
  spanProcessors: [
    new BatchSpanProcessor(jaegerExporter),
    new BatchSpanProcessor(datadogExporter),
    new BatchSpanProcessor(newRelicExporter),
  ],
  
  // Metrics to Prometheus + CloudWatch
  metricReader: new PeriodicExportingMetricReader({
    exporter: cloudwatchExporter,
    exportIntervalMillis: 60000,
  }),
});

sdk.start();

Cloud Provider Integrations

AWS CloudWatch via ADOT Collector

AWS Distro for OpenTelemetry (ADOT):

ADOT Config (otel-config.yaml):

View in CloudWatch:

Google Cloud Operations

Azure Monitor (Application Insights)

Commercial Platforms

Datadog

Kubernetes with Datadog Agent:

New Relic

Honeycomb

Lightstep

Smart Routing with Collector

Send different telemetry to different backends:

Cost Management

Sampling by Backend

Different sampling rates for different purposes:

Monthly Cost Comparison

At 10,000 req/s with different sampling rates:

Backend
Sampling
Data/Month
Cost/Month

Jaeger (self-hosted)

10%

390 GB

$40 (EC2 + storage)

Datadog

1%

39 GB

$350

New Relic

1%

39 GB

$280

CloudWatch

100% errors

20 GB

$50

Total

-

488 GB

$720

Without smart sampling: Would be $3,500/month!

Migration Strategies

Gradual Migration

Migrate from proprietary agent to OpenTelemetry:

Phase 2: Route OTel to Datadog (via Collector)

Phase 3: Remove Datadog agent, use OTel exclusively

Feature Comparison

Feature
Jaeger
Datadog
New Relic
Honeycomb

OpenTelemetry Support

Native

OTLP

OTLP

OTLP

Trace Sampling

Manual

Automatic

Automatic

Automatic

Custom Dashboards

Limited

Excellent

Excellent

Excellent

Alerting

Limited

Excellent

Excellent

Good

APM

No

Yes

Yes

No

Cost (per GB)

$0.10

$9

$7

$5

Self-hosted

Yes

No

No

No

Data Retention

7 days

15 days

8 days

60 days

Best Practices

  1. Use Collector for routing - Don't configure backends in app code

  2. Sample differently per backend - Expensive platforms get 1%, self-hosted get 10%

  3. Standardize on OTLP - Avoid proprietary formats

  4. Monitor export failures - Critical backends shouldn't fail silently

  5. Test in staging first - Especially with commercial platforms

  6. Set budget alerts - Cloud observability costs can spike

  7. Archive to S3 - Long-term compliance data doesn't need expensive backends

Real Production Setup

Here's what I actually run:

Result:

  • Jaeger: Fast debugging, 10% sample, $40/month

  • Datadog: Team dashboards, 1% sample, $350/month

  • CloudWatch: Compliance, errors only, $50/month

  • Total: $440/month for full observability

What's Next

You've reached the end of the OpenTelemetry 101 series! Continue to Observability-Driven Developmentarrow-up-right for the final chapter on building systems with observability in mind from day one.


Previous: ← Production Deploymentarrow-up-right | Next: Observability-Driven Development →arrow-up-right

Vendor-neutral observability gives you freedom to choose the best tools.

Last updated