From harness-claude
Configures OTLP exporters for OpenTelemetry traces, metrics, and logs to backends like Jaeger, Grafana Tempo, Datadog or via Collectors. Covers direct export, batching, retries, and YAML pipelines.
npx claudepluginhub intense-visions/harness-engineering --plugin harness-claudeThis skill uses the workspace's default tool permissions.
> Configure OTLP exporters to send traces, metrics, and logs to observability backends and collectors
Guides OpenTelemetry instrumentation setup for traces, metrics, logs including spans, resources, SDKs for Node.js, Python, Java, Go, .NET, Ruby, PHP, Next.js, browser, and Kubernetes best practices.
Sets up OpenTelemetry Node.js SDK with resource attributes, OTLP trace/metric exporters, and auto-instrumentation for HTTP, DB, frameworks. Use for new apps or vendor SDK migrations.
Configures OpenTelemetry Collector with Sentry Exporter to send traces and logs to Sentry, supporting multi-project routing and automatic project creation. Use for OTel-Sentry integrations, collector pipelines, or multi-service telemetry routing.
Share bugs, ideas, or general feedback.
Configure OTLP exporters to send traces, metrics, and logs to observability backends and collectors
@opentelemetry/exporter-trace-otlp-http) or gRPC (@opentelemetry/exporter-trace-otlp-grpc). HTTP is simpler; gRPC has better performance for high-volume telemetry.// Direct export to backend (simple setup)
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';
import { OTLPMetricExporter } from '@opentelemetry/exporter-metrics-otlp-http';
import { BatchSpanProcessor } from '@opentelemetry/sdk-trace-base';
import { PeriodicExportingMetricReader } from '@opentelemetry/sdk-metrics';
// Traces
const traceExporter = new OTLPTraceExporter({
url: process.env.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT || 'http://localhost:4318/v1/traces',
headers: {
Authorization: `Bearer ${process.env.OTEL_EXPORTER_API_KEY}`,
},
compression: 'gzip',
});
const spanProcessor = new BatchSpanProcessor(traceExporter, {
maxQueueSize: 2048,
maxExportBatchSize: 512,
scheduledDelayMillis: 5000,
exportTimeoutMillis: 30000,
});
// Metrics
const metricReader = new PeriodicExportingMetricReader({
exporter: new OTLPMetricExporter({
url: process.env.OTEL_EXPORTER_OTLP_METRICS_ENDPOINT || 'http://localhost:4318/v1/metrics',
}),
exportIntervalMillis: 15000,
});
# otel-collector-config.yaml — Collector as telemetry pipeline
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318
processors:
batch:
timeout: 5s
send_batch_size: 1024
memory_limiter:
check_interval: 1s
limit_mib: 512
attributes:
actions:
- key: environment
value: production
action: upsert
exporters:
otlphttp/grafana:
endpoint: https://tempo.grafana.net
headers:
Authorization: 'Basic ${GRAFANA_API_KEY}'
prometheus:
endpoint: 0.0.0.0:8889
service:
pipelines:
traces:
receivers: [otlp]
processors: [memory_limiter, batch, attributes]
exporters: [otlphttp/grafana]
metrics:
receivers: [otlp]
processors: [memory_limiter, batch]
exporters: [prometheus]
Direct export vs Collector:
Environment variables (standard):
OTEL_EXPORTER_OTLP_ENDPOINT=http://collector:4318
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
OTEL_EXPORTER_OTLP_HEADERS=Authorization=Bearer token
OTEL_EXPORTER_OTLP_COMPRESSION=gzip
OTEL_EXPORTER_OTLP_TIMEOUT=10000
Backend-specific configurations:
// Honeycomb
new OTLPTraceExporter({
url: 'https://api.honeycomb.io/v1/traces',
headers: { 'x-honeycomb-team': process.env.HONEYCOMB_API_KEY },
});
// Grafana Cloud
new OTLPTraceExporter({
url: 'https://tempo-us-central1.grafana.net/tempo',
headers: { Authorization: `Basic ${btoa(`${instanceId}:${apiKey}`)}` },
});
// Datadog (via OTLP)
new OTLPTraceExporter({
url: 'http://datadog-agent:4318/v1/traces',
});
Console exporter for development:
import { ConsoleSpanExporter } from '@opentelemetry/sdk-trace-base';
const sdk = new NodeSDK({
traceExporter: new ConsoleSpanExporter(), // Prints traces to stdout
});
Batch processor tuning:
maxQueueSize: 2048 — max spans held in memory before droppingmaxExportBatchSize: 512 — spans sent per export callscheduledDelayMillis: 5000 — export intervalhttps://opentelemetry.io/docs/languages/js/exporters/