Skip to content
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

http.Request be changed to interface to avoid extra conversion for fasthtttp or hertz. #757

Open
li-jin-gou opened this issue Jan 6, 2024 · 1 comment
Assignees

Comments

@li-jin-gou
Copy link

Summary

Hertz has a lot of users currently using sentry, some of them are sensitive to interface latency, we found that sentry-go only supports setting http.Request but not hertz's Request, and we need an additional conversion.

Motivation

If it can be changed to interface, we can remove this conversion, bringing latency and CPU performance gains.
It may not be an interface, or there may be other options that don't require the conversion of http.Request.

Additional Context

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 2 Jan 6, 2024
@li-jin-gou li-jin-gou changed the title Can http.Request be changed to interface to avoid extra conversion for fasthtttp or hertz. http.Request be changed to interface to avoid extra conversion for fasthtttp or hertz. Jan 6, 2024
@getsantry getsantry bot removed the status in GitHub Issues with 👀 2 Jan 9, 2024
@ribice
Copy link
Collaborator

ribice commented Dec 19, 2024

In essence, this would require us to change Scope.request from *http.Request to sentry.Request as that's what used underneath in the event (we convert *http.Request to sentry.Request to use for event HERE).

This isn't a breaking change because the request isn't exposed.

It would require changes in all integrations that set this request (instead of setting http.Request we'd be setting sentry.Request), but reduce the extra conversion from libraries (including Hertz) that don't use custom requests.

Previously: hertz.Request -> http.Request -> sentry.Request

Afterwards: hertz.Request -> sentry.Request

This would affect fasthttp, fiber and other similar integrations (such as hertz).

Apart from changing the type, changes would need to be made on how request.Body is handled.

@cleptric Let me know if we should do this change or close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

4 participants