HAProxy Exporter Metrics: Verify the Stats Path
Learn how to verify HAProxy exporter metrics, distinguish real exporters from port-scan noise, and secure the stats and Prometheus paths.

Before You Trust HAProxy Metrics, Trace the Stats Path
A Prometheus metric endpoint can look like proof that an HAProxy exporter is running. It isn't. A port number, a search result, or even a matching response body is only a clue until you confirm what's answering, where its data comes from, and which systems can reach it.
That distinction matters for monitoring and security. A port scan can turn up unrelated services on a port that happens to be used by an exporter. A real exporter can also look healthy at its own listener while still failing to read HAProxy statistics. And if either the exporter or the HAProxy stats interface is exposed to the wrong audience, you may leak operational details you didn't mean to publish.
This article walks through how to interpret a scan, trace the path from HAProxy to Prometheus, verify likely exporters, and secure the two connections independently. The point isn't to turn scan counts into an inventory. The point is to confirm the monitoring path works - and that access is limited to the systems that need it.
Why port 9101 is not an exporter inventory
Port 9101 is a common default for the HAProxy Prometheus exporter. Defaults help when you're configuring a service. They're weak evidence when you're searching a network. Other applications, test services, and devices can use the same port. A port match just means something might be listening there - it doesn't tell you what that process is or what's in its response.
On November 5, 2026, a scan using sub_type=all returned:
| Query | Matches | UTC time |
|---|---|---|
port="9101" |
1,410,440 | 2026-11-05T00:40:53Z |
app="haproxy_exporter" |
0 | 2026-11-05T00:40:55Z |
http.body="haproxy_exporter_build_info" |
2 | 2026-11-05T00:40:56Z |
Those numbers don't add up to a credible "inventory" of HAProxy exporters. The "no fingerprint matches" result doesn't prove there are zero - fingerprints miss services when responses differ or when the scan has limitations. The two build-information matches are more specific, but they're still guesses until someone checks the live endpoint and confirms the process behind it.
Use evidence in layers
Think of discovery as a set of checks that get more useful as you go:
- Port match: Something on a host seems to accept connections on that port. It's a lead, not an attribution.
- HTTP response: The endpoint returns content you can inspect. That narrows the field, but generic (or misleading) responses still happen.
- Exporter metrics: The response includes the metric names you expect (including build information when the exporter provides it). This is stronger evidence, but it still doesn't tell you which host process produced it - or whether HAProxy scraping actually works.
- Host and monitoring verification: The deployed process, the service unit, the HAProxy scrape configuration, and the Prometheus target all line up. That's the level you need for an operational inventory.
Don't compute a "risk percentage" by dividing the two body matches by the 1,410,440 port matches. Those counts come from different matching conditions and don't represent a shared, verified set. Use scan results to decide what to investigate, then rely on your owned inventory and live checks to confirm what's really there.
How HAProxy exporter data travels
The exporter is the middle step between HAProxy and Prometheus. It reads HAProxy statistics, converts them into metrics, and exposes those metrics on its own HTTP endpoint. The mental model that helps most is two separate connections - not one:
HAProxy stats interface -> HAProxy exporter -> Prometheus
The first connection is what the exporter uses to pull proxy data. The second is what Prometheus uses to scrape the exporter. Either one can fail, and either one can be exposed independently.
The stats interface is the dependency
HAProxy statistics might be available via a web endpoint or a stats socket, depending on how you deployed it. Those stats can include frontend and backend details, server states, health, and traffic measurements. The interface may also require credentials or restrict which source addresses can connect.
So a responding exporter doesn't automatically mean it can read HAProxy. You might see the exporter's metrics endpoint reachable while the upstream stats connection fails - because of a changed password, a wrong URI, a firewall rule, or a changed HAProxy configuration. Check the exporter's scrape/collection status too, and confirm that Prometheus can reach the exporter, not just that the port is open.
Protect the stats interface on its own. Making the exporter private doesn't help if HAProxy's stats page (or socket) is exposed directly. Likewise, restricting the stats interface won't secure an exporter listener that's reachable from the public internet. Review both paths - the bind addresses and the firewall rules behind them.
Keep the proxy and collector separate in your threat model
An HAProxy process may need to accept public traffic, while its exporter belongs on a management network. Don't assume the two "components" share the same exposure just because they live on the same host. Their listener addresses, namespaces, routes, and firewall rules can be different.
For example, HAProxy might listen on a public interface while the exporter binds only to a private address. That separation can be legitimate if Prometheus can reach the private listener and untrusted clients cannot. But a published container port on all interfaces, a permissive security group, or a changed bind address can break that boundary.
Verify what's actually deployed (listener and routes), not only what you expect to be running. The host process and its service unit can confirm what's installed; checks from the monitoring network and from an untrusted network show what's reachable in practice.
How to verify a candidate exporter
A solid verification process reconciles three views: what the endpoint returns, what the host actually runs, and what Prometheus thinks it's scraping. You can't rely on just one. A scan can point you to a candidate, while checks from the host and from Prometheus tell you whether it's genuinely part of your deployment.
A practical verification sequence
- Check from the right network. Test the candidate from the network where Prometheus is expected to scrape it. If the endpoint is intentionally private, a failed request from outside your monitoring network tells you more about routing than about exporter health.
- Inspect the HTTP response. Confirm it returns the expected exporter metrics, including build information if the exporter exposes it. "The port is open" or "some HTTP came back" isn't enough.
- Check exporter health. Look for evidence the exporter can read HAProxy's stats interface. A Prometheus scrape that succeeds only proves Prometheus reached the exporter - it doesn't automatically prove upstream collection worked.
- Verify the deployed process. On the host, confirm the package/container image, executable, service unit, listener address, and runtime arguments. Compare that with what you saw in the response, rather than trusting a scan's port label.
- Reconcile with Prometheus. Confirm the target exists in the expected job, and that scrape status and recent samples match the host and endpoint you're investigating. If something shows up in a scan but isn't in your approved inventory, treat it as a candidate until you can explain it.
- Record the result. Mark it as confirmed, unrelated, unreachable from the intended network, or unresolved. That's more useful than inflating an "exporter count" with every port match.
For the two body matches in the example scan, the right next step is to check each endpoint from the monitoring network, inspect the response, and compare it to your Prometheus target inventory. Until those checks are done, you have candidates - not confirmed exporters.
Keep the checks repeatable
A one-off manual request can help you debug a service. It's a poor long-term inventory method. Record the expected target, owner, service identity, listener address, and the verification result in the same operational system you use for monitoring. Then rerun checks after network changes or deployments.
If a candidate doesn't match the expected response, don't jump straight to "malicious" or "harmless" based on the port alone. Confirm the owning system and process using your asset inventory and deployment records. The outcome should be straightforward: either the endpoint is an approved exporter with a working HAProxy stats dependency, or it needs an owner and follow-up.
How to secure and operate both paths
A good access policy is simple: HAProxy statistics should be reachable only by the exporter, and the exporter should be reachable only by Prometheus (and whatever systems need it to administer monitoring). The details vary by environment, but both boundaries should be explicit and tested.
Scope access and credentials
Use network controls to restrict the HAProxy stats interface to the exporter's source address (or management segment). Restrict the exporter listener to Prometheus and approved administration paths. Check host firewalls, cloud security groups, container publishing rules, and network routes - an allow rule in one place doesn't guarantee another layer is locked down.
If the stats interface requires authentication, use a dedicated HAProxy stats user with read-only access. The exporter doesn't need admin privileges just to collect statistics. Store the exporter's stats URI and credentials in a protected file or secret store. Avoid putting credentials in deployment logs, command output, or shell history - things that tend to stick around long after the deployment is over.
Two questions are worth repeating:
- Can an unapproved client reach HAProxy's stats interface?
- Can an unapproved client reach the exporter's Prometheus listener?
Test both from representative networks. Don't infer the answer from "it's private" or "it's public" in the HAProxy data plane. Verify reachability where Prometheus actually sits.
Bound the operational impact
Set a scrape timeout that matches the expected response time and Prometheus collection interval. An unbounded (or overly generous) timeout can tie up resources when a dependency stalls. Too short a timeout creates noisy failures during normal load. Base the value on observed latency and test under realistic conditions.
Also watch labels. Backend and server names can end up as metric labels, and changing names can create new time series. If those names come from external or frequently changing inputs, cardinality can grow fast and drive up storage and query costs. Normalize or constrain label values where the exporter and configuration allow it, and avoid adding unbounded identifiers just because they're available.
These controls have trade-offs. Over-restricting access can break legitimate scraping during a migration. Normalizing labels can remove details you'd want during an incident. Make the boundary and label policy explicit, test it in a representative environment, and keep enough context to diagnose failures without exposing unnecessary data.
How to monitor changes without losing useful metrics
Exporter health isn't "set it once and forget it." Changes to HAProxy configuration, credentials, exporter version, or backend naming can change what Prometheus collects. If all you track is whether the exporter port is open, you can miss failures where the listener still runs - but the metrics are stale or incomplete.
Track the dependency as one system
Keep the exporter version and build information, the source of the stats URI, and the HAProxy configuration version associated in your deployment records. You don't need to expose the secret value itself to link the pieces together - store the secret reference or version instead. That makes it possible to trace a failed collection to a credential rotation or configuration rollout without copying passwords into logs.
Monitor at least these three conditions:
- Exporter availability: Can Prometheus reach and scrape the exporter?
- Collection success: Can the exporter read HAProxy statistics and produce current data?
- Expected target coverage: Are the HAProxy targets and backends you care about actually represented?
A successful scrape answers only the first question. Alerting should separate "exporter dead" from "exporter reachable but upstream collection failing," because the fixes are different.
Treat names and credentials as monitored changes
A backend rename can change label values and create new time series. Dashboards and alerts tied to the old label may stop matching even if traffic is still flowing. Review metric/label changes with the same care you use for application interface changes: identify which dashboards, alert rules, and capacity views could be affected before you roll out.
Credential changes can fail quietly. If the exporter keeps serving its endpoint but can't authenticate to the stats interface anymore, Prometheus may continue scraping something that isn't collecting useful data. After a credential rotation, verify upstream collection and confirm that recent metric samples reflect the current HAProxy state.
The useful operational rule is: monitor the whole chain, but keep the components distinguishable. A single green check for "port 9101 is open" hides too much. Separate checks help you locate the failure and stop treating reachability as proof that metrics are actually healthy.
Conclusion: treat counts as leads, not proof
HAProxy metrics only help when you understand the path that produced them. Port 9101 is a search clue, not an exporter inventory. A matching response is a candidate, not a verified deployment. Confirm the endpoint, the host process, the Prometheus target, and the exporter's access to HAProxy statistics.
Then secure the two connections independently: lock stats access to the collector, lock exporter access to Prometheus, and scope credentials to read-only use. Track configuration and label changes alongside scrape health. That gives you evidence you can act on - and a monitoring path that stays understandable when something changes.