Skip to content

fix: Improve usage reporting#1108

Open
jsonbailey wants to merge 4 commits intomainfrom
jb/aic-1636/improve-reporting
Open

fix: Improve usage reporting#1108
jsonbailey wants to merge 4 commits intomainfrom
jb/aic-1636/improve-reporting

Conversation

@jsonbailey
Copy link
Contributor

@jsonbailey jsonbailey commented Feb 18, 2026

Note

Medium Risk
Changes the analytics/telemetry event names and payload schemas, which can break downstream dashboards or ingestion if consumers still expect the old keys. Functional AI behavior is otherwise unchanged.

Overview
Standardizes AI SDK usage reporting by renaming the track event keys emitted from LDAIClientImpl for config evaluation and object creation (completion/agent/judge, batch agent configs, createChat, createJudge) to the new $ld:ai:usage:* namespace.

Adds constructor-time tracking of SDK identity via a new $ld:ai:sdk-info event sent under an internal anonymous context, including aiSdkName, aiSdkVersion, and new aiSdkLanguage.

Simplifies per-operation tracking payloads by removing aiSdkName/aiSdkVersion from LDAIConfigTrackerImpl.getTrackData() and its interface, with tests updated accordingly.

Written by Cursor Bugbot for commit ef82f52. This will update automatically on new commits. Configure here.

@github-actions
Copy link
Contributor

@launchdarkly/js-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 25394 bytes
Compressed size limit: 26000
Uncompressed size: 124693 bytes

@github-actions
Copy link
Contributor

github-actions bot commented Feb 18, 2026

@launchdarkly/browser size report
This is the brotli compressed size of the ESM build.
Compressed size: 171261 bytes
Compressed size limit: 200000
Uncompressed size: 798175 bytes

@github-actions
Copy link
Contributor

@launchdarkly/js-client-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 19331 bytes
Compressed size limit: 20000
Uncompressed size: 99578 bytes

@github-actions
Copy link
Contributor

github-actions bot commented Feb 18, 2026

@launchdarkly/js-client-sdk size report
This is the brotli compressed size of the ESM build.
Compressed size: 23336 bytes
Compressed size limit: 25000
Uncompressed size: 81070 bytes

@jsonbailey jsonbailey marked this pull request as ready for review February 19, 2026 21:59
@jsonbailey jsonbailey requested a review from a team as a code owner February 19, 2026 21:59
Copy link
Contributor

@joker23 joker23 left a comment

Choose a reason for hiding this comment

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

LGTM

expect(mockLdClient.track).toHaveBeenNthCalledWith(
1,
'$ld:ai:sdk-info',
{ kind: 'user', key: 'ld-internal-tracking', anonymous: true },
Copy link
Member

Choose a reason for hiding this comment

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

This is interesting. I feel like we probably shouldn't use 'user'? I feel like we should probably use something more esoteric. It is also interesting to be using a context, but anonymous should handle most concerns.

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.

3 participants

Comments