Skip to content

Commit

Permalink
[metricbeat] Add service metricset (elastic#14206) (elastic#15134)
Browse files Browse the repository at this point in the history
* add system/services metricset and dashboard

(cherry picked from commit ed74a3f)
  • Loading branch information
fearful-symmetry authored Dec 17, 2019
1 parent f6556c7 commit 986d717
Show file tree
Hide file tree
Showing 69 changed files with 9,451 additions and 5 deletions.
36 changes: 34 additions & 2 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -514,8 +514,8 @@ This product includes software developed at CoreOS, Inc.

--------------------------------------------------------------------
Dependency: github.com/coreos/go-systemd
Version: v18
Revision: 9002847aa1425fb6ac49077c0a630b3b67e0fbfd
Version: v20
Revision: fd7a80b32e1fc73e890fde45604ed5009dc817a3
License type (autodetected): Apache-2.0
./vendor/github.com/coreos/go-systemd/LICENSE:
--------------------------------------------------------------------
Expand Down Expand Up @@ -1917,6 +1917,38 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
--------------------------------------------------------------------
Dependency: github.com/godbus/dbus
Revision: 37bf87eef99d69c4f1d3528bd66e3a87dc201472
License type (autodetected): BSD-2-Clause
./vendor/github.com/godbus/dbus/LICENSE:
--------------------------------------------------------------------
Copyright (c) 2013, Georg Reinke (<guelfey at gmail dot com>), Google
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

--------------------------------------------------------------------
Dependency: github.com/gofrs/uuid
Version: 3.1.1
Expand Down
10 changes: 10 additions & 0 deletions metricbeat/_meta/fields.common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,13 @@
example: metricsets
description: >
The document type. Always set to "doc".
- name: process.exit_code
type: long
description: the exit code of a process
- name: systemd.fragment_path
type: keyword
description: the location of the systemd unit path
- name: systemd.unit
type: keyword
description: the unit name of the systemd service
167 changes: 167 additions & 0 deletions metricbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -4282,6 +4282,33 @@ required: True
--
*`process.exit_code`*::
+
--
the exit code of a process
type: long
--
*`systemd.fragment_path`*::
+
--
the location of the systemd unit path
type: keyword
--
*`systemd.unit`*::
+
--
the unit name of the systemd service
type: keyword
--
[[exported-fields-consul]]
== consul fields
Expand Down Expand Up @@ -32214,6 +32241,146 @@ type: long
Number of blocks on the device that are in sync, in 1024-byte blocks.
type: long
--
[float]
=== service
metrics for system services
*`system.service.name`*::
+
--
The name of the service
type: keyword
--
*`system.service.load_state`*::
+
--
The load state of the service
type: keyword
--
*`system.service.state`*::
+
--
The activity state of the service
type: keyword
--
*`system.service.sub_state`*::
+
--
The sub-state of the service
type: keyword
--
*`system.service.state_since`*::
+
--
The timestamp of the last state change. If the service is active and running, this is its uptime.
type: date
--
*`system.service.exec_code`*::
+
--
The SIGCHLD code from the service's main process
type: keyword
--
[float]
=== resources
system metrics associated with the service
*`system.service.resources.cpu.usage.ns`*::
+
--
CPU usage in nanoseconds
type: long
--
*`system.service.resources.memory.usage.bytes`*::
+
--
memory usage in bytes
type: long
--
*`system.service.resources.tasks.count`*::
+
--
number of tasks associated with the service
type: long
--
[float]
=== network
network resource usage
*`system.service.resources.network.in.bytes`*::
+
--
bytes in
type: long
format: bytes
--
*`system.service.resources.network.in.packets`*::
+
--
packets in
type: long
format: bytes
--
*`system.service.resources.network.out.packets`*::
+
--
packets out
type: long
--
*`system.service.resources.network.out.bytes`*::
+
--
bytes out
type: long
--
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions metricbeat/docs/modules/system.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ The following metricsets are available:

* <<metricbeat-metricset-system-raid,raid>>

* <<metricbeat-metricset-system-service,service>>

* <<metricbeat-metricset-system-socket,socket>>

* <<metricbeat-metricset-system-socket_summary,socket_summary>>
Expand Down Expand Up @@ -171,6 +173,8 @@ include::system/process_summary.asciidoc[]

include::system/raid.asciidoc[]

include::system/service.asciidoc[]

include::system/socket.asciidoc[]

include::system/socket_summary.asciidoc[]
Expand Down
23 changes: 23 additions & 0 deletions metricbeat/docs/modules/system/service.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
////
This file is generated! See scripts/mage/docs_collector.go
////

[[metricbeat-metricset-system-service]]
=== System service metricset

beta[]

include::../../../module/system/service/_meta/docs.asciidoc[]


==== Fields

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

Here is an example document generated by this metricset:

[source,json]
----
include::../../../module/system/service/_meta/data.json[]
----
3 changes: 2 additions & 1 deletion metricbeat/docs/modules_list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ This file is generated! See scripts/mage/docs_collector.go
|<<metricbeat-module-statsd,Statsd>> beta[] |image:./images/icon-no.png[No prebuilt dashboards] |
.1+| .1+| |<<metricbeat-metricset-statsd-server,server>> beta[]
|<<metricbeat-module-system,System>> |image:./images/icon-yes.png[Prebuilt dashboards are available] |
.15+| .15+| |<<metricbeat-metricset-system-core,core>>
.16+| .16+| |<<metricbeat-metricset-system-core,core>>
|<<metricbeat-metricset-system-cpu,cpu>>
|<<metricbeat-metricset-system-diskio,diskio>>
|<<metricbeat-metricset-system-entropy,entropy>>
Expand All @@ -197,6 +197,7 @@ This file is generated! See scripts/mage/docs_collector.go
|<<metricbeat-metricset-system-process,process>>
|<<metricbeat-metricset-system-process_summary,process_summary>>
|<<metricbeat-metricset-system-raid,raid>>
|<<metricbeat-metricset-system-service,service>> beta[]
|<<metricbeat-metricset-system-socket,socket>>
|<<metricbeat-metricset-system-socket_summary,socket_summary>>
|<<metricbeat-metricset-system-uptime,uptime>>
Expand Down
2 changes: 1 addition & 1 deletion metricbeat/include/fields/fields.go

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions metricbeat/include/list_common.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions metricbeat/module/system/_meta/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#- core
#- diskio
#- socket
#- services
process.include_top_n:
by_cpu: 5 # include top 5 processes by CPU
by_memory: 5 # include top 5 processes by memory
Expand Down
Loading

0 comments on commit 986d717

Please sign in to comment.