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

refactor(pyroscope.write): Forward content-type header only. #3041

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

simonswine
Copy link
Contributor

We currently forward all incoming headers of the profile /ingest request
to the endpoints defined in pyroscope.write.

I think this is risky. We already had bugs (like #2201) and there probably
a couple more in there already, as I noticed we send on headers like
Content-Length.

I think we should change this and only forward Content-Type, before
anyone starts relying on this, as this is the only header used:

https://github.com/simonswine/pyroscope/blob/b57274a5acbfa867660938ba7e7f5171c3114d68/pkg/ingester/pyroscope/ingest_handler.go#L132

This is still technically a breaking change, but I think it should go
forward, as the stabililty of the component is only "public-preview"
after all.

Fixes #2612

@simonswine simonswine marked this pull request as ready for review March 20, 2025 10:45
@simonswine simonswine requested a review from a team as a code owner March 20, 2025 10:45
@simonswine simonswine requested a review from marcsanmi March 20, 2025 10:45
We currently forward all incoming headers of the profile /ingest request
to the endpoints defined in `pyroscope.write`.

I think this is risky. We already had bugs (like grafana#2201) and there probably
a couple more in there already, as I noticed we send on headers like
`Content-Length`.

I think we should change this and only forward `Content-Type`, before
anyone starts relying on this, as this is the only header used:

https://github.com/simonswine/pyroscope/blob/b57274a5acbfa867660938ba7e7f5171c3114d68/pkg/ingester/pyroscope/ingest_handler.go#L132

This is still technically a breaking change, but I think it should go
forward, as the stabililty of the component is only "public-preview"
after all.

Fixes grafana#2612
@simonswine simonswine force-pushed the 20250320_pyroscope.write-appendingest-do-not-propagate-headers branch from bc65155 to e25bcab Compare March 20, 2025 13:14
@simonswine simonswine added the area/pyroscope Issues/PRs primarly affecting `pyroscope.` components label Mar 26, 2025
@simonswine simonswine marked this pull request as draft March 26, 2025 15:00
@simonswine simonswine marked this pull request as ready for review March 26, 2025 15:00
@simonswine simonswine marked this pull request as draft March 26, 2025 15:01
@simonswine simonswine marked this pull request as ready for review March 26, 2025 15:01
@marcsanmi
Copy link
Contributor

Should we update the CHANGELOG.md?

Copy link
Contributor

@marcsanmi marcsanmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍
I've tested it locally with the go SDK and everything is working.

Copy link
Contributor

@dehaansa dehaansa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a changelog entry, otherwise 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/pyroscope Issues/PRs primarly affecting `pyroscope.` components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pyroscope.receive_http treats headers inconsistently
3 participants