Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: client identification headers #103

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kwasniew
Copy link

@kwasniew kwasniew commented Jan 22, 2025

About the changes

This PR adds standardised client identification headers to the feature and metrics calls that the client makes to Unleash. The headers are:

  • x-unleash-appname: the name of the application that is using the client.
  • x-unleash-connection-id: a unique identifier for the current instance of the client generated by the built-in UUID lib
  • x-unleash-sdk: sdk information in the format unleash-client-android:<version>

All the headers are intended for the Unleash team so clients should not be affected.
The main use cases we have are:

  • capacity planning by knowing the number of unique connections made to the backend API
  • debugging misconfigured SDKs sending more traffic than expected

Important files

Discussion points

  • it seems that instanceId is not exposed to users in this SDK so I can re-use it for connection id

@@ -44,8 +44,11 @@ data class UnleashConfig(
"Authorization" to auth,
"Content-Type" to "application/json",
"UNLEASH-APPNAME" to appName,
Copy link
Author

Choose a reason for hiding this comment

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

will be deprecated after expand/contract period

"User-Agent" to appName,
"UNLEASH-INSTANCEID" to instanceId,
"X-UNLEASH-CONNECTION-ID" to instanceId,
"X-UNLEASH-SDK" to "unleash-client-android:development",
Copy link
Author

Choose a reason for hiding this comment

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

we need to find a way to get current version instead of development

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

1 participant