Closed rchl closed 1 year ago
lets us explore a few possible solutions here so we can be agnostic to content type (in this manner)
That /api/{projectId}/events/{eventId}/attachments/
endpoint is not really documented as part of the public SDK so I would be hesitant to add handler for that. I think it's just an internal endpoint that Sentry uses and they've also used it for rrweb as it's developed by them.
With that in mind, I think a nice way of handling this could be to have an API in sentry-testkit that would allow extending the built-in express routes with custom ones. At least for the "local server" use case.
(I've also inquired about that endpoint on Sentry's Discord but as I'm writing this, I haven't received a reply yet.)
@rchl
to have an API in sentry-testkit that would allow extending the built-in express routes with custom ones.
this might be a good approach for solution. It could be awesome if you check for possible implementation and PR your solution here?
@rchl I see your PR here https://github.com/wix/sentry-testkit/pull/119
is this suites your case or you want maybe to expand it so content-type
could be configurable?
That could be changed if needed when implementing the solution for this issue but I imagine that it wouldn't be needed because someone could just configure body parser specifically for the custom endpoint.
i'm flexible on this :) let me know what you decide and then i'll merge
I'm fine with https://github.com/wix/sentry-testkit/pull/119 being merged right now.
@rchl can this be closed?
This specific use case is not addressed yet.
rrweb is posting attachements to /api/000001/events/*/attachments/
endpoint that does not exist.
I suppose we could just expose the router and let user add arbitrary endpoints though I haven't tried doing that in practice yet.
Stale issue message
Is your feature request related to a problem? Please describe. I'd like to test that a custom integration like rrweb is sending its data on error but those events are not captured and not exposed through sentry-testkit.
rrweb triggers POST requests like
https://sentry.io/api/000001/events/6fd7cc13658e4ade9b7217b748144f41/attachments/?sentry_key=acacaeaccacacacabcaacdacdacadaca&sentry_version=7&sentry_client=rrweb
where the content type is
Content-Type: multipart/form-data; boundary=....
Describe the solution you'd like An API like
testkit.events()
that collects all such events. I'm not sure how would the payload be exposed and whether the content type is something that the integrations gets to choose or it's somewhat standardized in the API.Just to clarify, I'd be using
localServer
for this.