Skip to content

feat: allow custom telemetry for SDKs built on auth0-java - #916

Open
tanya732 wants to merge 2 commits into
masterfrom
fix-telemetry-config
Open

feat: allow custom telemetry for SDKs built on auth0-java#916
tanya732 wants to merge 2 commits into
masterfrom
fix-telemetry-config

Conversation

@tanya732

Copy link
Copy Markdown
Contributor

Description

Summary

Restores the ability for SDKs built on top of auth0-java to identify themselves in the Auth0-Client telemetry header, while still reporting auth0-java as the underlying library.

Adds a withTelemetry(name, version) builder hook to both the Authentication and Management API clients so telemetry is consistent regardless of which API a wrapping SDK calls. Previously, even if the Auth side were addressed, Management API requests remained hardcoded to auth0-java.

Changes

  • Auth API - DefaultHttpClient.Builder.withTelemetry(name, version); applied to the existing TelemetryInterceptor via setTelemetry(...).
  • Management API - ManagementApiBuilder.withTelemetry(name, version), threaded through ClientOptions so the Auth0-Client header honors the custom telemetry when set.
  • When used, requests report the name/version of the wrapper with auth0-java nested under env.auth0-java.

Behavior

// Wrapping SDK
ManagementApi.builder()
    .domain("tenant.auth0.com")
    .token(token)
    .withTelemetry("my-wrapper-sdk", "1.2.3")
    .build();

Decoded Auth0-Client header:

{
  "name": "my-wrapper-sdk",
  "version": "1.2.3",
  "env": {
    "java": "17",
    "auth0-java": "4.2.0"
  }
}

Test Plan

  • ManagementApiTelemetryTest

    • Default name
    • Custom name/version/env
    • Builder chaining
  • AuthAPITest

    • Default telemetry
    • Custom telemetry asserted from the decoded Auth0-Client header
  • ./gradlew test --rerun-tasks passes for the targeted tests.

@tanya732
tanya732 requested a review from a team as a code owner August 14, 2026 12:04
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.

1 participant