Hey I want to scrape pyroscope profiler data for some use case but getting authentication errors

Hi, Team for one of my usecase i want to scrape pyroscope profile data. I was going through the documentation , this example code pyroscope/examples/api/query.py at main · grafana/pyroscope · GitHub. I know my pyroscope server. But In my pyroscope ui or grafana.net ui i don’t see any option of generating basic_auth_username and password.

^^ The above option is available from which i can create access token. But using that token and ID as user ID it is giving authorization error.

Failed to query data. Status code: 401, Message: {"status":"error","error":"authentication error: invalid authentication credentials"}

instead of username password basis access

auth=HTTPBasicAuth(basic_auth_username, basic_auth_password)
if i am using a header-based Authorization, it is giving me

Failed to query data. Status code: 401, Message: {“status”:“error”,“error”:“authentication error: legacy auth cannot be upgraded because the host is not found”}

Note that we are not using grafana cloud we use prometheus at backedn to store data and open sourced grafana.

The documentation I also went through could not find anything: