DX-2925: report sdk name and version via redis telemetry headers - #19
Open
CahidArda wants to merge 1 commit into
Open
DX-2925: report sdk name and version via redis telemetry headers#19CahidArda wants to merge 1 commit into
CahidArda wants to merge 1 commit into
Conversation
Every feature that takes a redis client now appends its package tag to the client's Upstash-Telemetry-Sdk header, matching @upstash/ratelimit. Opt out with `enableTelemetry: false` on any config, on the redis client itself, or with the UPSTASH_DISABLE_TELEMETRY env var. The per-package VERSION constants are stamped by scripts/sync-version.mjs, run from `ci:version` at release time only — never from build/dev, which must not rewrite tracked source. CI verifies them with the script's read-only --check.
There was a problem hiding this comment.
Pull request overview
This PR adds first-class telemetry tagging across AgentKit packages so that any feature using an Upstash Redis client appends the package name+version to the client’s Upstash-Telemetry-Sdk header (mirroring @upstash/ratelimit), with opt-out via enableTelemetry: false, the redis client setting, or UPSTASH_DISABLE_TELEMETRY. It also introduces a release-time script to stamp per-package VERSION constants and a CI check to ensure those constants stay in sync.
Changes:
- Introduces a core
addTelemetryhelper (WeakMap-deduped per client + sdk tag) and wires it into all Redis-backed primitives/tools (core + adapters). - Adds release-time
scripts/sync-version.mjsto generate committedversion.tsconstants, plus CI verification via--check. - Updates docs and adds wire-level tests to validate the outgoing telemetry header behavior.
Reviewed changes
Copilot reviewed 41 out of 41 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/sync-version.mjs | Adds release-time script to stamp per-package VERSION constants (plus --check mode for CI). |
| README.md | Documents telemetry behavior and the ci:version stamping behavior. |
| packages/sdk/src/version.ts | Adds generated core package VERSION constant used in telemetry tags. |
| packages/sdk/src/tool-cache.ts | Wires telemetry tagging into ToolCache construction and adds enableTelemetry config. |
| packages/sdk/src/telemetry.ts | Implements core telemetry tagging (SDK_TELEMETRY, addTelemetry, per-client+sdk dedup). |
| packages/sdk/src/telemetry.test.ts | Adds unit + wire-level tests verifying tags are appended and opt-out works. |
| packages/sdk/src/search-tools.ts | Tags redis client for search tools and threads enableTelemetry into ReactiveSearchIndex. |
| packages/sdk/src/reactive-index.ts | Tags redis client in ReactiveSearchIndex and adds enableTelemetry option. |
| packages/sdk/src/rate-limit.ts | Tags redis client when constructing rate limiter and adds enableTelemetry option. |
| packages/sdk/src/memory.ts | Tags redis client for AgentMemory and threads enableTelemetry into the reactive index. |
| packages/sdk/src/index.ts | Re-exports telemetry helpers and VERSION from the core package surface. |
| packages/sdk/src/chat-history.ts | Tags redis client for ChatHistory and threads enableTelemetry into the reactive index. |
| packages/sdk/README.md | Documents telemetry behavior and opt-out for the core SDK. |
| packages/eve/src/version.ts | Adds generated VERSION constant for the eve adapter package. |
| packages/eve/src/tools.ts | Tags redis client for cached-tool helper and threads enableTelemetry into ToolCache. |
| packages/eve/src/telemetry.ts | Adds eve adapter telemetry tag and wrapper helper. |
| packages/eve/src/telemetry.test.ts | Adds wire-level tests verifying both adapter + core tags appear and opt-out works. |
| packages/eve/src/search-tools.ts | Tags redis client for eve search tools (adapter tag) before creating core defs. |
| packages/eve/src/sandbox.ts | Tags the template-registry redis client used by the sandbox backend. |
| packages/eve/src/memory.ts | Tags redis client for eve memory tools and threads enableTelemetry into core AgentMemory. |
| packages/eve/src/auth.ts | Tags redis client for rate-limit auth helper (adapter tag) prior to building core limiter. |
| packages/eve/README.md | Documents telemetry behavior and opt-out for the eve adapter package. |
| packages/eve-extension/tsconfig.json | Includes test/**/*.ts for extension package typechecking. |
| packages/eve-extension/test/telemetry.test.ts | Adds wire-level tests validating extension + core tags on outgoing requests. |
| packages/eve-extension/README.md | Documents telemetry behavior and opt-out for the eve extension package. |
| packages/eve-extension/extension/lib/version.ts | Adds generated VERSION constant for the extension package. |
| packages/eve-extension/extension/lib/runtime.ts | Tags the lazily-created extension redis client with the extension’s telemetry tag. |
| packages/eve-extension/extension/extension.ts | Adds enableTelemetry to mount config schema for extension-wide opt-out. |
| packages/ai-sdk/src/version.ts | Adds generated VERSION constant for the AI SDK adapter package. |
| packages/ai-sdk/src/tools.ts | Tags redis client for cachedTools and threads enableTelemetry into core ToolCache. |
| packages/ai-sdk/src/telemetry.ts | Adds AI SDK adapter telemetry tag and wrapper helper. |
| packages/ai-sdk/src/telemetry.test.ts | Adds unit + wire-level tests verifying adapter + core tags and opt-out behavior. |
| packages/ai-sdk/src/search-tools.ts | Tags redis client (adapter tag) before creating core search tool defs. |
| packages/ai-sdk/src/memory.ts | Tags redis client for memory tools and threads enableTelemetry into core AgentMemory. |
| packages/ai-sdk/src/chat-history.ts | Tags redis client for chat history helper (adapter tag) before constructing core ChatHistory. |
| packages/ai-sdk/README.md | Documents telemetry behavior and opt-out for the AI SDK adapter package. |
| package.json | Updates ci:version to run version stamping after changeset version. |
| eslint.config.js | Adds Node globals for scripts/**/*.mjs. |
| CLAUDE.md | Updates repository guide with telemetry + version-constant workflow documentation. |
| .github/workflows/ci.yml | Adds CI step to verify stamped VERSION constants are up-to-date. |
| .changeset/olive-donuts-shave.md | Adds changeset entries documenting telemetry feature across packages. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every feature that takes a redis client now appends its package tag to the client's Upstash-Telemetry-Sdk header, matching @upstash/ratelimit. Opt out with
enableTelemetry: falseon any config, on the redis client itself, or with the UPSTASH_DISABLE_TELEMETRY env var.The per-package VERSION constants are stamped by scripts/sync-version.mjs, run from
ci:versionat release time only — never from build/dev, which must not rewrite tracked source. CI verifies them with the script's read-only --check.