Skip to content

feat(unity): add telemetry to Unity SDK - #39

Draft
nicklasl wants to merge 6 commits into
mainfrom
nicklasl/add-unity-telemetry
Draft

feat(unity): add telemetry to Unity SDK#39
nicklasl wants to merge 6 commits into
mainfrom
nicklasl/add-unity-telemetry

Conversation

@nicklasl

@nicklasl nicklasl commented Mar 31, 2026

Copy link
Copy Markdown
Member

Summary

  • Add opt-out telemetry for Unity resolve latency and evaluation outcomes
  • Upload JSON directly to the telemetry endpoint, matching confidence-sdk-js
  • Bound the shared buffer at 100 traces and flush on capacity, a jittered 30-second cadence, and application lifecycle events
  • Keep uploads single-flight and best-effort, with bounded exponential retry
  • Use canonical telemetry enum values and structured evaluation results

Test plan

  • Build with warnings as errors
  • Focused Unity telemetry and endpoint tests (17 passed)
  • Unity Editor build (Unity is unavailable locally)

Track resolve latency and evaluation outcomes, sent via
X-CONFIDENCE-TELEMETRY header on resolve requests. Manual
protobuf encoding, all call sites guarded with try/catch.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
// Add the client as a component
ConfidenceApiClient client = clientGO.AddComponent<ConfidenceApiClient>();
client.clientSecret = clientSecret;
client.Telemetry = new Telemetry.Telemetry(Platform.DotNet, client.sdkVersion);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

should be unity?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yes!

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