Merged
Conversation
- Rename usage tracking event keys to $ld:ai:usage:* prefix - $ld:ai:config:function:single -> $ld:ai:usage:completion-config - $ld:ai:judge:function:single -> $ld:ai:usage:judge-config - Add SDK info tracking on AIClient construction ($ld:ai:sdk:info) with anonymous ld_ai context and SDK metadata - Rename Config method to CompletionConfig; keep Config as deprecated proxy - Update usage tracking data format to use object with configKey field - Update tests for new event keys, data format, and SDK info event Co-Authored-By: unknown <>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
jsonbailey
commented
Feb 26, 2026
Co-Authored-By: unknown <>
jsonbailey
commented
Feb 26, 2026
Co-Authored-By: unknown <>
Co-Authored-By: unknown <>
jsonbailey
commented
Feb 26, 2026
Co-Authored-By: unknown <>
keelerm84
approved these changes
Feb 26, 2026
Co-Authored-By: unknown <>
jsonbailey
pushed a commit
that referenced
this pull request
Feb 26, 2026
🤖 I have created a release *beep* *boop* --- ## [0.8.1](ldai/v0.8.0...ldai/v0.8.1) (2026-02-26) ### Bug Fixes * Improve usage reporting ([#353](#353)) ([0146f76](0146f76)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
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.
Requirements
Related issues
Describe the solution you've provided
Updates the Go AI SDK's usage tracking to align with the updated spec. Four categories of changes:
Renamed usage tracking event keys to the unified
$ld:ai:usage:*prefix:$ld:ai:config:function:single$ld:ai:usage:completion-config$ld:ai:judge:function:single$ld:ai:usage:judge-configAdded SDK info tracking on construction (
$ld:ai:sdk:info).NewClientnow fires a one-time tracking event withaiSdkName,aiSdkVersion, andaiSdkLanguage, using an anonymous context (kindld_ai, keyld-internal-tracking). SDK metadata constants (SDKName,SDKLanguage) are defined inpackage_info.goalongsideVersion.Renamed
Configmethod toCompletionConfig. The oldConfigmethod is preserved as a deprecated proxy toCompletionConfig.Changed usage tracking data format from a plain string to an object containing
configKey, consistent with the other SDK implementations.Note: This SDK does not currently have agent config, createChat, or createJudge methods, so only the
completion-configandjudge-configusage event keys needed updating.Human review checklist
$ld:ai:sdk:info,$ld:ai:usage:completion-config,$ld:ai:usage:judge-config)ld_ai, keyld-internal-tracking) matches spec requirement 1.2.2.1"launchdarkly-go-server-sdk-ai"is correct for this package (now inpackage_info.go)Clientinstantiation (rather than once globally) aligns with spec intentConfigmethod delegates toCompletionConfig, so it will also emit the$ld:ai:usage:completion-configtracking event — confirm this is desired behaviorSDKNameandSDKLanguageas public constants is acceptable for the package API surfaceUpdates since last revision
Addressed reviewer feedback:
NewClientCompletionConfigandJudgeConfigdoc comments with clearer descriptionspackage_info.goas exported constants (SDKName,SDKLanguage)Additional context
Windows, Go 1.24failure is a pre-existing flaky test inldfilewatch(unrelated to these changes); allldaichecks passon all platforms
Note
Medium Risk
Medium risk because it changes analytics/telemetry semantics (new event keys/payloads and a new constructor-time metric) and introduces a new public API (
CompletionConfig) while deprecatingConfig, which may affect downstream expectations around tracking and call patterns.Overview
Updates the Go AI SDK’s metric reporting to match the latest spec by renaming usage event keys to the
$ld:ai:usage:*namespace and changing the metricdatapayload from a raw string to an object containingconfigKey.NewClientnow emits a one-time$ld:ai:sdk:infometric on construction using an anonymousld_aicontext and SDK metadata (SDKName,SDKLanguage,Version).Renames
Client.Configusage toCompletionConfig(withConfigkept as a deprecated delegating wrapper) and updatesJudgeConfigtracking to the new judge usage event; tests are updated/added to assert the new events and payloads.Written by Cursor Bugbot for commit 5d2ca43. This will update automatically on new commits. Configure here.