Skip to content

Set Content-Type to application/octet-stream for pprof format#37

Open
ishizakiyu wants to merge 1 commit into
felixge:masterfrom
ishizakiyu:master
Open

Set Content-Type to application/octet-stream for pprof format#37
ishizakiyu wants to merge 1 commit into
felixge:masterfrom
ishizakiyu:master

Conversation

@ishizakiyu

Copy link
Copy Markdown

Hi, thanks for creating this great tool!

Problem

When fgprof is scraped by Grafana Alloy with profiling enabled,
Alloy checks the Content-Type header and expects it to start with application/octet-stream.
Since grafana/alloy#4190, responses with a different header are rejected with:

err="invalid profile data: unexpected Content-Type application/x-gzip, expected application/octet-stream for pprof data"

The Go standard library’s net/http/pprof and pyroscope-go both set:

w.Header().Set("Content-Type", "application/octet-stream")

Change

Set Content-Type to application/octet-stream when "format" is "pprof" (default), matching the behavior of net/http/pprof.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant