Otel instrumentation

From makifbaysal/tasktrooper · View interactive version

Otel instrumentation is an AI agent skill from the GitHub repository makifbaysal/tasktrooper. Use when an "enable observability" card asks for metrics, traces or logs - what the developer task must add per language (Go, Node/TS, Python, Java/Kotlin, .NET, Ruby, PHP), the zero-code agents, the OTEL_* environment variables and resource attributes, and how to reach GCP, AWS, Vercel or a plain O

How to use this skill

Skill file

OpenTelemetry instrumentation

You never write this code yourself. This skill is what you put into the developer's task: exact packages, where the SDK starts, the environment it reads, and acceptance criteria that can be observed in the target environment.

Always the same

Every service gets the same identity, set through the environment rather than in code:

| Variable | Value |

|---|---|

| OTEL_SERVICE_NAME | the component's name, stable across deploys (checkout-api) |

| OTEL_RESOURCE_ATTRIBUTES | service.version=<release tag or commit>,deployment.environment.name=<production|staging> — also set the older deployment.environment key while the backend's dashboards still read it |

| OTEL_EXPORTER_OTLP_ENDPOINT | the collector or backend base URL (http://otel-collector:4318) |

| OTEL_EXPORTER_OTLP_PROTOCOL | http/protobuf (default for most SDKs) or grpc (port 4317) |

| OTEL_EXPORTER_OTLP_HEADERS | auth for a hosted endpoint (authorization=Bearer …) — a secret, declared with declare_env_vars, never committed |

| OTEL_TRACES_SAMPLER / _ARG | parentbased_traceidratio / 0.1 for a busy production service; parentbased_always_on otherwise |

| OTEL_METRICS_EXPORTER, OTEL_LOGS_EXPORTER | otlp (or none when the platform already ships stdout logs) |

service.version is what lets a deploy-impact read tell the release apart; leaving it out makes every release look the same.

Per language

Prefer the zero-code route wherever it exists: it is one image or start-command change the developer can verify, instead of edits through the codebase.

Where it goes

Acceptance criteria that can be checked

Never "the SDK is installed" or "it compiles" — those pass without one span arriving.

After it ships

list_data_source_metrics shows whether the new metric names (http_server_request_duration_seconds_* in Prometheus naming) are there, and propose_signal_binding binds the golden signals to them. No data source reads the target yet: say so on the card — a person adds it under Operations → Data sources.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.