Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HAProxy plugin #71

Merged
merged 1 commit into from
Aug 5, 2015
Merged

HAProxy plugin #71

merged 1 commit into from
Aug 5, 2015

Conversation

v9n
Copy link
Contributor

@v9n v9n commented Jul 17, 2015

Request HAProxy stats in CSV format and parse only below value:

QCUR:
SCUR:
SMAX:
BIN:
BOUT:
RATE:
RATE_MAX:
STOT:
HRSP_1xx:
HRSP_2xx:
HRSP_3xx:
HRSP_4xx:
EREQ:
ERESP:
ECON:
REQ_RATE:
REQ_RATE_MAX:
REQ_TOT

Metric name is column name in CSV file as above to avoid confusion and keep it in-sync with HAProxy column. Proxy name and backend, service are passed as tag. Example(when run in test mode)

> [host="lb.haproxy.com" proxy="be_forbidden" sv="BACKEND"] haproxy_rate value=0
> [host="lb.haproxy.com" proxy="stats" sv="FRONTEND"] haproxy_scur value=1
> [host="lb.haproxy.com" proxy="stats" sv="FRONTEND"] haproxy_smax value=1
> [host="lb.haproxy.com" proxy="stats" sv="FRONTEND"] haproxy_stot value=2
> [host="lb.haproxy.com" proxy="stats" sv="FRONTEND"] haproxy_bin value=58504
> [host="lb.haproxy.com" proxy="stats" sv="FRONTEND"] haproxy_bot value=4314106
> [host="lb.haproxy.com" proxy="stats" sv="FRONTEND"] haproxy_rate value=1
> [host="lb.haproxy.com" proxy="stats" sv="FRONTEND"] haproxy_req_rate value=1
> [host="lb.haproxy.com" proxy="stats" sv="BACKEND"] haproxy_qcur value=0
> [host="lb.haproxy.com" proxy="stats" sv="BACKEND"] haproxy_scur value=0
> [host="lb.haproxy.com" proxy="stats" sv="BACKEND"] haproxy_smax value=0
> [host="lb.haproxy.com" proxy="stats" sv="BACKEND"] haproxy_stot value=0
> [host="lb.haproxy.com" proxy="stats" sv="BACKEND"] haproxy_bin value=58504
> [host="lb.haproxy.com" proxy="stats" sv="BACKEND"] haproxy_bot value=4314106
> [host="lb.haproxy.com" proxy="stats" sv="BACKEND"] haproxy_rate value=0

Sample configuration:

# Read metrics from one or many haproxy servers, either using socket or static http page
[haproxy]
servers = ["http://user:password@lb.haproxy.com", "http://noauthentication_haproxy.com"]

@evanphx
Copy link
Contributor

evanphx commented Jul 21, 2015

One quick change I'd like you to make. Because the fields are NOT defined by Go, but rather in the CSV layout, please don't use iota. Instead use the constant numbers for the fields.

@v9n
Copy link
Contributor Author

v9n commented Jul 23, 2015

@evanphx Thanks for feedback. I was lazy so I used iota and make sure to map them one by one sequentially. But that's really bad after reading your comment now.

I rebased with master and solve conflict.

@sparrc
Copy link
Contributor

sparrc commented Aug 5, 2015

@kureikain looks good to me, thanks much!

sparrc added a commit that referenced this pull request Aug 5, 2015
@sparrc sparrc merged commit 06a84de into influxdata:master Aug 5, 2015
srfraser pushed a commit to srfraser/telegraf that referenced this pull request Aug 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants