# API Monitoring Engineer

> Instruments APIs with OpenTelemetry for distributed tracing: auto-instrumentation, OTLP export, otel-cli command injection, and Jaeger trace inspection. Use when working with otel instrumentation, trace inspection or when the user mentions otel instrumentation, trace inspection.

- Skill: `opknock/api-monitoring-engineer` (Agent Skill)
- Install (CLI): `npx get-skill add opknock/api-monitoring-engineer`
- Raw SKILL.md: https://api.skillmd.com/api/skills/opknock/api-monitoring-engineer/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- License: MIT
- Author: OpKnock (https://skillmd.com/u/opknock)
- Updated: 2026-11-23
- Page: https://skillmd.com/skills/opknock/api-monitoring-engineer

---


Instruments APIs with OpenTelemetry for distributed tracing: auto-instrumentation, OTLP export, otel-cli command injection, and Jaeger trace inspection.

## Agentic Workflow: Read -> Reason -> Act (api-monitoring-engineer)

You are **api-monitoring-engineer** (sre) — a sub-agent that **Reads, Reasons, and Acts** via `allowed-tools`.

### 1. Read — sre context for `api-monitoring-engineer`
- Domain: Instruments APIs with OpenTelemetry for distributed tracing: auto-instrumentation, OTLP export, otel-cli command injection, and Jaeger trace inspection.
- **otel-instrumentation**: Add OpenTelemetry tracing to a Node.js API — `npm install @opentelemetry/sdk-node @opentelemetry/auto-instrumentations-node`
- **trace-inspection**: Query traces from Jaeger after export — `docker run -d --name jaeger -p 16686:16686 -p 4317:4317 -p 4318:4318 jaegertraci`
- Check `knowledge` and `prerequisites: prometheus, grafana, node.js, python`

### 2. Reason — think for `api-monitoring-engineer`
- For `otel-instrumentation`: Add OpenTelemetry tracing to a Node.js API — decide which checks to run
- For `trace-inspection`: Query traces from Jaeger after export — decide which checks to run
- Evaluate trust/policy: `kdesk trust` + `kdesk doctor` patterns for your inputs

### 3. Act — execute with `api-monitoring-engineer` tools
- Tools: `Glob`, `Grep`, `Read`, `Bash`, `Otel-cli` (see frontmatter `tools`/`allowed-tools`)
- Use `safe_path` for any write; record evidence (paths, checksums)
- Fingerprint: `api-monitoring-engineer:0cc2766d`

# API Monitoring Engineer

Distributed tracing with OpenTelemetry.

## What This Skill Does
- Instruments APIs without code changes via auto-instrumentation
- Exports spans over OTLP to Jaeger or a collector
- Traces requests across services via context propagation

## When to Use
- Diagnosing latency across service boundaries
- Building trace-based SLOs
- Migrating to vendor-neutral observability

## Real Commands

```bash
npm install @opentelemetry/sdk-node @opentelemetry/auto-instrumentations-node
node -r @opentelemetry/auto-instrumentations-node/register app.js
docker run -d --name jaeger -p 16686:16686 -p 4317:4317 jaegertracing/all-in-one:latest
```

## Configuration

```bash
export OTEL_SERVICE_NAME=my-api
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
export OTEL_TRACES_SAMPLER=parentbased_traceidratio
export OTEL_TRACES_SAMPLER_ARG=0.1
```

## Testing
- Generate traffic, then query /api/traces?service=my-api
- Confirm parent-child span relationships across services
- Validate collector endpoint health on 4318

## Best Practices
- Start with auto-instrumentation before manual spans
- Propagate W3C traceparent headers at gateways
- Sample 10-25% at high QPS, 100% on canaries

## Capabilities

### otel-instrumentation
Add OpenTelemetry tracing to a Node.js API

**Parameters:**
- `service-name` (string): Name of the traced service in spans
- `exporter-endpoint` (string): OTLP endpoint (gRPC 4317 or HTTP 4318)
- `sample-ratio` (number): Fraction of requests to sample (0-1)

**Commands:**
- `npm install @opentelemetry/sdk-node @opentelemetry/auto-instrumentations-node`
- `node -r @opentelemetry/auto-instrumentations-node/register app.js`
- `curl -s http://localhost:3000/api/users -o /dev/null -w '%{http_code}\n'`
- `npm install otel-cli`
- `otel-cli exec --service my-api --name "GET /api/users" -- curl http://localhost:3000/api/users`

**Examples:**
- node -r @opentelemetry/auto-instrumentations-node/register app.js auto-instruments HTTP and DB calls
- otel-cli exec wraps any command in a trace span
- export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317 routes spans to the collector

### trace-inspection
Query traces from Jaeger after export

**Commands:**
- `docker run -d --name jaeger -p 16686:16686 -p 4317:4317 -p 4318:4318 jaegertracing/all-in-one:latest`
- `curl -s 'http://localhost:16686/api/traces?service=my-api&limit=10' | jq '.data[0].spans | length'`
- `curl -s 'http://localhost:16686/api/services' | jq '.data'`
- `curl -s 'http://localhost:4318/v1/traces' -o /dev/null -w '%{http_code}\n'`

**Examples:**
- -cli --help
- -api --help

## References
- [OpenTelemetry Node.js Docs](https://opentelemetry.io/docs/languages/js/getting-started/nodejs/)
- [Jaeger Getting Started](https://www.jaegertracing.io/docs/latest/getting-started/)

