-
Notifications
You must be signed in to change notification settings - Fork 103
feat(ourlog): Add vercel log drain transform #5209
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
base: master
Are you sure you want to change the base?
Conversation
/// Span identifier for distributed tracing. | ||
#[serde(rename = "spanId")] | ||
pub span_id: Option<String>, | ||
/// Trace identifier for distributed tracing. | ||
#[serde(rename = "trace.id")] | ||
pub trace_dot_id: Option<String>, | ||
/// Span identifier for distributed tracing. | ||
#[serde(rename = "span.id")] | ||
pub span_dot_id: Option<String>, |
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.
You can use serde alias to prevent having multiple fields here.
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.
Unfortunately this can't work because the schema allows traceId
and trace.id
to be sent together, and we still want serialization to work here. Is there a way we can get around that with serde?
add_attribute!(HTTP_RESPONSE_STATUS_CODE, code); | ||
} | ||
|
||
add_optional_attribute!(HTTP_RESPONSE_STATUS_CODE, status_code); |
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.
You're already adding this above, I think we should probably restate this as add_optional_attribute!('vercel.status_code',)
to include information about -1
where it doesn't conflict with our status code conventions
ref https://linear.app/getsentry/issue/LOGS-389/add-vercel-log-drain-endpoint-to-relay
This PR updates the
relay-ourlogs
create to add aVercelLog
struct and avercel_log_to_sentry_log
transform method.vercel_log_to_sentry_log
turns an incomingVercelLog
json payload structure into an instance of Sentry'sOurLog
.I haven't hooked up the
vercel_log_to_sentry_log
function to an endpoint and the rest of the processing pipeline on purpose, I want to take our time to make sure we are all good with the transform taking place.Many of these attributes are new, I've opened a PR in the conventions repo to document them accordingly: getsentry/sentry-conventions#163. See this notion doc for details about the schema and the transform: https://www.notion.so/sentry/Vercel-Log-Drain-2808b10e4b5d808c95f3ebcfe2b8828a. The attribute keys here align in naming as per https://vercel.com/docs/drains/reference/logs.
After this PR merges in, I'll work on exposing this in a new integrations endpoint, gated behind the feature flag introduced in #5208