Skip to content

Commit

Permalink
Add Golang module to metricbeat (#3536)
Browse files Browse the repository at this point in the history
  • Loading branch information
medcl authored and ruflin committed Feb 24, 2017
1 parent b5bef95 commit 5b2d6d7
Show file tree
Hide file tree
Showing 29 changed files with 1,208 additions and 0 deletions.
270 changes: 270 additions & 0 deletions metricbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ grouped in the following categories:
* <<exported-fields-common>>
* <<exported-fields-couchbase>>
* <<exported-fields-docker>>
* <<exported-fields-golang>>
* <<exported-fields-haproxy>>
* <<exported-fields-jolokia>>
* <<exported-fields-kafka>>
Expand Down Expand Up @@ -1832,6 +1833,275 @@ type: long
Total number of outgoing packets.
[[exported-fields-golang]]
== golang Fields
golang Module
[float]
== golang Fields
[float]
== expvar Fields
expvar
[float]
=== golang.expvar.cmdline
type: keyword
The cmdline of this golang program start with.
[float]
== heap Fields
The golang program heap information exposed by expvar.
[float]
=== golang.heap.cmdline
type: keyword
The cmdline of this golang program start with.
[float]
== gc Fields
Garbage collector summary.
[float]
== total_pause Fields
Total GC pause duration over lifetime of process.
[float]
=== golang.heap.gc.total_pause.ns
type: long
Duration in Ns.
[float]
=== golang.heap.gc.total_count
type: long
Total number of GC was happened.
[float]
=== golang.heap.gc.next_gc_limit
type: long
format: bytes
Next collection will happen when HeapAlloc > this amount.
[float]
=== golang.heap.gc.cpu_fraction
type: long
Fraction of CPU time used by GC.
[float]
== pause Fields
Last GC pause durations during the monitoring period.
[float]
=== golang.heap.gc.pause.count
type: long
Count of GC pause duration during this collect period.
[float]
== sum Fields
Total GC pause duration during this collect period.
[float]
=== golang.heap.gc.pause.sum.ns
type: long
Duration in Ns.
[float]
== max Fields
Max GC pause duration during this collect period.
[float]
=== golang.heap.gc.pause.max.ns
type: long
Duration in Ns.
[float]
== avg Fields
Average GC pause duration during this collect period.
[float]
=== golang.heap.gc.pause.avg.ns
type: long
Duration in Ns.
[float]
== system Fields
Heap summary,which bytes was obtained from system.
[float]
=== golang.heap.system.total
type: long
format: bytes
Total bytes obtained from system (sum of XxxSys below).
[float]
=== golang.heap.system.optained
type: long
format: bytes
Via HeapSys, bytes obtained from system. heap_sys = heap_idle + heap_inuse.
[float]
=== golang.heap.system.stack
type: long
format: bytes
Bytes used by stack allocator, and these bytes was obtained from system.
[float]
=== golang.heap.system.released
type: long
format: bytes
Bytes released to the OS.
[float]
== allocations Fields
Heap allocations summary.
[float]
=== golang.heap.allocations.mallocs
type: long
Number of mallocs.
[float]
=== golang.heap.allocations.frees
type: long
Number of frees.
[float]
=== golang.heap.allocations.objects
type: long
Total number of allocated objects.
[float]
=== golang.heap.allocations.total
type: long
format: bytes
Bytes allocated (even if freed) throughout the lifetime.
[float]
=== golang.heap.allocations.allocated
type: long
format: bytes
Bytes allocated and not yet freed (same as Alloc above).
[float]
=== golang.heap.allocations.idle
type: long
format: bytes
Bytes in idle spans.
[float]
=== golang.heap.allocations.active
type: long
format: bytes
Bytes in non-idle span.
[[exported-fields-haproxy]]
== HAProxy Fields
Expand Down
43 changes: 43 additions & 0 deletions metricbeat/docs/modules/golang.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
////
This file is generated! See scripts/docs_collector.py
////

[[metricbeat-module-golang]]
== golang Module

This is the golang Module. Metrics are collected submitting HTTP GET requests to golang-expvar-api.
Reference: https://golang.org/pkg/expvar/

[float]
=== Example Configuration

The golang module supports the standard configuration options that are described
in <<configuration-metricbeat>>. Here is an example configuration:

[source,yaml]
----
metricbeat.modules:
#- module: golang
# metricsets: ["expvar","heap"]
# enabled: true
# period: 10s
# hosts: ["localhost:6060"]
# heap.path: "/debug/vars"
# expvar:
# namespace: "example"
# path: "/debug/vars"
----

[float]
=== Metricsets

The following metricsets are available:

* <<metricbeat-metricset-golang-expvar,expvar>>

* <<metricbeat-metricset-golang-heap,heap>>

include::golang/expvar.asciidoc[]

include::golang/heap.asciidoc[]

13 changes: 13 additions & 0 deletions metricbeat/docs/modules/golang/expvar.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
////
This file is generated! See scripts/docs_collector.py
////

[[metricbeat-metricset-golang-expvar]]
include::../../../module/golang/expvar/_meta/docs.asciidoc[]


==== Fields

For a description of each field in the metricset, see the
<<exported-fields-golang,exported fields>> section.

19 changes: 19 additions & 0 deletions metricbeat/docs/modules/golang/heap.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-golang-heap]]
include::../../../module/golang/heap/_meta/docs.asciidoc[]


==== Fields

For a description of each field in the metricset, see the
<<exported-fields-golang,exported fields>> section.

Here is an example document generated by this metricset:

[source,json]
----
include::../../../module/golang/heap/_meta/data.json[]
----
2 changes: 2 additions & 0 deletions metricbeat/docs/modules_list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ This file is generated! See scripts/docs_collector.py
* <<metricbeat-module-ceph,ceph>>
* <<metricbeat-module-couchbase,Couchbase>>
* <<metricbeat-module-docker,Docker>>
* <<metricbeat-module-golang,golang>>
* <<metricbeat-module-haproxy,HAProxy>>
* <<metricbeat-module-jolokia,Jolokia>>
* <<metricbeat-module-kafka,kafka>>
Expand All @@ -26,6 +27,7 @@ include::modules/apache.asciidoc[]
include::modules/ceph.asciidoc[]
include::modules/couchbase.asciidoc[]
include::modules/docker.asciidoc[]
include::modules/golang.asciidoc[]
include::modules/haproxy.asciidoc[]
include::modules/jolokia.asciidoc[]
include::modules/kafka.asciidoc[]
Expand Down
3 changes: 3 additions & 0 deletions metricbeat/include/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ import (
_ "github.com/elastic/beats/metricbeat/module/docker/info"
_ "github.com/elastic/beats/metricbeat/module/docker/memory"
_ "github.com/elastic/beats/metricbeat/module/docker/network"
_ "github.com/elastic/beats/metricbeat/module/golang"
_ "github.com/elastic/beats/metricbeat/module/golang/expvar"
_ "github.com/elastic/beats/metricbeat/module/golang/heap"
_ "github.com/elastic/beats/metricbeat/module/haproxy"
_ "github.com/elastic/beats/metricbeat/module/haproxy/info"
_ "github.com/elastic/beats/metricbeat/module/haproxy/stat"
Expand Down
Loading

0 comments on commit 5b2d6d7

Please sign in to comment.