Conversation
This metricset will retrieve events coming from the Docker events
API [0].
Example output:
```
"docker": {
"event": {
"id": "8c229155b039c2adcb4fab1f987f35a0d1f913dfaa95f3113ed6e4f91eb5398c",
"from": "busybox",
"type": "container",
"action": "die",
"actor": {
"id": "8c229155b039c2adcb4fab1f987f35a0d1f913dfaa95f3113ed6e4f91eb5398c",
"attributes": {
"image": "busybox",
"name": "distracted_lichterman",
"exitCode": "0"
}
},
"time": "2019-01-02T22:41:02.000Z",
"status": "die"
}
}
```
Actor attributes will container labels in the case of container
events, the module will perform dedotting (if enabled) on them.
[0] https://docs.docker.com/engine/api/v1.37/#operation/SystemEvents
andrewkroh
left a comment
There was a problem hiding this comment.
Is the schema here setup to follow the format of the existing metricset’s in this module? Based only on a brief look I think there are some ECS fields that could be populated either in addition to or as an alternative.
| func (m *MetricSet) reportEvent(reporter mb.PushReporterV2, event events.Message) { | ||
| time := time.Unix(event.Time, 0) | ||
|
|
||
| attributes := common.MapStr{} |
There was a problem hiding this comment.
You could allocate a map based on len(event.Actor.Attributes).
jsoriano
left a comment
There was a problem hiding this comment.
This is looking good, just a couple of comments.
| migration: true | ||
| description: > | ||
| The type of object emitting the event | ||
| - name: action |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
I want it to stay, I'm guessing I should not have put migration there 😇 ? I can open a PR to remove them 👍
There was a problem hiding this comment.
yes, otherwise they will disappear.
There was a problem hiding this comment.
@exekias BTW this is a more general discussion if we want to have fields in ECS only or also the "original" name around.
* Add docker `event` metricset
This metricset will retrieve events coming from the Docker events
API [0].
Example output:
```
"docker": {
"event": {
"id": "8c229155b039c2adcb4fab1f987f35a0d1f913dfaa95f3113ed6e4f91eb5398c",
"from": "busybox",
"type": "container",
"action": "die",
"actor": {
"id": "8c229155b039c2adcb4fab1f987f35a0d1f913dfaa95f3113ed6e4f91eb5398c",
"attributes": {
"image": "busybox",
"name": "distracted_lichterman",
"exitCode": "0"
}
},
"time": "2019-01-02T22:41:02.000Z",
"status": "die"
}
}
```
Actor attributes will container labels in the case of container
events, the module will perform dedotting (if enabled) on them.
[0] https://docs.docker.com/engine/api/v1.37/#operation/SystemEvents
* Add tests
* Update changelog
* Add missing header
* Add missing file
* Adapt to ECS
* Use a cheaper event for tests
* Close docker client on module shutdown
* Update data
* clean created container
* fix image pull
(cherry picked from commit eef102d)
* Add docker `event` metricset (#9856) * Add docker `event` metricset This metricset will retrieve events coming from the Docker events API [0]. Example output: ``` "docker": { "event": { "id": "8c229155b039c2adcb4fab1f987f35a0d1f913dfaa95f3113ed6e4f91eb5398c", "from": "busybox", "type": "container", "action": "die", "actor": { "id": "8c229155b039c2adcb4fab1f987f35a0d1f913dfaa95f3113ed6e4f91eb5398c", "attributes": { "image": "busybox", "name": "distracted_lichterman", "exitCode": "0" } }, "time": "2019-01-02T22:41:02.000Z", "status": "die" } } ``` Actor attributes will container labels in the case of container events, the module will perform dedotting (if enabled) on them. [0] https://docs.docker.com/engine/api/v1.37/#operation/SystemEvents * Add tests * Update changelog * Add missing header * Add missing file * Adapt to ECS * Use a cheaper event for tests * Close docker client on module shutdown * Update data * clean created container * fix image pull (cherry picked from commit eef102d) * Disable migration in docker event fields (#9947) * Move back docker event fields to it's namespace (#10073) * Move back docker event fields to it's namespace
This metricset will retrieve events coming from the Docker events
API [0].
Example output:
Actor attributes will contain labels in the case of container
events, the module will perform dedotting (if enabled) on them.
[0] https://docs.docker.com/engine/api/v1.37/#operation/SystemEvents
closes #6799