-
Notifications
You must be signed in to change notification settings - Fork 2
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
[DEVX-814] Added request-id-prefix header to requests for usage monitoring #27
base: main
Are you sure you want to change the base?
Conversation
clarifaipyspark/client.py
Outdated
@@ -23,6 +25,23 @@ def __init__(self, user_id: str, app_id: str, pat: str = None): | |||
self.app = App(user_id=user_id, app_id=app_id, pat=pat) | |||
super().__init__(user_id=user_id, app_id=app_id, pat=pat) | |||
|
|||
@property | |||
def metadata(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure whether this will overwrite the SDK's header prefix, can you please confirm @srikanthbachala20
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would this overwrite SDK's header prefix? This is a separate library right? If not sure, @mansi-k you can check by using local python SDK and change the prefix to differentiate it from current requests and check on Datadog
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then I don't think from this changes, its possible to change the REQUEST_ID_PREFIX
from external library! We should be able to do that to track other frameworks where SDK is used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to the comments above. If we are wrapping over the python-sdk, then python-sdk needs to support this feature during initialization
if pat: | ||
self.metadata = (("authorization", "Key %s" % pat), (REQUEST_ID_PREFIX_HEADER, | ||
REQUEST_ID_PREFIX)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the PAT change? I see it was not there previously.
Also why do we add the prefix-header only when PAT is there? It should be added always?
https://clarifai.atlassian.net/browse/DEVX-814