Skip to content

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

@madaraszg-tulip

Description

@madaraszg-tulip

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions