Skip to content

DX-2925: report sdk name and version via redis telemetry headers - #19

Open
CahidArda wants to merge 1 commit into
mainfrom
DX-2925-telemetry-headers
Open

DX-2925: report sdk name and version via redis telemetry headers#19
CahidArda wants to merge 1 commit into
mainfrom
DX-2925-telemetry-headers

Conversation

@CahidArda

Copy link
Copy Markdown
Collaborator

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.

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.
@linear-code

linear-code Bot commented Aug 14, 2026

Copy link
Copy Markdown

DX-2925

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 addTelemetry helper (WeakMap-deduped per client + sdk tag) and wires it into all Redis-backed primitives/tools (core + adapters).
  • Adds release-time scripts/sync-version.mjs to generate committed version.ts constants, 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.

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