OpenTelemetry specialist for AI workload observability — distributed tracing, custom spans for LLM calls, metrics, logs, OTLP exporters, and Azure Monitor integration.
Ships in frootai-deploy-infra-skills. Installing the plugin adds it to Claude Code.
OpenTelemetry specialist for AI workload observability. Designs distributed tracing with custom spans for AI pipelines, metric collection, structured logging, OTLP exporters, and Azure Monitor integration.
| Mistake | Why Wrong | Correct Approach |
|---|---|---|
| Uses Application Insights SDK directly | Vendor lock-in, can't switch backends | OTel SDK → Azure Monitor exporter: vendor-neutral, portable |
| No custom spans for LLM calls | LLM latency invisible in traces | tracer.start_span("llm.completion") with model/tokens attributes |
| Logs token count as log message | Not queryable, not aggregatable | OTel histogram metric: llm.token.usage with model label |
| Missing context propagation | Traces break across service boundaries | W3C traceparent header in all HTTP calls, gRPC metadata |
| Creates span per log line | Massive trace overhead | Spans for operations, logs within spans, events for milestones |
from opentelemetry import trace, metrics
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.metrics import MeterProvider
from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter
from azure.monitor.opentelemetry.exporter import AzureMonitorTraceExporter
# Setup
provider = TracerProvider()
provider.add_span_processor(BatchSpanProcessor(AzureMonitorTraceExporter(
connection_string=os.environ["APPLICATIONINSIGHTS_CONNECTION_STRING"])))
trace.set_tracer_provider(provider)
tracer = trace.get_tracer("ai-service")
meter = metrics.get_meter("ai-service")
# Custom metrics
token_histogram = meter.create_histogram("llm.token.usage", unit="tokens",
description="Token usage per LLM call")
latency_histogram = meter.create_histogram("llm.latency", unit="ms",
description="LLM call latency")
quality_gauge = meter.create_observable_gauge("llm.quality.groundedness")
@tracer.start_as_current_span("chat_pipeline")
async def handle_chat(query: str):
span = trace.get_current_span()
span.set_attribute("user.query_length", len(query))
with tracer.start_as_current_span("retrieval") as retrieval_span:
results = await search(query)
retrieval_span.set_attribute("search.result_count", len(results))
retrieval_span.set_attribute("search.top_score", results[0].score if results else 0)
with tracer.start_as_current_span("llm.completion") as llm_span:
response = await complete(query, results)
llm_span.set_attribute("llm.model", "gpt-4o")
llm_span.set_attribute("llm.temperature", 0.3)
llm_span.set_attribute("llm.prompt_tokens", response.usage.prompt_tokens)
llm_span.set_attribute("llm.completion_tokens", response.usage.completion_tokens)
token_histogram.record(response.usage.total_tokens, {"model": "gpt-4o"})
latency_histogram.record(response.latency_ms, {"model": "gpt-4o"})
with tracer.start_as_current_span("safety_check") as safety_span:
safety = await check_safety(response.content)
safety_span.set_attribute("safety.passed", safety.passed)
return response
import { NodeSDK } from "@opentelemetry/sdk-node";
import { getNodeAutoInstrumentations } from "@opentelemetry/auto-instrumentations-node";
import { AzureMonitorTraceExporter } from "@azure/monitor-opentelemetry-exporter";
const sdk = new NodeSDK({
traceExporter: new AzureMonitorTraceExporter({
connectionString: process.env.APPLICATIONINSIGHTS_CONNECTION_STRING
}),
instrumentations: [getNodeAutoInstrumentations({
"@opentelemetry/instrumentation-http": { enabled: true },
"@opentelemetry/instrumentation-express": { enabled: true }
})]
});
sdk.start();
traceparent in all calls| Scenario | Use This Agent | Don't Use |
|---|---|---|
| OTel instrumentation design | ✅ | |
| Custom AI tracing spans | ✅ | |
| Azure Monitor (App Insights SDK) | ❌ Use fai-azure-monitor-expert | |
| Datadog integration | ❌ Use fai-datadog-expert |
| Play | How This Agent Helps |
|---|---|
| 17 — AI Observability | OTel tracing + metrics for AI pipelines |
What the agent file sets; muted values are Claude Code's defaults
7-day visitors to each agent page
@agent-frootai-deploy-infra-skills:FAI OpenTelemetry Expertfrom frootai-deploy-infra-skills
npx claudepluginhub frootai/frootai --plugin frootai-deploy-infra-skills327 agents in this plugin
AGENTSAGENTS.md — FrootAI Standalone Agents (Auto-Generated Catalog)> **GENERATED FILE — DO NOT EDIT BY HAND.** Re-run `node scripts/generate-agents-md.js` to refresh.FAI A2A ExpertAgent-to-Agent (A2A) protocol specialist — Google's agent interop standard, AgentCard discovery, task lifecycle, streaming artifacts, push notifications, and multi-agent communication patterns.FAI Accessibility ExpertAccessibility specialist — WCAG 2.2 AA/AAA compliance, ARIA 1.2 patterns, screen reader optimization, keyboard navigation, focus management, and inclusive design for AI chatbots and dashboards.FAI ADR WriterADR writer — documents architecture decisions with MADR 3.0 template, context, alternatives, trade-off matrices, consequences, and WAF pillar impact analysis.FAI Agentic RetrieverAgentic retrieval specialist — autonomous source selection, iterative refinement with relevance scoring, multi-hop reasoning, query decomposition, and grounded answer synthesis with inline citations.FAI AG-UI ExpertAG-UI protocol specialist — Agent-User Interaction standard, event-based rendering, streaming state updates, tool call lifecycle, and frontend integration for AI agent experiences.Other plugins' agents for the same job