grafana / pyroscope-rs

Pyroscope Profiler for Rust. Profile your Rust applications.
Apache License 2.0
133 stars 22 forks source link

Add support for authentication token #16

Closed kolesnikovae closed 2 years ago

kolesnikovae commented 2 years ago

Recently we added support for agent authentication to Pyroscope (0.10.0). It would be nice to have support for this in the rust spy package.

The documentation can be found here: https://github.com/pyroscope-io/docs/pull/43 (will be published soon!), the crux is that pyroscope server expects bearer authentication token in the Authorization header. For example:

printf "foo;bar 100\n foo;baz 200" | curl --fail \
-X POST \
-H "Authorization: Bearer ${PYROSCOPE_API_KEY}" \
--data-binary @- \
'http://localhost:4040/ingest?name=curl-test-app&from=1615709120&until=1615709130'

Existing integrations already support specifying an auth token via the configuration: