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

Pyroscope: allowed service_name incosistent between pyroscope.scrape and pyroscope.receive_http #2158

Closed
madaraszg-tulip opened this issue Nov 26, 2024 · 0 comments · Fixed by #2172
Assignees
Labels
bug Something isn't working frozen-due-to-age

Comments

@madaraszg-tulip
Copy link
Contributor

What's wrong?

We are scraping our Go services using pyroscope.scrape, which by default sets service_name to namespace/container that it gets from the kubernetes cluster.

I am now configuring TypeScript services in push mode, using the pyroscope.receive_http component in alloy. To make things consistent, I wanted to configure it so the service_name structure is the same. However pyroscope.receive_http refuses these profiles:

ts=2024-11-26T12:12:35.154260341Z level=error msg="Failed to append profile" component_path=/ component_id=pyroscope.receive_http.local appendable=0 err="invalid application name: default/partitionmanager: character is not allowed: '/'"

If '/' is valid in the service_name label (and I assume it is, because the Grafana Pyroscope app uses it for navigating in the service dropdown), then it should also be allowed by the pyroscope.receive_http function.

Steps to reproduce

In a nodejs application

Pyroscope.init({
  serverAddress: "http://alloy:8080/",
  appName: "namespace/app",
})
Pyroscope.Start()

Observe alloy logs.

System information

Linux / Kubernetes

Software version

Grafana Alloy v1.5.0

Configuration

pyroscope.receive_http "local" {
  http {
    listen_port = 8080
  }

  forward_to = [pyroscope.write.global.receiver]
}

pyroscope.write "global" {
  endpoint {
    url = "https://pyroscope.global"
  }
}

Logs

ts=2024-11-26T12:12:35.151502401Z level=error msg="Failed to append profile" component_path=/ component_id=pyroscope.receive_http.local appendable=0 err="invalid application name: default/partitionmanager: character is not allowed: '/'" 
ts=2024-11-26T12:12:35.151586002Z level=error msg="Failed to process request" component_path=/ component_id=pyroscope.receive_http.local err="invalid application name: default/partitionmanager: character is not allowed: '/'"             
ts=2024-11-26T12:12:35.151644303Z level=warn msg="POST /ingest from=1732623095&name=default%2Fpartitionmanager%7Bpod%3Dpartitionmanager-6b4d678795- f95dn%2Crelease%3Dpartitionmanager%2Cversion%3D82fe92f52%2Cnamespace%3Ddefault%2Capp%3Dpar
titionmanager%7D&spyName=nodespy&until=1732623155 (500) 332.005µs Response: \"Failed to process request\\n\" ws: false; Accept: application/json, text/plain, */*; Connection: close; Content-Type: multipart/form-data; boundary=---------- 
----------------826266161521396991153408; User-Agent: axios/0.28.1; " component_path=/ component_id=pyroscope.receive_http.local
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working frozen-due-to-age
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants