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

[DEVX-814] Added request-id-prefix header to requests for usage monitoring #27

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

Conversation

mansi-k
Copy link
Collaborator

@mansi-k mansi-k commented Nov 8, 2024

@mansi-k mansi-k changed the title Added request-id-prefix header to requests for usage monitoring [DEVX-814] Added request-id-prefix header to requests for usage monitoring Nov 11, 2024
@@ -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):

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

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

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

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

Comment on lines +27 to +29
if pat:
self.metadata = (("authorization", "Key %s" % pat), (REQUEST_ID_PREFIX_HEADER,
REQUEST_ID_PREFIX))

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?

@mansi-k mansi-k requested a review from abhash-ai December 13, 2024 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants