OpenTelemetry Instrumentation Extension

Automates OpenTelemetry instrumentation for new MCP Gateway operations using the defer pattern.

1.5k|258|Updated Apr 22, 2025
One-click install
npx skills add https://github.com/docker/mcp-gateway --skill opentelemetry-instrumentation-extension
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: OpenTelemetry Instrumentation Extension
Source: https://github.com/docker/mcp-gateway/tree/main/.claude/skills/otel-instrument
Command: npx skills add https://github.com/docker/mcp-gateway --skill opentelemetry-instrumentation-extension

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Extend and standardize OpenTelemetry instrumentation for new MCP Gateway functionality to ensure consistent telemetry coverage across all state-changing changes and new operations.

Core Features & Use Cases

  • InstrumentationPattern: Apply the well-defined defer instrumentation pattern for new operations in pkg/telemetry and cmd/docker-mcp.
  • Tests & Documentation: Generate tests and update docs per docs/telemetry/README.md to validate telemetry.
  • Use Case: When a new CLI command or package operation is added, instrumentation is applied automatically and verified through tests and OTEL.

Quick Start

Follow the documented workflow to identify instrumentation points, implement using the defer pattern, run tests, and validate metrics in the OTEL collector.

Frequently Asked Questions about OpenTelemetry Instrumentation Extension

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add OpenTelemetry instrumentation to new MCP Gateway operations?

Add OpenTelemetry instrumentation by applying the defer pattern for new operations within pkg/telemetry and cmd/docker-mcp. This ensures consistent telemetry coverage for state-changing changes through automated metrics and tests.

When do I need to update telemetry for MCP Gateway changes?

Update telemetry when changes introduce new operations or modify state within pkg/telemetry and cmd/docker-mcp. Instrumentation is required to maintain consistent metrics coverage and validate functionality through tests.

What is the defer pattern for OpenTelemetry metrics in Go applications?

The defer pattern for OpenTelemetry metrics is a standardized instrumentation approach applied to new operations in pkg/telemetry. It ensures telemetry coverage is consistently applied and verified through tests.

How to validate OpenTelemetry metrics after adding new CLI commands?

Validate OpenTelemetry metrics by running generated tests and checking the OTEL collector after applying the defer instrumentation pattern. Update documentation per the telemetry README to verify coverage.

Does the MCP Gateway telemetry instrumentation require updating existing tests?

Yes, the MCP Gateway telemetry instrumentation requires updating existing tests. The process generates tests and updates documentation per the telemetry guidelines to validate the new metrics.

What are the limitations of applying OpenTelemetry instrumentation to MCP Gateway?

Instrumentation applies strictly to new operations and state modifications within pkg/telemetry and cmd/docker-mcp. Changes outside these packages or not involving state modifications do not require this telemetry coverage.