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

Add docker event metricset #9856

Merged
merged 11 commits into from
Jan 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d

- Add `key` metricset to the Redis module. {issue}9582[9582] {pull}9657[9657] {pull}9746[9746]
- Add `socket_summary` metricset to system defaults, removing experimental tag and supporting Windows {pull}9709[9709]
- Add docker `event` metricset. {pull}9856[9856]

*Packetbeat*

Expand Down
102 changes: 102 additions & 0 deletions metricbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -2760,6 +2760,108 @@ type: scaled_float
Number of reads and writes per second


--

[float]
== event fields

Docker event



*`docker.event.status`*::
+
--
type: keyword

Event status


--

*`docker.event.id`*::
+
--
type: alias

alias to: event.id

Event id when available


--

*`docker.event.from`*::
+
--
type: keyword

Event source


--

*`docker.event.type`*::
+
--
type: alias

alias to: event.kind

The type of object emitting the event


--

*`docker.event.action`*::
+
--
type: alias

alias to: event.action

The type of event


--

*`docker.event.time`*::
+
--
type: alias

alias to: event.created

Timestamp of event


--

[float]
== actor fields

Actor



*`docker.event.actor.id`*::
+
--
type: keyword

The ID of the object emitting the event


--

*`docker.event.actor.attributes`*::
+
--
type: object

Various key/value attributes of the object, depending on its type


--

[float]
Expand Down
5 changes: 5 additions & 0 deletions metricbeat/docs/modules/docker.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ metricbeat.modules:
- "container"
- "cpu"
- "diskio"
- "event"
- "healthcheck"
- "info"
#- "image"
Expand Down Expand Up @@ -71,6 +72,8 @@ The following metricsets are available:

* <<metricbeat-metricset-docker-diskio,diskio>>

* <<metricbeat-metricset-docker-event,event>>

* <<metricbeat-metricset-docker-healthcheck,healthcheck>>

* <<metricbeat-metricset-docker-image,image>>
Expand All @@ -87,6 +90,8 @@ include::docker/cpu.asciidoc[]

include::docker/diskio.asciidoc[]

include::docker/event.asciidoc[]

include::docker/healthcheck.asciidoc[]

include::docker/image.asciidoc[]
Expand Down
21 changes: 21 additions & 0 deletions metricbeat/docs/modules/docker/event.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
////
This file is generated! See scripts/docs_collector.py
////

[[metricbeat-metricset-docker-event]]
=== Docker event metricset

include::../../../module/docker/event/_meta/docs.asciidoc[]


==== Fields

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

Here is an example document generated by this metricset:

[source,json]
----
include::../../../module/docker/event/_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 @@ -22,9 +22,10 @@ This file is generated! See scripts/docs_collector.py
|<<metricbeat-metricset-couchbase-cluster,cluster>> beta[]
|<<metricbeat-metricset-couchbase-node,node>> beta[]
|<<metricbeat-module-docker,Docker>> |image:./images/icon-yes.png[Prebuilt dashboards are available] |
.8+| .8+| |<<metricbeat-metricset-docker-container,container>>
.9+| .9+| |<<metricbeat-metricset-docker-container,container>>
|<<metricbeat-metricset-docker-cpu,cpu>>
|<<metricbeat-metricset-docker-diskio,diskio>>
|<<metricbeat-metricset-docker-event,event>>
|<<metricbeat-metricset-docker-healthcheck,healthcheck>>
|<<metricbeat-metricset-docker-image,image>>
|<<metricbeat-metricset-docker-info,info>>
Expand Down
1 change: 1 addition & 0 deletions metricbeat/include/list.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/metricbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ metricbeat.modules:
- "container"
- "cpu"
- "diskio"
- "event"
- "healthcheck"
- "info"
#- "image"
Expand Down
1 change: 1 addition & 0 deletions metricbeat/module/docker/_meta/config.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- "container"
- "cpu"
- "diskio"
- "event"
- "healthcheck"
- "info"
#- "image"
Expand Down
1 change: 1 addition & 0 deletions metricbeat/module/docker/_meta/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# - container
# - cpu
# - diskio
# - event
# - healthcheck
# - info
# - memory
Expand Down
31 changes: 31 additions & 0 deletions metricbeat/module/docker/event/_meta/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"@timestamp": "2017-10-12T08:05:34.853Z",
"agent": {
"hostname": "host.example.com",
"name": "host.example.com"
},
"docker": {
"event": {
"actor": {
"attributes": {
"image": "busybox",
"name": "wizardly_knuth"
},
"id": "9d4c3af1d4a0268940205aad04a3c6bf434b32f45e0784dec5c283201ef299fc"
},
"from": "busybox",
"status": "create"
}
},
"event": {
"action": "create",
"created": "2019-01-03T12:44:52+01:00",
"dataset": "event",
"id": "9d4c3af1d4a0268940205aad04a3c6bf434b32f45e0784dec5c283201ef299fc",
"kind": "container",
"module": "docker"
},
"service": {
"type": "docker"
}
}
1 change: 1 addition & 0 deletions metricbeat/module/docker/event/_meta/docs.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This is the event metricset of the module docker.
52 changes: 52 additions & 0 deletions metricbeat/module/docker/event/_meta/fields.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
- name: event
type: group
description: >
Docker event
release: ga
fields:
- name: status
type: keyword
description: >
Event status
- name: id
type: alias
path: event.id
migration: true
description: >
Event id when available
- name: from
type: keyword
description: >
Event source
- name: type
type: alias
path: event.kind
migration: true
description: >
The type of object emitting the event
- name: action
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You set migration: true here. Is this an alias we only want to be enabled if migration is enabled or have it always? Same for the other aliases.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want it to stay, I'm guessing I should not have put migration there 😇 ? I can open a PR to remove them 👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, otherwise they will disappear.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@exekias BTW this is a more general discussion if we want to have fields in ECS only or also the "original" name around.

type: alias
path: event.action
migration: true
description: >
The type of event
- name: time
type: alias
path: event.created
migration: true
description: >
Timestamp of event
- name: actor
type: group
description: >
Actor
fields:
- name: id
type: keyword
description: >
The ID of the object emitting the event
- name: attributes
type: object
object_type: keyword
description: >
Various key/value attributes of the object, depending on its type
Loading