- Clone the repo and
cdinto the plugin directory:git clone https://github.com/alibaba/loongsuite-js-plugins.git cd loongsuite-js-plugins/opentelemetry-instrumentation-claude - Install dependencies:
npm install
- Link globally for testing:
npm link
- Verify the setup:
CLAUDE_TELEMETRY_DEBUG=1 otel-claude-hook check-env
Set OTEL_CLAUDE_DEBUG=1 to enable verbose logging from intercept.js:
OTEL_CLAUDE_DEBUG=1 NODE_OPTIONS="--require ./src/intercept.js" node -e "console.log('test')"# Simulate UserPromptSubmit
echo '{"session_id":"test-123","prompt":"hello"}' | otel-claude-hook user-prompt-submit
# Simulate Stop (exports trace)
echo '{"session_id":"test-123","stop_reason":"end_turn"}' | CLAUDE_TELEMETRY_DEBUG=1 otel-claude-hook stop- Fork the repo and create a feature branch from
main - Follow Conventional Commits:
feat:,fix:,docs:,chore:,refactor: - Ensure changes don't break existing hook command behavior
- Open a MR/PR with a clear description of the change and motivation
Please include:
- OS and shell (e.g. macOS 14 / bash 5.x)
- Node.js version (
node --version) - Claude Code version (
claude --version) - Full error output with
OTEL_CLAUDE_DEBUG=1enabled