-
Notifications
You must be signed in to change notification settings - Fork 103
feat(spans): Store span attachments #5423
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
| @@ -1,5 +1,6 @@ | |||
| use std::collections::BTreeMap; | |||
|
|
|||
| use itertools::Either; | |||
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.
Either seems to get imported from a couple of different crates, not sure if this is the canonical one.
| project_id: ctx.scoping.project_id.value(), | ||
| trace_id: trace_id.into_value()?.to_string(), | ||
| item_id: attachment_id.into_value()?.into_bytes().to_vec(), | ||
| item_type: 10, // FIXME: use enum from sentry-protos |
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.
Depends on getsentry/sentry-protos#156. Do not merge until it's published.
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.
See getsentry/snuba#7569.
feccbe5 to
02e2506
Compare
| categories=None, | ||
| quantity=None, | ||
| timeout=1, | ||
| timeout=None, |
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.
Drive-by: assert_rate_limited did not use a shorter timeout than the default one so was prone to flake.
| span_id: Option<SpanId>, | ||
| } | ||
|
|
||
| // TODO: remove code-duplication between logs, trace metrics and attachments. |
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.
That's on my todo as well 😢
| } = fields; | ||
|
|
||
| result.insert( | ||
| "sentry.content-type".to_owned(), |
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.
Wonder if it's better to have another namespace for these attributes sentry.attachment.content-type, but maybe just having an EAP item 'attachment' is namespace enough.
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.
Personally l like the un-prefixed version, but I have no strong opinions on this.
relay-server/src/managed/managed.rs
Outdated
| } | ||
|
|
||
| impl<L: Counted, R: Counted> Managed<Either<L, R>> { | ||
| /// Turns a managed option into an optional [`Managed`]. |
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 comment still refers to Option.
|
|
||
| let objectstore_client = Client::builder(objectstore_url).build()?; | ||
| let attachments_usecase = Usecase::new("attachments") | ||
| let event_attachments = Usecase::new("attachments") |
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.
Not sure if this can be changed at this point, but might be clearer to call this "event_attachments"?
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 is code in the sentry monolith that expects "attachments", so I'm afraid we need to keep it: https://github.com/getsentry/sentry/blob/70575b5ffb0266231d0dc48445c70bf285770800/src/sentry/objectstore/__init__.py#L41
relay-server/src/services/upload.rs
Outdated
| match message { | ||
| Upload::Envelope(envelope) => { | ||
| // Event attachments can still go the old route. | ||
| self.inner.store.send(envelope); | ||
| } | ||
| Upload::Attachment(managed) => { | ||
| let _ = managed.reject_err(Error::LoadShed); | ||
| } | ||
| } |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
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.
Yes but this is deliberate (for now).
Upload attachment V2 bodies to objectstore and write a trace item to EAP.
Closes INGEST-614.