Skip to content

Emergency telemetry routing override (device_id only gate) - #35

Merged
minarc merged 1 commit into
mainfrom
fix/emergency-telemetry-routing-override
Apr 21, 2026
Merged

minarc merged 1 commit into
mainfrom
fix/emergency-telemetry-routing-override

Conversation

@minarc

@minarc minarc commented Apr 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • VS Code extension activation issues JWTs with `telemetry_endpoint=http://meter-{subdomain}.skillbench.com:4318\` — that's an OTel collector at `/v1/logs` (OTLP), not the `/logs/claude*` paths this plugin uses. Net result: every Claude Code plugin telemetry POST 404'd in prod.
  • Per emergency ask: telemetry must flow whenever a `device_id` exists, no manual activation required.

What changes

`logger.js` only:

  1. Hardcode base URL to `https://api-meter-andela.skillbench.com\`. JWT `telemetry_endpoint` claim is ignored. Verified with curl using the real plugin schema + gzip ndjson:
    • `POST /logs/claude` → HTTP 202 Accepted
    • `POST /logs/claude/transcript` → HTTP 202 Accepted
  2. Drop the license-token gate in `runHook`. Only `device_id` is required. Once present, telemetry sends unconditionally.
  3. Keep `Authorization` header conditional — if a license token happens to exist in credstore (already-activated users), it's still sent. No new auth logic, no silent activation, no prompts.

What does NOT change

  • Telemetry opt-in/out (`/sk-telemetry`) is unchanged.
  • Repo-scope filtering (`skillmeter.repoScope`) is unchanged.
  • Sanitization, retry-on-failure, gzip — all unchanged.

Test plan

  • `node -c logger.js` — syntax clean
  • curl POST /logs/claude with real plugin NDJSON → 202
  • curl POST /logs/claude/transcript → 202
  • Post-merge smoke: trigger a hook with no license in credstore, verify event log file lands in storage

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Updated logging service endpoint for improved connectivity.
    • System now proceeds with data transfers and hook execution without requiring a license token.

Context
- VS Code extension activation issues JWTs with
  telemetry_endpoint=http://meter-{subdomain}.skillbench.com:4318 —
  an OTel collector at /v1/logs (OTLP), not the /logs/claude* paths
  this plugin uses.
- Net result: every Claude Code plugin telemetry POST 404'd in prod.
- Per emergency ask: telemetry must flow whenever a device_id exists,
  no manual activation required.

Change (logger.js only)
- Hardcode base to https://api-meter-andela.skillbench.com. JWT
  telemetry_endpoint claim is ignored. Verified with curl:
  /logs/claude and /logs/claude/transcript with real plugin schema +
  gzip ndjson both return HTTP 202 Accepted.
- Drop the license-token gate in runHook. Only device_id is required
  now — once present, telemetry sends unconditionally.
- Keep Authorization header conditional on a pre-existing license
  token (already-activated users stay fully authed). No new auth
  logic, no silent activation.

Tested
- curl POST /logs/claude with real plugin schema → 202
- curl POST /logs/claude/transcript → 202
- node -c logger.js passes

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Apr 21, 2026 •

Copy link
Copy Markdown
Contributor

Caution

Review failed

Pull request was closed or merged during review

Walkthrough

The logger module's endpoint configuration is updated to a hardcoded URL and its token-handling logic is simplified. The license token is no longer required for transfers and hooks to proceed; the Authorization header is now conditionally applied based on token availability rather than blocking operations when absent.

Changes

Cohort / File(s) Summary
Logger endpoint and token handling
skillmeter/scripts/logger.js
Updated DEFAULT_ENDPOINT URL to api-meter-andela; simplified getEndpointFromToken() to always return the hardcoded endpoint without decoding JWT; removed early-return guards from transfer operations and license token preconditions from hook execution, allowing operations to proceed without authentication but conditionally attaching the Authorization header when token is available.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A logger hops along with lighter feet,
No token walls to make the journey sweet,
One endpoint shines, so steadfast and true,
Headers dance when credentials flow through!
✨ hop hop

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Emergency telemetry routing override (device_id only gate)' directly and specifically describes the main change: hardcoding the telemetry endpoint URL and removing the license token requirement, with device_id as the gate for telemetry transmission.
Docstring Coverage ✅ Passed Docstring coverage is 83.33% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/emergency-telemetry-routing-override

Comment @coderabbitai help to get the list of available commands and usage tips.

@minarc
minarc requested a review from jhunlee-dev April 21, 2026 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants