# HAProxy Exporter

Native desteğin yerine harici olarak exporter da kullanılabilir.

[haproxy\_exporter](https://github.com/prometheus/haproxy_exporter/releases) release sayfasından uygun arşiv indirilerek aşağıdaki şekilde kurulabilir.

```bash
wget https://github.com/prometheus/haproxy_exporter/releases/download/v0.10.0/haproxy_exporter-0.10.0.linux-amd64.tar.gz

tar zxf haproxy_exporter-0.10.0.linux-amd64.tar.gz

chown haproxy:haproxy haproxy_exporter

mv haproxy_exporter /usr/local/bin

cat > /etc/systemd/system/haproxy_exporter.service <<EOL
[Unit]
Description=Prometheus HAProxy Exporter
After=network.target

[Service]
Type=simple
User=haproxy
Group=haproxy
ExecStart=/usr/local/bin/haproxy_exporter \
    --no-haproxy.ssl-verify \
    --web.listen-address=9101 \
    --haproxy.scrape-uri="unix:/run/haproxy/admin.sock" \
    --haproxy.timeout="5s" \
    --log.level="info"
SyslogIdentifier=haproxy_exporter
Restart=always

[Install]
WantedBy=multi-user.target
EOL
```

Kurulum yapıldıktan sonra test etmek için:

```bash
curl http://localhost:9101/metrics
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://oguzhaninan.gitbook.io/haproxy/prometheus-metrics/haproxy-exporter.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
