-
Notifications
You must be signed in to change notification settings - Fork 61
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: track completion request origin #61
Conversation
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.
lgtm!
payload: CompletionPayload, | ||
): | ||
model_path = get_model_path(payload.model) | ||
logger.info( | ||
"Received completion request", extra={"model": str(model_path)} | ||
"Received completion request", | ||
extra={ |
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.
IIRC at opensea we did something that set this context globally for a request so all logs in the call stack used it 🤔 but that's just something in the back of my mind, we can do it later if necessary
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.
Some of this we'd probably get for free if we transition to data dog tracing anyhow so no point worrying about it now I spose
"Received completion request", | ||
extra={ | ||
"model": str(model_path), | ||
"user-agent": request.headers.get("user-agent"), |
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 forget if this key needs to be snake_case for datadog to pick it up
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.
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.
approved aside from sam's potential comment about snake case
Details
Code of Conduct