Skip to content

Error with Alloy forwarding: pushing IngestInput-pprof failed invalid_argument: profile with labels ... has duplicate label name: 'service_name' #144

Open
@cbismuth

Description

@cbismuth

From Go code, when pushing directly to Pyroscope, everything is fine, when pushing to Alloy for Pyroscope forwarding, we have this error below:

Logs:

pyroscope   | ts=2025-03-14T14:33:26.586451063Z caller=ingest_handler.go:56 level=error msg="pyroscope ingest" err="pushing IngestInput-pprof failed invalid_argument: profile with labels '{__delta__=\"false\", __name__=\"process_cpu\", pyroscope_spy=\"gospy\", service_name=\"etf1.dice\", service_name=\"etf1.dice\"}' has duplicate label name: 'service_name'" orgID=anonymous
alloy       | ts=2025-03-14T14:33:26.587831766Z level=error msg="Failed to append profile" component_path=/ component_id=pyroscope.receive_http.default appendable=0 err="pyroscope write error: status 422"

Go code:

_, err := pyroscope.Start(pyroscope.Config{
	ApplicationName: ApplicationName,
	ServerAddress:   os.Getenv("PYROSCOPE_ENDPOINT"),
	ProfileTypes: []pyroscope.ProfileType{
		pyroscope.ProfileCPU,
		pyroscope.ProfileInuseObjects,
		pyroscope.ProfileAllocObjects,
		pyroscope.ProfileInuseSpace,
		pyroscope.ProfileAllocSpace,
		pyroscope.ProfileGoroutines,
		pyroscope.ProfileMutexCount,
		pyroscope.ProfileMutexDuration,
		pyroscope.ProfileBlockCount,
		pyroscope.ProfileBlockDuration,
	},
	Logger: pyroscope.StandardLogger,
})
if err != nil {
	fmt.Println(fmt.Errorf("failed to setup pyroscope: %w", err).Error())
	return
}

config.alloy:

pyroscope.receive_http "default" {
   http {
       listen_address = "0.0.0.0"
       listen_port = 9999
   }
   forward_to = [pyroscope.write.backend.receiver]
}

pyroscope.write "backend" {
    endpoint {
        url = "http://pyroscope:4100"
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions