esbuild-otel-instrumentation
esbuild ESM bundle で OTel auto-instrumentation が動かない
症状
Hono / Node TypeScript アプリで:
@opentelemetry/sdk-nodeまたは@opentelemetry/sdk-trace-nodeを register@opentelemetry/instrumentation-http/instrumentation-grpc等をregisterInstrumentations()で追加- アプリ起動 / リクエスト処理は正常
- collector に span が一切届かない (no error, no log)
原因
@opentelemetry/instrumentation-* 系は内部で require-in-the-middle を使って CommonJS の require() を hook して target module (node:http 等) に monkey-patch を仕込む。
esbuild で --format=esm bundle すると、bundle 内の import { createServer } from "node:http" は ESM static import に変換され、require() は呼ばれない → hook が発火しない → patch されない → span が作られない。
エラーは出ない (silent failure)。
More from mizchi/skills
empirical-prompt-tuning
Methodology for iteratively improving agent-facing instructions (skills / slash commands / CLAUDE.md / code-gen prompts) via bias-free executor + two-sided evaluation (self-report + instruction-side metrics). Meta-skill, invoke ONLY when the user explicitly asks for an "empirical" eval of a prompt or skill, or for the Iter-0 description / body consistency check. Do NOT auto-invoke after every skill edit; this loop is operator-triggered by name.
59retrospective-codify
Pair "what failed first" with "what finally worked" and codify the should-have-known-it insight as an ast-grep rule, a skill, or a CLAUDE.md rule. Meta-skill: invoke ONLY when the user explicitly says "codify today''s lessons," "make it a skill," "drop it into lint," or asks to extract a reusable rule from a trial-and-error fix. Do NOT auto-invoke at every task completion. Spares future-you (or another agent) the same trap.
16gh-fix-ci
Debug or fix failing GitHub PR checks running in GitHub Actions. Inspects checks/logs via `gh`, drafts a fix plan, and implements only after explicit approval. Out of scope: external CI (e.g. Buildkite) — report only the details URL.
16tech-article-reproducibility
Evaluate the reproducibility of technical articles. Dispatch a subagent to simulate a first-time reader reproducing the work locally and list missing information. Use as the final check on a draft before publication.
14playwright-cli
Use when running Playwright via terminal CLI — `npx playwright test` (test runner), `codegen` (interactive recording), `screenshot` / `pdf` (one-off captures), and CI sharding. NOT for agent-driven real-time browser control (use `claude-in-chrome` MCP tools for that).
13conventional-changelog
Reference for Conventional Commits and automatic CHANGELOG generation. Compares release-please / changesets / git-cliff / towncrier and covers commit format, Keep a Changelog, and semver tag practices. Use when setting up or unifying a release flow.
12