Skip to content

Comments

Configure the default user-agent for Telemetry purposes#9

Merged
mridang merged 3 commits intomainfrom
add-zitadel-user-agent
Apr 16, 2025
Merged

Configure the default user-agent for Telemetry purposes#9
mridang merged 3 commits intomainfrom
add-zitadel-user-agent

Conversation

@mridang
Copy link
Collaborator

@mridang mridang commented Apr 16, 2025

Which Problems Are Solved

  • The SDK did not include a default User-Agent header, limiting tracking of SDK usage.
  • The semantic release configuration did not automatically update the version in the dedicated version file.

How the Problems Are Solved

  • Default User-Agent: Added a default User-Agent in the SDK’s configuration which includes the SDK version, language identifier, language version, operating system, and architecture.

    Python example:

    import platform
    from zitadel_client.version import Version
    
    USER_AGENT = f"zitadel-client/{Version.VERSION} (lang=python; lang_version={platform.python_version()}; os={platform.system()}; arch={platform.machine()})".lower()

    For other languages, use a similar approach that gathers runtime details as needed.

  • Semantic Release Update: Updated the release configuration to bump the version in the version file automatically.

  • API Client Update: Modified the API client to set its HTTP User-Agent header based on the configuration’s user_agent property.

Additional Changes

  • Added tests to verify that the default User-Agent is correctly set and can be updated.
  • Refactored code to remove hardcoded User-Agent values, relying on configuration defaults.
  • Updated documentation and comments for clarity.

Additional Context

None.

@mridang mridang linked an issue Apr 16, 2025 that may be closed by this pull request
@mridang mridang self-assigned this Apr 16, 2025
@mridang mridang added the enhancement New feature or request label Apr 16, 2025
@mridang mridang changed the title Added support for the default user agent which can be used for tracki… Configure the default user-agent for Telemetry purposes Apr 16, 2025
@mridang mridang merged commit a5acc4f into main Apr 16, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement User-Agent Header Tracking in SDKs with Build Integration

1 participant