otel-observability
БесплатноБез исполняемых скриптовНе проверенOpenTelemetry observability - tracing, metrics, logs, instrumentation, and context propagation patterns When user works with OpenTelemetry, adds…
от shepherdjerred★ 85 звёзд на GitHubОб этом скилле
OpenTelemetry Observability Agent
What's New in OpenTelemetry (2024-2025)
- Stable Logs: Logging API and SDK now stable in many languages
- Events API: New semantic event support
- Profiling signal: CPU/memory profiling support (experimental)
- Enhanced semantic conventions: Standardized attribute names
- Collector improvements: Better performance and reliability
- OTLP/JSON: JSON encoding for OTLP widely supported
Core Concepts
OpenTelemetry (OTel) provides three observability signals:
| Signal | Purpose | Use Case |
|---|---|---|
| Traces | Request flow across services | Debugging distributed systems |
| Metrics | Numerical measurements | Performance monitoring, alerting |
| Logs | Structured event records | Error tracking, audit trails |
| Baggage | Context propagation | Passing data across services |
Installation
Node.js Packages
# Core packages
npm install @opentelemetry/api
npm install @opentelemetry/sdk-node
npm install @opentelemetry/sdk-trace-node
npm install @opentelemetry/sdk-metrics
# Auto-instrumentation
npm install @opentelemetry/auto-instrumentations-node
# OTLP exporters
npm install @opentelemetry/exporter-trace-otlp-http
npm install @opentelemetry/exporter-metrics-otlp-http
Zero-Code Instrumentation
Environment Variables
# Run with auto-instrumentation
OTEL_TRACES_EXPORTER="otlp" \
OTEL_METRICS_EXPORTER="otlp" \
OTEL_LOGS_EXPORTER="otlp" \
OTEL_EXPORTER_OTLP_ENDPOINT="http://localhost:4318" \
OTEL_SERVICE_NAME="my-service" \
OTEL_RESOURCE_ATTRIBUTES="service.version=1.0.0,deployment.environment=production" \
NODE_OPTIONS="--require @opentelemetry/auto-instrumentations-node/register" \
node app.js
Common Environment Variables
| Variable | Description | Example |
|---|---|---|
OTEL_SERVICE_NAME |
Service identifier | "user-service" |
OTEL_EXPORTER_OTLP_ENDPOINT |
Collector endpoint | "http://localhost:4318" |
OTEL_TRACES_EXPORTER |
Trace exporter | "otlp", "console" |
OTEL_METRICS_EXPORTER |
Metrics exporter | "otlp", "prometheus" |
OTEL_LOGS_EXPORTER |
Logs exporter | "otlp", "console" |
OTEL_TRACES_SAMPLER |
Sampling strategy | "parentbased_always_on" |
OTEL_TRACES_SAMPLER_ARG |
Sampler argument | "0.1" (10% sampling) |
Programmatic Setup
Basic Node.js SDK
// instrumentation.ts
import { NodeSDK } from "@opentelemetry/sdk-node";
import { getNodeAutoInstrumentations } from "@opentelemetry/auto-instrumentations-node";
import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http";
import { OTLPMetricExporter } from "@opentelemetry/exporter-metrics-otlp-http";
import { PeriodicExportingMetricReader } from "@opentelemetry/sdk-metrics";
const sdk = new NodeSDK({
serviceName: "my-service",
traceExporter: new OTLPTraceExporter({
url: "http://localhost:4318/v1/traces",
}),
metricReader: new PeriodicExportingMetricReader({
exporter: new OTLPMetricExporter({
url: "http://localhost:4318/v1/metrics",
}),
exportIntervalMillis: 60000,
}),
instrumentations: [getNodeAutoInstrumentations()],
});
sdk.start();
// Graceful shutdown
process.on("SIGTERM", () => {
sdk.shutdown().then(() => process.exit(0));
});
Import Early
// app.ts - instrumentation MUST be imported first
import "./instrumentation";
import express from "express";
// ... rest of app
Tracing
Getting a Tracer
import { trace } from "@opentelemetry/api";
const tracer = trace.getTracer("my-service", "1.0.0");
Creating Spans
// Automatic span management (recommended)
tracer.startActiveSpan("operation-name", (span) => {
try {
// Your code here
span.setAttribute("user.id", userId);
return result;
} catch (error) {
span.recordException(error as Error);
span.setStatus({ code: SpanStatusCode.ERROR });
throw error;
} finally {
span.end();
}
});
// Async operations
async function processOrder(orderId: string) {
return tracer.startActiveSpan("process-order", async (span) => {
try {
span.setAttribute("order.id", orderId);
const result = await orderService.process(orderId);
return result;
} finally {
span.end();
}
});
}
Span Kinds
import { SpanKind } from "@opentelemetry/api";
// CLIENT - outgoing request (HTTP client, DB call)
tracer.startActiveSpan(
"fetch-user",
{ kind: SpanKind.CLIENT },
async (span) => {
const user = await fetch("/api/users/1");
span.end();
},
);
// SERVER - incoming request (HTTP
Установить otel-observability в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл otel-observability?
OpenTelemetry observability - tracing, metrics, logs, instrumentation, and context propagation patterns When user works with OpenTelemetry, adds tracing/metrics/logging, configures exporters, or mentions spans and observability
Как установить скилл otel-observability?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл otel-observability запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic