-
Notifications
You must be signed in to change notification settings - Fork 804
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
chore: adding info to debug whenever headers are being skipped due to cors policy #2061
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2061 +/- ##
=======================================
Coverage 93.07% 93.08%
=======================================
Files 154 154
Lines 5991 5999 +8
Branches 1256 1258 +2
=======================================
+ Hits 5576 5584 +8
Misses 415 415
|
const headers: Partial<Record<string, unknown>> = {}; | ||
api.propagation.inject(api.context.active(), headers); | ||
if (Object.keys(headers).length > 0) { | ||
api.diag.debug('headers inject skipped due to CORS policy'); |
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.
Minor suggestion on the actual error content headers not injected
vs headers inject skipped
And as a general diagnostic error logging (I know we have previously talked about adding a scope using a standard mechanism), but in the mean-time do we want to manually add the scope to make it easier for us and users to understand where this log cam from?
eg. (Using OT-Fetch as an example -- it probably needs a larger general discussion to define a general convention)
api.diag.debug('OT-Fetch: headers not injected due to CORS policy");
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 think this is yet to be decided how the namespace should be constructed but not in this PR, please move the discussion to separate issue. With regards to copy it is how it was suggested in the raised issue.
Which problem is this PR solving?
Short description of the changes
propagateTraceHeaderCorsUrls