-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
ref(core): Switch to standardized log envelope #16133
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
Conversation
|
||
// Clear the log buffer after envelopes have been constructed. | ||
logBuffer.length = 0; | ||
CLIENT_TO_LOG_BUFFER_MAP.set(client, []); |
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.
This was an actual bug fix, because we mutated the reference, it has the possibility to cause weird side effects.
size-limit report 📦
|
timestamp: timestampInSeconds(), | ||
level, | ||
body: message, | ||
trace_id: traceContext?.trace_id, | ||
severity_number: severityNumber ?? SEVERITY_TEXT_TO_SEVERITY_NUMBER[level], |
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.
q: are we doing any kind of validation on level
and severityNumber
if they match? is there some kind of precedence one has over the other?
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.
The passed in severityNumber
takes priority, but there's no validation (so users can technically pass in whatever if they ignore the type check). Relay should handle normalizing all of this though, so we don't need to worry too much about what gets passed in.
* @param logs - The logs to include in the envelope. | ||
* @param metadata - The metadata to include in the envelope. | ||
* @param tunnel - The tunnel to include in the envelope. | ||
* @param dsn - The DSN to include in the envelope. | ||
* @returns The created envelope. | ||
*/ | ||
export function createOtelLogEnvelope( | ||
logs: Array<SerializedOtelLog>, | ||
export function createLogEnvelope( |
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.
l: just to confirm - log envelop headers don't need to contain the trace
header?
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.
yup - more info about this here: https://www.notion.so/sentry/Log-Envelopes-Dynamic-Sampling-1d68b10e4b5d8061a035dc8bc5057196
124f532
to
3d5d500
Compare
To test logs for the alpha we used a standardized
otel_log
envelope item.Now that the logs protocol is more stable, we are switching to the sentry specific envelope item. This is fully documented here: https://develop.sentry.dev/sdk/telemetry/logs/