Skip to content

User identifier resource attr#113

Merged
crekhari merged 9 commits intomainfrom
user-identifier-resource-attr
Jul 16, 2025
Merged

User identifier resource attr#113
crekhari merged 9 commits intomainfrom
user-identifier-resource-attr

Conversation

@crekhari
Copy link
Contributor

@crekhari crekhari commented Jul 15, 2025

This PR adds jwt as a resource attr for the quollector to authenticate.

@crekhari crekhari force-pushed the user-identifier-resource-attr branch from 62d59f6 to 5dcf3d5 Compare July 16, 2025 13:15
self.token = None
self.token_expiry = 0
self.token_api_key = None
self.user_id = None
Copy link
Member

Choose a reason for hiding this comment

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

I suggest calling this self.__user

resource_attributes = {
QuotientAttributes.app_name: app_name,
QuotientAttributes.environment: environment,
"quotient.user_id": self._get_user_id(),
Copy link
Member

Choose a reason for hiding this comment

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

Let's add this to QuotientAttributes as quotient.user

@@ -1,3 +1,5 @@
TRACER_NAME = "quotient.sdk.python"
DEFAULT_TRACING_ENDPOINT = "https://otel.quotientai.co/v1/traces"
# DEFAULT_TRACING_ENDPOINT = "http://localhost:4318/v1/traces"
Copy link
Member

Choose a reason for hiding this comment

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

Cruft?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I lowkey wanted to keep it in here just for dev purposes. Ill remove it along w/ the other fixes

Copy link
Member

Choose a reason for hiding this comment

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

If you want to do that you could make this an env var.

Suggested change
# DEFAULT_TRACING_ENDPOINT = "http://localhost:4318/v1/traces"
OTLP_TRACING_ENDPOINT = os.environ.get(“OTLP_TRACING_ENDPOINT”, “https://otel.quotientai.co/v1/traces”)

crekhari and others added 3 commits July 16, 2025 10:34
Co-authored-by: Freddie Vargus <freddie@quotientai.co>
@crekhari crekhari requested a review from freddiev4 July 16, 2025 14:42
resource_attributes = {
QuotientAttributes.app_name: app_name,
QuotientAttributes.environment: environment,
"quotient.user": self._get_user(),
Copy link
Member

Choose a reason for hiding this comment

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

Can we make this QuotientAttributes.user?

Otherwise LGTM

@crekhari crekhari merged commit 248edae into main Jul 16, 2025
2 checks passed
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