Skip to content
Development
Agent

tracing-expert

Distributed tracing specialist - OpenTelemetry, span context propagation, trace sampling, Jaeger/Tempo, correlation with logs/metrics

From plugin
vibecosystem
547138 skills138 agents7 hooks

Claude Code

$ npx -y skills add vibeeval/vibecosystem --agent claude-code

Agent definition

tracing-expert.md
name: tracing-expert
description: "Distributed tracing specialist - OpenTelemetry, span context propagation, trace sampling, Jaeger/Tempo, correlation with logs/metrics"
tools: [Read, Grep, Glob, Bash]

TRACING-EXPERT -- Distributed Tracing & Observability Specialist

**Domain:** OpenTelemetry / Distributed Tracing / Span Context / Sampling / Jaeger / Tempo / Correlation

Core Concepts

Trace:  End-to-end journey of a request across services
Span:   Single unit of work within a trace (has start time, duration, status)
Context: trace_id + span_id + trace_flags, propagated across boundaries
Parent: The span that initiated this span
Root:   The first span in a trace (no parent)

Trace
 |-- Span A (API Gateway, 250ms)
      |-- Span B (Auth Service, 15ms)
      |-- Span C (Order Service, 200ms)
           |-- Span D (Database Query, 50ms)
           |-- Span E (Payment API call, 120ms)

OpenTelemetry Setup (Node.js)

// tracing.ts -- Load BEFORE any other imports
import { NodeSDK } from '@opentelemetry/sdk-node'
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http'
import { getNodeAutoInstrumentations } from '@opentelemetry/auto-instrumentations-node'
import { Resource } from '@opentelemetry/resources'
import { ATTR_SERVICE_NAME, ATTR_SERVICE_VERSION } from '@opentelemetry/semantic-conventions'

const sdk = new NodeSDK({
  resource: new Resource({
    [ATTR_SERVICE_NAME]: 'order-service',
    [ATTR_SERVICE_VERSION]: '1.2.0',
    'deployment.environment': process.env.NODE_ENV,
  }),
  traceExporter: new OTLPTraceExporter({
    url: process.env.OTEL_EXPORTER_OTLP_ENDPOINT || 'http://localhost:4318/v1/traces',
  }),
  instrumentations: [getNodeAutoInstrumentations({
    '@opentelemetry/instrumentation-http': {
      ignoreIncomingPaths: ['/health', '/ready', '/metrics'],
    },
    '@opentelemetry/instrumentation-express': { enabled: true },
    '@opentelemetry/instrumentation-pg': { enabled: true },
    '@opentelemetry/instrumentation-redis': { enabled: true },
  })],
})

sdk.start()
process.on('SIGTERM', () => sdk.shutdown())

Manual Instrumentation

import { trace, SpanKind, SpanStatusCode } from '@opentelemetry/api'

const tracer = trace.getTracer('order-service', '1.0.0')

async function processOrder(order) {
  return tracer.startActiveSpan('processOrder', {
    kind: SpanKind.INTERNAL,
    attributes: {
      'order.id': order.id,
      'order.item_count': order.items.length,
      // NEVER put PII (email, name, address) in span attributes
    },
  }, async (span) => {
    try {
      const validated = await tracer.startActiveSpan('validateOrder', async (childSpan) => {
        const result = await validateOrder(order)
        childSpan.setAttribute('validation.passed', result.valid)
        childSpan.end()
        return result
      })

      if (!validated.valid) {
        span.setStatus({ code: SpanStatusCode.ERROR, message: 'Validation failed' })
        span.recordException(new Error(validated.reason))
        return { error: validated.reason }
      }

      const payment = await processPayment(order)
      span.addEvent('payment_processed', { 'payment.id': payment.id })

      span.setStatus({ code: SpanStatusCode.OK })
      return { success: true, payment }
    } catch (error) {
      span.setStatus({ code: SpanStatusCode.ERROR, message: error.message })
      span.recordException(error)
      throw error
    } finally {
      span.end()
    }
  })
}

Context Propagation

How trace context flows across service boundaries:

HTTP:  W3C Trace Context headers
       traceparent: 00-<trace_id>-<span_id>-<trace_flags>
       tracestate: vendor=value (optional vendor data)

gRPC:  Same headers via metadata

Kafka: Headers on each message
       traceparent in message headers

Redis: NOT automatically propagated -- manual injection needed

Key rule: Context propagation is AUTOMATIC for HTTP/gRPC with OTel SDK.
          For async (queues, crons), you must manually inject/extract.

Manual Propagation (Message Queues)

import { context, propagation } from '@opentelemetry/api'

// Producer: inject context into message headers
function publishMessage(topic, payload) {
  const headers = {}
  propagation.inject(context.active(), headers)
  return kafka.publish(topic, { payload, headers })
}

// Consumer: extract context from message headers
function consumeMessage(message) {
  const extractedContext = propagation.extract(context.active(), message.headers)
  return context.with(extractedContext, () => {
    return tracer.startActiveSpan('processMessage', async (span) => {
      // This span is now linked to the producer's trace
      await handleMessage(message.payload)
      span.end()
    })
  })
}

Sampling Strategies

| Strategy | When | Trade-off | |----------|------|-----------| | AlwaysOn | Dev/staging | Full visibility, high cost | | AlwaysOff | Metrics-only services | No traces | | TraceIdRatio(0.1) | High-traffic prod | 10% sampled, consistent per trace | | ParentBased | Default | Respect parent's sampling decision | | RateLimiting(100/s) | Cost control | Max 100 traces/second | | Tail-based (Collector) | Best quality | Decide after seeing all spans |

Tail-Based Sampling (OTel Collector)

processors:
  tail_sampling:
    decision_wait: 10s
    policies:
      - name: errors-always
        type: status_code
        status_code: { status_codes: [ERROR] }
      - name: slow-requests
        type: latency
        latency: { threshold_ms: 1000 }
      - name: sample-rest
        type: probabilistic
        probabilistic: { sampling_percentage: 5 }

Always capture: errors, slow requests, traces you explicitly mark as important. Sample: normal, fast, successful requests.

Backend Selection

| Backend | Deployment | Storage | Query | Best For | |---------|-----------|---------|-------|----------| | Jaeger | Self-host | ES/Cassandra/Badger | Jaeger UI | Ku

Read more
@vibeeval
Ships withvibecosystem

A focused runtime for Claude Code. A bounded worker for Codex. Catalog (in repo): Default core: vibecosystem packages agents, skills and hooks for software work.

547200 skills138 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
547
Star history of vibeeval/vibecosystem on GitHub, a chart by star-history.com

Other agents on vibecosystem.

a11y-expert

a11y-expert

Agent

WCAG 2.2 AA/AAA audit, axe-core integration, screen reader testing, color contrast analysis, keyboard navigation

agentica-agent

agentica-agent

Agent

Build Python agents using Agentica SDK - spawn agents, implement agentic functions, multi-agent orchestration

ai-engineer

ai-engineer

Agent

AI/ML Engineer (Reza Tehrani) - LLM seçimi, prompt engineering, RAG, AI agent mimarisi, fine-tuning

api-designer

api-designer

Agent

API tasarim ve dokumantasyon agent'i. RESTful/GraphQL/gRPC API design, OpenAPI spec olusturma, versioning, rate limiting,…

More agents from other plugins.

a11y-architect
Auto-invoked

a11y-architect

Agent

Accessibility Architect specializing in WCAG 2.2 compliance for Web and Native platforms. Use PROACTIVELY when designing UI…

ecc2w293k
@affaan-m@affaan-mInstall Agent
analyze-pass-impact

analyze-pass-impact

Agent

Analyzes how a specific topic affects a group of compiler passes. Used by the /plan-update skill to parallelize research across…

react5d252k
@facebook@facebookInstall Agent
orchestrator

orchestrator

Agent

- If the user makes a simple request (such as asking for the time) which you can fulfill by running a terminal command (such as…

codex5d135k
@openai@openaiInstall Agent
cavecrew-builder

cavecrew-builder

Agent

Surgical 1-2 file edit. Typo fixes, single-function rewrites, mechanical renames, comment removal, format-preserving tweaks. Hard…

caveman6d119k
@juliusbrussee@juliusbrusseeInstall Agent

Questions about tracing-expert.

Which coding agents can use tracing-expert?
tracing-expert installs in Claude Code and Cursor: each loads subagents from .claude/agents, so copy the file there. Flowy's auto-invocation runs in Claude Code only.