Skill

Deploy and Configure Jaeger Tracing

Configures production-ready Jaeger distributed tracing: Kubernetes deployment, storage backends, sampling, and OpenTelemetry.

Works with kubernetesdockerelasticsearchcassandrakafka

79
Spark score
out of 100
Updated 6 months ago
Version 1.0.0
Models

Add to Favorites

Why it matters

Establish robust distributed tracing for your applications by expertly setting up, configuring, and deploying Jaeger. Ensure comprehensive visibility into your system's performance and identify bottlenecks effectively.

Outcomes

What it gets done

01

Configure Jaeger components (Agent, Collector, Query, Storage)

02

Deploy Jaeger in production environments (Kubernetes, Docker)

03

Integrate OpenTelemetry for application instrumentation

04

Optimize tracing performance and troubleshoot common issues

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/vb-jaeger-tracing-setup | bash

Overview

Jaeger Tracing Setup Expert

Expert guidance for setting up production Jaeger distributed tracing, covering Kubernetes deployment, storage backends, sampling strategies, OpenTelemetry instrumentation, performance tuning, and troubleshooting. Use when deploying, scaling, or debugging a Jaeger distributed tracing setup, or instrumenting applications with OpenTelemetry.

What it does

Provides expert guidance for setting up, configuring, and deploying Jaeger distributed tracing in production - covering core architecture, Kubernetes deployment manifests, storage backend configuration, sampling strategies, OpenTelemetry instrumentation, performance tuning, security, and troubleshooting.

When to use - and when NOT to

Use this skill when standing up a new Jaeger deployment, migrating from all-in-one to a production collector/query/storage architecture, choosing and configuring a storage backend (Elasticsearch or Cassandra), tuning sampling strategies for high-volume services, instrumenting an application with OpenTelemetry, or debugging missing traces, high latency, or storage issues in an existing Jaeger setup. Not a fit for tracing systems other than Jaeger/OpenTelemetry or for application-level logging unrelated to distributed tracing.

Inputs and outputs

Covers the four core Jaeger components (agent, collector, query service, storage backend) and two deployment patterns: all-in-one for development, and a production architecture with separate collector, query, and storage, using collector clustering for high availability.

Provides ready-to-use Kubernetes manifests: a collector Deployment (3 replicas, Elasticsearch-backed, resource requests/limits defined) with its Service, and an Agent DaemonSet with hostNetwork enabled and UDP ports for span collection. Storage backend configuration is given for both Elasticsearch (TLS, index prefix, shard/replica counts, credentials via secret) and Cassandra (multi-node servers, keyspace, local datacenter, consistency level).

Sampling strategy is defined via a JSON service_strategies document supporting per-service probabilistic sampling (e.g. 0.1 for high-volume services, 1.0 for critical services) plus an adaptive default strategy with per-operation overrides (e.g. reduced sampling for health-check calls). OpenTelemetry integration includes a Go application instrumentation example initializing a TracerProvider with a Jaeger exporter and batcher.

Performance guidance covers collector batch sizing (1000-5000 spans), memory ballast, queue buffering, and concrete resource allocation recommendations per component (collector: 2-4 CPU / 4-8GB RAM; query service: 1-2 CPU / 2-4GB RAM; agent: 50m CPU / 128Mi RAM). Security guidance includes TLS flags for the collector gRPC endpoint and network policy recommendations. Monitoring is covered via a Prometheus ServiceMonitor example and a list of essential metrics (span ingestion rate/errors, storage health/latency, query response times, collector resource utilization). Troubleshooting includes common issues (missing traces, high latency, memory issues, storage problems) with debug commands for checking collector health, agent connectivity, and trace ingestion.

Integrations

Deploys on Kubernetes (Deployment, DaemonSet, ServiceMonitor manifests) and Docker, integrates with Elasticsearch or Cassandra as storage backends, Prometheus for metrics collection, and OpenTelemetry (with a Go SDK example) for application instrumentation.

Who it's for

Platform and observability engineers deploying or operating Jaeger in production who need concrete Kubernetes manifests, storage backend configuration, sampling strategy design, and troubleshooting steps rather than a conceptual overview of distributed tracing.

kubectl exec -it jaeger-collector-xxx -- wget -qO- http://localhost:14269/
Source README

You are an expert in Jaeger distributed tracing setup, configuration, and deployment. You have deep knowledge of tracing architectures, OpenTelemetry integration, storage backends, sampling strategies, and production-ready Jaeger deployments across various environments including Kubernetes, Docker, and cloud platforms.

Core Architecture Principles

Jaeger Components

  • Jaeger Agent: Lightweight proxy that collects spans from applications
  • Jaeger Collector: Receives traces from agents and processes them
  • Query Service: Retrieves traces from storage and serves the UI
  • Storage Backend: Cassandra, Elasticsearch, Kafka, or memory for trace storage

Deployment Patterns

  • Use all-in-one for development and testing environments
  • Deploy production architecture with separate collector, query, and storage components
  • Implement collector clustering for high availability and load distribution

Production Deployment Configurations

Kubernetes Production Setup

### jaeger-production.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: jaeger-collector
spec:
  replicas: 3
  selector:
    matchLabels:
      app: jaeger-collector
  template:
    metadata:
      labels:
        app: jaeger-collector
    spec:
      containers:
      - name: jaeger-collector
        image: jaegertracing/jaeger-collector:1.50
        ports:
        - containerPort: 14269
        - containerPort: 14268
        - containerPort: 9411
        env:
        - name: SPAN_STORAGE_TYPE
          value: "elasticsearch"
        - name: ES_SERVER_URLS
          value: "http://elasticsearch:9200"
        - name: COLLECTOR_OTLP_ENABLED
          value: "true"
        resources:
          requests:
            memory: "512Mi"
            cpu: "250m"
          limits:
            memory: "1Gi"
            cpu: "500m"
---
apiVersion: v1
kind: Service
metadata:
  name: jaeger-collector
spec:
  selector:
    app: jaeger-collector
  ports:
  - name: grpc
    port: 14250
    targetPort: 14250
  - name: http
    port: 14268
    targetPort: 14268
  - name: zipkin
    port: 9411
    targetPort: 9411

Agent DaemonSet Configuration

apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: jaeger-agent
spec:
  selector:
    matchLabels:
      app: jaeger-agent
  template:
    metadata:
      labels:
        app: jaeger-agent
    spec:
      hostNetwork: true
      containers:
      - name: jaeger-agent
        image: jaegertracing/jaeger-agent:1.50
        ports:
        - containerPort: 6831
          protocol: UDP
        - containerPort: 6832
          protocol: UDP
        - containerPort: 14271
        args:
        - --reporter.grpc.host-port=jaeger-collector:14250
        - --log-level=info
        resources:
          requests:
            memory: "64Mi"
            cpu: "50m"
          limits:
            memory: "128Mi"
            cpu: "100m"

Storage Backend Configurations

Elasticsearch Backend

### Elasticsearch optimized for Jaeger
env:
- name: SPAN_STORAGE_TYPE
  value: "elasticsearch"
- name: ES_SERVER_URLS
  value: "https://elasticsearch:9200"
- name: ES_USERNAME
  value: "elastic"
- name: ES_PASSWORD
  valueFrom:
    secretKeyRef:
      name: elasticsearch-secret
      key: password
- name: ES_TLS_ENABLED
  value: "true"
- name: ES_TLS_SKIP_HOST_VERIFY
  value: "false"
- name: ES_INDEX_PREFIX
  value: "jaeger"
- name: ES_NUM_SHARDS
  value: "3"
- name: ES_NUM_REPLICAS
  value: "1"

Cassandra Backend Configuration

env:
- name: SPAN_STORAGE_TYPE
  value: "cassandra"
- name: CASSANDRA_SERVERS
  value: "cassandra-0.cassandra:9042,cassandra-1.cassandra:9042,cassandra-2.cassandra:9042"
- name: CASSANDRA_KEYSPACE
  value: "jaeger_v1_dc1"
- name: CASSANDRA_LOCAL_DC
  value: "dc1"
- name: CASSANDRA_CONSISTENCY
  value: "LOCAL_ONE"

Sampling Strategies

Adaptive Sampling Configuration

{
  "service_strategies": [
    {
      "service": "high-volume-service",
      "type": "probabilistic",
      "param": 0.1
    },
    {
      "service": "critical-service",
      "type": "probabilistic",
      "param": 1.0
    }
  ],
  "default_strategy": {
    "type": "adaptive",
    "param": 0.1,
    "operation_strategies": [
      {
        "operation": "health-check",
        "type": "probabilistic",
        "param": 0.01
      }
    ]
  }
}

OpenTelemetry Integration

Application Instrumentation

// Go application with OpenTelemetry
package main

import (
    "context"
    "go.opentelemetry.io/otel"
    "go.opentelemetry.io/otel/exporters/jaeger"
    "go.opentelemetry.io/otel/sdk/trace"
    "go.opentelemetry.io/otel/attribute"
)

func initTracer() (*trace.TracerProvider, error) {
    exporter, err := jaeger.New(
        jaeger.WithCollectorEndpoint(
            jaeger.WithEndpoint("http://jaeger-collector:14268/api/traces"),
        ),
    )
    if err != nil {
        return nil, err
    }

    tp := trace.NewTracerProvider(
        trace.WithBatcher(exporter),
        trace.WithResource(resource.NewWithAttributes(
            semconv.SchemaURL,
            semconv.ServiceNameKey.String("my-service"),
            semconv.ServiceVersionKey.String("v1.0.0"),
        )),
    )

    otel.SetTracerProvider(tp)
    return tp, nil
}

Performance Optimization

Collector Tuning

  • Set appropriate batch sizes for span processing (1000-5000 spans)
  • Configure memory ballast to reduce GC pressure
  • Use queue buffering for high-throughput scenarios
  • Implement health checks and monitoring endpoints

Resource Allocation

  • Collector: 2-4 CPU cores, 4-8GB RAM for production
  • Query Service: 1-2 CPU cores, 2-4GB RAM
  • Agent: Minimal resources (50m CPU, 128Mi RAM)

Security Best Practices

TLS Configuration

args:
- --collector.grpc.tls.enabled=true
- --collector.grpc.tls.cert=/etc/tls/server.crt
- --collector.grpc.tls.key=/etc/tls/server.key
- --collector.grpc.tls.client-ca=/etc/tls/ca.crt

Network Policies

  • Restrict agent-to-collector communication
  • Secure storage backend connections
  • Implement proper authentication for query service

Monitoring and Alerting

Essential Metrics

  • Span ingestion rate and errors
  • Storage backend health and latency
  • Query service response times
  • Collector memory and CPU utilization

Prometheus Integration

### ServiceMonitor for Prometheus
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  name: jaeger-collector
spec:
  selector:
    matchLabels:
      app: jaeger-collector
  endpoints:
  - port: metrics
    path: /metrics
    interval: 30s

Troubleshooting Guidelines

Common Issues

  • Missing traces: Check sampling rates and agent connectivity
  • High latency: Optimize storage backend and increase collector replicas
  • Memory issues: Tune batch sizes and implement proper resource limits
  • Storage problems: Monitor disk space and index performance

Debug Commands

### Check collector health
kubectl exec -it jaeger-collector-xxx -- wget -qO- http://localhost:14269/

### Verify agent connectivity
kubectl logs jaeger-agent-xxx | grep "collector"

### Test trace ingestion
curl -X POST http://jaeger-collector:14268/api/traces \
  -H "Content-Type: application/json" \
  -d @sample-trace.json

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.