Skip to content

feat: Support SDK metrics #136

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

feat: Support SDK metrics #136

wants to merge 3 commits into from

Conversation

khvn26
Copy link
Member

@khvn26 khvn26 commented Jul 10, 2025

Closes #130.

  • Adds custom User-Agent header value to include the SDK name and version
  • Adds support for optional client application metadata when initialising the Flagsmith client

@khvn26 khvn26 self-assigned this Jul 10, 2025
@github-actions github-actions bot added feature and removed feature labels Jul 10, 2025
@matthewelwell matthewelwell self-requested a review July 11, 2025 08:54
Copy link
Contributor

@emyller emyller left a comment

Choose a reason for hiding this comment

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

LGTM with non-blocking comments.


# Then
headers = responses.calls[0].request.headers
assert headers == {**default_headers, **expected_headers}
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: For readability, I'd move default_headers to here instead of a fixture — unless we're going to reuse/customize it.


__all__ = ("Flagsmith", "webhooks")
__all__ = ("Flagsmith", "webhooks", "__version__")
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe __all__ should be a list.

Comment on lines +724 to +725
return {
"User-Agent": f"flagsmith-python-client/{__version__} python-requests/2.32.4",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
return {
"User-Agent": f"flagsmith-python-client/{__version__} python-requests/2.32.4",
requests_version = version("requests")
return {
"User-Agent": f"flagsmith-python-client/{__version__} python-requests/{requests_version}",

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

Successfully merging this pull request may close these issues.

Support SDK metrics
3 participants