OpenTelemetry Instrumentation Extension
Extend OpenTelemetry instrumentation when new functionality is added to the MCP Gateway. Use when (1) new operations/functions are added, (2) reviewing code…

Установить OpenTelemetry Instrumentation Extension в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
OpenTelemetry Instrumentation Extension
Automatically extend OpenTelemetry instrumentation for new functionality in the MCP Gateway, following established patterns documented in docs/telemetry/README.md.
When to Use This Skill
Automatically apply when:
- New state-changing operations added (Create, Update, Delete, Push, Pull, Add, Remove, etc.)
- New CLI commands added to
cmd/docker-mcp/ - New packages with operations in
pkg/ - User mentions "otel", "telemetry", "instrumentation", "metrics", or "tracing"
- Code changes that modify state (database, files, containers, configuration)
- Reviewing code for telemetry coverage
Workflow
Phase 1: Analysis & Suggestion
Read project telemetry standards:
- Read
docs/telemetry/README.md"Development Guidelines" section - Read
pkg/telemetry/telemetry.goto understand existing patterns and metrics
- Read
Identify scope using git diff:
- Find new/changed files in
pkg/andcmd/docker-mcp/ - Identify functions performing state-changing operations
- Infer domain from package structure (e.g.,
pkg/foo/→ domain:foo)
- Find new/changed files in
Categorize findings:
- Operations in existing domains (use existing metrics)
- Operations in new domains (need new metrics)
Present suggestions to user:
- List each function needing instrumentation with file:line reference
- Specify operation type (create, update, delete, etc.)
- Identify domain and whether metrics exist
- Show what will be added (instrumentation code, metrics, docs, tests)
Phase 2: Implementation (After User Approval)
Execute in this order:
- Make changes: Instrument operations and add metrics to
pkg/telemetry/telemetry.go - Verify: Build, run with OTEL collector, check
docker logs otel-debugoutput - Write tests: Add tests to
pkg/telemetry/telemetry_test.go - Update docs: Add metrics/operations to
docs/telemetry/README.md - Run tests: Execute
make test - Final verification: Run
./docs/telemetry/testing/test-telemetry.sh
Key Principles
Follow the project's documented guidelines from docs/telemetry/README.md:
- Use Existing Providers: Get global tracer/meter from OTEL
- Preserve Server Lineage: Include server attribution in all telemetry
- Non-Blocking Operations: Telemetry never blocks or fails operations
- Debug Support: Add logging behind
DOCKER_MCP_TELEMETRY_DEBUG - Follow Naming Conventions: Use
mcp.<domain>.<field>pattern - Deferred Success Tracking: Only set success on clean completion
Where to Find Information
ALWAYS read these files before suggesting changes:
docs/telemetry/README.md- Source of truth for:- Development guidelines (lines 419-474)
- Existing metrics and attributes
- Testing procedures
- Naming conventions
pkg/telemetry/telemetry.go- Understand:- Existing metric instruments
- Recording function patterns
- Helper functions for spans
- Init() structure
pkg/telemetry/telemetry_test.go- See:- Testing patterns
- How to verify metrics
Instrumentation Pattern
Use the simple defer pattern from cmd/docker-mcp/catalog/create.go:
func OperationName(ctx context.Context, identifier string, ...) error {
telemetry.Init()
start := time.Now()
var success bool
defer func() {
duration := time.Since(start)
telemetry.Record<Domain>Operation(ctx, "operation_name", identifier,
float64(duration.Milliseconds()), success)
}()
// ... operation logic ...
// Optional: Record resource counts
telemetry.Record<Domain><Resources>(ctx, identifier, int64(count))
success = true
return nil
}
Note: If identifier is generated during execution, the defer captures its final value.
Adding New Domains
When instrumentation is needed for a new domain (e.g., new package pkg/newdomain/):
1. Add Metric Instruments in pkg/telemetry/telemetry.go
In the Init() function, add global variables and create metric instruments:
var (
// ... existing metrics ...
// New domain metrics
newdomainOperations metric.Int64Counter
newdomainOperationDuration metric.Float64Histogram
newdomainResources metric.Int64Gauge // If managing resources
)
func Init() {
// ... existing init code ...
newdomainOperations, _ = meter.Int64Counter(
"mcp.newdomain.operations",
metric.WithDescription("New domain operations count"),
)
newdomainOperationDuration, _ = meter.Float64Histogram(
"mcp.newdomain.operation.duration",
metric.WithDescription("New domain operation duration in milliseconds"),
)
newdomainResources, _ = meter.Int64Gauge(
"mcp.newdomain.resources",
metric.WithDescription("Number of resources in new domain"),
)
}
2. Add Recording Functions in pkg/telemetry/telemetry.go
After the Init() function, add reco
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл OpenTelemetry Instrumentation Extension?
Extend OpenTelemetry instrumentation when new functionality is added to the MCP Gateway. Use when (1) new operations/functions are added, (2) reviewing code for missing instrumentation, (3) user requests otel/telemetry additions, or (4) working with state-changing operations. Analyzes git diff, suggests instrumentation points following project standards in docs/telemetry/README.md, implements with approval, writes tests, updates documentation, and verifies with debug logging and docker logs.
Как установить скилл OpenTelemetry Instrumentation Extension?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл OpenTelemetry Instrumentation Extension запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
