-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Adding HAProxy module #2384
Adding HAProxy module #2384
Changes from 11 commits
8c236c4
5b4adac
056f7f8
7b4c97d
8d9d696
dcf16a8
16dafbe
ac6dbe1
543319e
52652bf
eb7c22d
6c0eb6f
e2828a8
3e4384e
004d9fa
007d4a4
ef9c877
498ada4
e989718
41eb385
607c564
6ba4fbd
e768cd2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
//// | ||
This file is generated! See scripts/docs_collector.py | ||
//// | ||
|
||
[[metricbeat-module-haproxy]] | ||
== haproxy Module | ||
|
||
This is the haproxy Module. | ||
|
||
|
||
|
||
[float] | ||
=== Example Configuration | ||
|
||
The haproxy module supports the standard configuration options that are described | ||
in <<configuration-metricbeat>>. Here is an example configuration: | ||
|
||
[source,yaml] | ||
---- | ||
metricbeat.modules: | ||
- module: haproxy | ||
metricsets: ["stat"] | ||
enabled: true | ||
period: 1s | ||
hosts: ["localhost"] | ||
|
||
---- | ||
|
||
[float] | ||
=== Metricsets | ||
|
||
The following metricsets are available: | ||
|
||
* <<metricbeat-metricset-haproxy-stat,stat>> | ||
|
||
include::haproxy/stat.asciidoc[] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
//// | ||
This file is generated! See scripts/docs_collector.py | ||
//// | ||
|
||
[[metricbeat-metricset-haproxy-stat]] | ||
include::../../../module/haproxy/stat/_meta/docs.asciidoc[] | ||
|
||
|
||
==== Fields | ||
|
||
For a description of each field in the metricset, see the | ||
<<exported-fields-haproxy,exported fields>> section. | ||
|
||
Here is an example document generated by this metricset: | ||
|
||
[source,json] | ||
---- | ||
include::../../../module/haproxy/stat/_meta/data.json[] | ||
---- |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
2016-08-10T19:06:01-04:00 INFO Metrics logging every 30s | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The logs directory shuld not be commited. it is under .gitignore in the master branch |
||
2016-08-10T19:06:01-04:00 INFO Loading template enabled. Reading template file: /Users/alain.lefebvre/Documents/code/github_personal/beats/metricbeat/metricbeat.template.json | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file must be removed manually as it is already commited. |
||
2016-08-10T19:06:01-04:00 INFO Loading template enabled for Elasticsearch 2.x. Reading template file: /Users/alain.lefebvre/Documents/code/github_personal/beats/metricbeat/metricbeat.template-es2x.json | ||
2016-08-10T19:06:01-04:00 INFO Elasticsearch url: http://localhost:9200 | ||
2016-08-10T19:06:01-04:00 INFO Activated elasticsearch as output plugin. | ||
2016-08-10T19:06:01-04:00 INFO Publisher name: Alain-L-MBP | ||
2016-08-10T19:06:01-04:00 INFO Flush Interval set to: 1s | ||
2016-08-10T19:06:01-04:00 INFO Max Bulk Size set to: 50 | ||
2016-08-10T19:06:01-04:00 INFO Register [ModuleFactory:[system], MetricSetFactory:[apache/status, mongodb/status, mysql/status, nginx/stubstatus, redis/info, redis/keyspace, system/core, system/cpu, system/filesystem, system/fsstat, system/load, system/memory, system/network, system/process, zookeeper/mntr]] | ||
2016-08-10T19:06:01-04:00 CRIT Exiting: 1 error: metricset 'haproxy/stat' is not registered, module not found |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,13 +36,24 @@ metricbeat.modules: | |
|
||
# Per process stats | ||
- process | ||
enabled: true | ||
enabled: false | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change should be reverted There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @hartfordfive Can you please also revert this change? |
||
period: 10s | ||
processes: ['.*'] | ||
|
||
# if true, exports the CPU usage in ticks, together with the percentage values | ||
cpu_ticks: false | ||
|
||
#------------------------------- haproxy Module ------------------------------ | ||
- module: haproxy | ||
metricsets: | ||
- "stat" | ||
- "info" | ||
enabled: true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. haproxy should be disabled by default in the short config There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @hartfordfive This also should be set to false by default. |
||
period: 10s | ||
#stats_addr: "unix:///tmp/haproxy-stats.sock" | ||
stats_addr: "tcp://127.0.0.1:14567" | ||
|
||
|
||
|
||
|
||
#================================ General ===================================== | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
FROM haproxy:1.6 | ||
COPY haproxy.conf /usr/local/etc/haproxy/haproxy.cfg |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#- module: haproxy | ||
|
||
#metricsets: | ||
#- "stat" | ||
#- "info" | ||
|
||
#enabled: true | ||
|
||
#period: 10s | ||
|
||
#stats_addr: "tcp://127.0.0.1:14567 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
- module: haproxy | ||
metricsets: | ||
- "stat" | ||
- "info" | ||
enabled: true | ||
period: 10s | ||
stats_addr: "tcp://127.0.0.1:14567" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
== haproxy Module | ||
|
||
This is the haproxy Module. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
- key: haproxy | ||
title: "haproxy" | ||
description: > | ||
haproxy Module | ||
fields: | ||
- name: haproxy | ||
type: group | ||
description: > | ||
fields: |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
|
||
global | ||
# maximum number of simultaneous active connections | ||
maxconn 4000 | ||
#daemon | ||
user root | ||
group staff | ||
|
||
# for restarts | ||
pidfile /var/run/haproxy.pid | ||
# Logging to syslog facility local0 | ||
log 127.0.0.1 local0 | ||
stats socket 0.0.0.0:14567 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this something that is enabled by default in most haproxy setups? If not, could be worth to mention this in the haproxy module docs. |
||
spread-checks 5 | ||
#debug | ||
|
||
defaults | ||
|
||
log global | ||
mode http | ||
balance roundrobin | ||
maxconn 25000 | ||
option httplog | ||
option abortonclose | ||
option httpclose | ||
option forwardfor | ||
retries 3 | ||
option redispatch | ||
|
||
timeout client 30s | ||
timeout connect 30s | ||
timeout server 30s | ||
option httpchk HEAD /haproxy?monitor HTTP/1.0 | ||
timeout check 5s | ||
|
||
listen http-webservices | ||
|
||
bind 0.0.0.0:8888 | ||
server log1 127.0.0.1:8889 check |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/* | ||
Package haproxy is a Metricbeat module that contains MetricSets. | ||
*/ | ||
package haproxy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how this change neded up in this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe I got these changes when merging in the latest master the other day into my branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does not seem to be in master: https://github.com/elastic/beats/blob/master/metricbeat/etc/beat.yml Could you run
git checkout master metricbeat/etc/beat.yml
?