#3451·haproxy

Persistent unique instance identifier for service topology correlation

Author: gmanandhar-nrCreated Jul 22, 2026Updated Sep 16, 2026
Labelstype: featurestatus: fixed

Your Feature Request

Hello, I work on observability tooling at New Relic. I'm trying to find a way to automatically correlate application services with the HAProxy instance they communicate through, and I've hit a wall: HAProxy doesn't appear to have a persistent, globally unique instance identifier.

This is another approach from issue#3449 for tackling the same problem

Other infrastructure components solve this with a built-in identity. Kafka has cluster.id , a UUID generated once, stored persistently, returned to clients in protocol metadata, and emitted in metrics. PostgreSQL has system_identifier , generated at initdb, queryable via pg_control_system(). These identifiers let monitoring systems on both sides of a connection share a common value and automatically link the related entities together.

I went through HAProxy's source looking for an equivalent and couldn't find one:

Identifier What it is Why it doesn't work for this
boot_seed 160-bit SHA-1 generated at boot from entropy (time, PID, /dev/urandom, hostname, etc.) Regenerates every restart. Not exposed via any monitoring interface. Used only as internal PRNG seed.
proxy.uuid / iid Sequential integer assigned per-proxy in config order Not globally unique across instances , every HAProxy has iid=2 for its first frontend.
ha_generate_uuid_v4() / v7() Utility functions in src/tools.c Per-call generators (available as uuid() sample fetch). No stored instance-level UUID exists.
global.node Defaults to hostname, overridable via node in config Not guaranteed unique. Multiple instances on the same host share it.

I have two questions:

  1. Did I miss something? Is there an existing value that's persistent across restarts, globally unique, and accessible through stats output?
  2. Would the project consider introducing one? Something like an auto-generated instance UUID that persists across restarts (e.g. written to a state file on first run, or derived deterministically from something stable like config hash + node + first-boot timestamp). It would need to be exposed in stats output (CSV, JSON, promex) and ideally also available for injection into response headers.
  3. Could any of the above fields work with modifications? For example, if boot_seed were made persistent (written to disk and reloaded on restart) and exposed via stats output, would that be a reasonable path? Or if global.node were extended to support auto-generated unique values rather than defaulting to hostname? I'm open to working with what exists if it can be adapted rather than building something entirely new. Or do you think any of the above field could be used as it is as well for this use case?

What are you trying to do?

I'm building automatic relationship detection between application services and HAProxy instances in an observability platform. The end goal: when an app makes an HTTP request that routes through HAProxy, the monitoring system should link them without manual configuration.

For this to work, both sides of the connection need to share some identifier:

[App Service] ---HTTP request---> [HAProxy frontend] ---> [backend]
      |                                   |
      v                                   v
Client-side tracing:               HAProxy metrics:
  "I talked to ??? "                "I am ??? "
               ^                      ^
               |______________________|
               need a shared value here

In Kafka, the client library receives cluster.id from the broker during the initial handshake , so both the client's spans and the broker's metrics carry the same value. Observability tools match on it automatically.

In HAProxy's case, one path would be: HAProxy generates a persistent instance ID, exposes it in metrics, and makes it available as a variable (so operators can inject it into response headers via http-response set-header). Client-side APM agents already capture response headers in their spans , so both sides would then share the value.

This isn't just a New Relic use case. Anyone building service maps , Grafana, Datadog, Dynatrace, or any OpenTelemetry-based platform , faces the same gap. The OTel HAProxy receiver (in opentelemetry-collector-contrib) would also benefit, as it currently has no instance-level identity to emit as a resource attribute.

For this to work end-to-end, several pieces would need to align:

  • HAProxy core: a persistent unique identifier that survives restarts
  • Stats/monitoring output: the identifier exposed as a field in CSV/JSON/promex
  • Sample fetch or variable: so operators can inject it into response headers for client-side capture
  • OTel HAProxy receiver: to emit it as a resource attribute (separate effort, outside this repo)

I understand this is a significant ask. I'm mostly trying to learn whether there's a technical path the project would consider, or whether there's an existing mechanism I've overlooked.

Output of haproxy -vv

plain
HAProxy version 3.3.10-0a72d7f9f 2026/05/11 - https://haproxy.org/
Status: stable branch - will stop receiving fixes around Q1 2027.
Known bugs: http://www.haproxy.org/bugs/bugs-3.3.10.html
Running on: Darwin 24.6.0 Darwin Kernel Version 24.6.0: Wed Oct 15 21:12:05 PDT 2025; root:xnu-11417.140.69.703.14~1/RELEASE_ARM64_T6030 arm64