dockerbeat

command module
v1.0.0-beta2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2016 License: Apache-2.0 Imports: 2 Imported by: 0

README

Build Status codecov.io

dockerbeat

Dockerbeat is the Beat used for docker daemon monitoring. It is a lightweight agent that installed on your servers, reads periodically docker container statistics and indexes them in Elasticsearch.

This is quite early stage and not yet released.

Exported document types

There are five types of documents exported:

  • type: container for container attributes
  • type: cpu for per process container statistics. One document per container is generated.
  • type: net for container network statistics. One document per network container is generated.
  • type: memory for container memory statistics. One document per container is generated.
  • type: blkio for container io access statistics. One document per container is generated.

To get a detailled list of all generated fields, please read the fields documentation page.

Container type
{
  "_index": "dockerbeat-2016.01.12",
  "_type": "container",
  "_id": "AVI1H82SG7YyM5rPIFuI",
  "_score": null,
  "_source": {
    "@timestamp": "2016-01-12T09:17:02.527Z",
    "beat": {
      "hostname": "machine",
      "name": "machine"
    },
    "container": {
      "command": "/docker-entrypoint.sh kibana",
      "created": "2015-08-10T15:33:10+02:00",
      "id": "7e91fbb0c7885f55ef8bf9402bbe4b366f88224c8baf31d36265061aa5ba2735",
      "image": "5f5f2d8e229dcd39efaca74ae49ee15c8344dd94dc4f0c3333f37a56942d55a5",
      "labels": {},
      "names": [
        "/kibana"
      ],
      "ports": [
        {
          "ip": "0.0.0.0",
          "privatePort": 5601,
          "publicPort": 5601,
          "type": "tcp"
        }
      ],
      "sizeRootFs": 0,
      "sizeRw": 0,
      "status": "Up 15 seconds"
    },
    "containerID": "7e91fbb0c7885f55ef8bf9402bbe4b366f88224c8baf31d36265061aa5ba2735",
    "containerName": "kibana",
    "count": 1,
    "type": "container"
  },
  "fields": {
    "@timestamp": [
      1452590222527
    ],
    "container.created": [
      1439213590000
    ]
  },
  "sort": [
    1452590222527
  ]
}
cpu type
{
  "_index": "dockerbeat-2016.01.12",
  "_type": "cpu",
  "_id": "AVI1H82SG7YyM5rPIFuJ",
  "_score": null,
  "_source": {
    "@timestamp": "2016-01-12T09:17:02.527Z",
    "beat": {
      "hostname": "machine",
      "name": "machine"
    },
    "containerID": "7e91fbb0c7885f55ef8bf9402bbe4b366f88224c8baf31d36265061aa5ba2735",
    "containerName": "kibana",
    "count": 1,
    "cpu": {
      "percpuUsage": {
        "cpu0": 0,
        "cpu1": 0,
        "cpu2": 0,
        "cpu3": 0
      },
      "totalUsage": 0,
      "usageInKernelmode": 0,
      "usageInUsermode": 0
    },
    "type": "cpu"
  },
  "fields": {
    "@timestamp": [
      1452590222527
    ]
  },
  "sort": [
    1452590222527
  ]
}
net type
{
  "_index": "dockerbeat-2016.01.12",
  "_type": "net",
  "_id": "AVI1H82SG7YyM5rPIFuM",
  "_score": null,
  "_source": {
    "@timestamp": "2016-01-12T09:17:02.527Z",
    "beat": {
      "hostname": "machine",
      "name": "machine"
    },
    "containerID": "7e91fbb0c7885f55ef8bf9402bbe4b366f88224c8baf31d36265061aa5ba2735",
    "containerName": "kibana",
    "count": 1,
    "net": {
      "name": "eth0",
      "rxBytes_ps": 5218.326579188697,
      "rxDropped_ps": 0,
      "rxErrors_ps": 0,
      "rxPackets_ps": 19.199729863640766,
      "txBytes_ps": 5097.328281610544,
      "txDropped_ps": 0,
      "txErrors_ps": 0,
      "txPackets_ps": 19.199729863640766
    },
    "type": "net"
  },
  "fields": {
    "@timestamp": [
      1452590222527
    ]
  },
  "sort": [
    1452590222527
  ]
}
memory type
{
  "_index": "dockerbeat-2016.01.12",
  "_type": "memory",
  "_id": "AVI1H82SG7YyM5rPIFuK",
  "_score": null,
  "_source": {
    "@timestamp": "2016-01-12T09:17:02.527Z",
    "beat": {
      "hostname": "machine",
      "name": "machine"
    },
    "containerID": "7e91fbb0c7885f55ef8bf9402bbe4b366f88224c8baf31d36265061aa5ba2735",
    "containerName": "kibana",
    "count": 1,
    "memory": {
      "failcnt": 0,
      "limit": 7950876672,
      "maxUsage": 74997760,
      "usage": 74817536,
      "usage_p": 0.009409973149687913
    },
    "type": "memory"
  },
  "fields": {
    "@timestamp": [
      1452590222527
    ]
  },
  "sort": [
    1452590222527
  ]
}
blkio type
{
  "_index": "dockerbeat-2016.01.12",
  "_type": "blkio",
  "_id": "AVI1H82SG7YyM5rPIFuL",
  "_score": null,
  "_source": {
    "@timestamp": "2016-01-12T09:17:02.527Z",
    "beat": {
      "hostname": "machine",
      "name": "machine"
    },
    "blkio": {
      "read": 0.5999915582387739,
      "total": 0.5999915582387739,
      "write": 0
    },
    "containerID": "7e91fbb0c7885f55ef8bf9402bbe4b366f88224c8baf31d36265061aa5ba2735",
    "containerNames": [
      "/kibana"
    ],
    "count": 1,
    "type": "blkio"
  },
  "fields": {
    "@timestamp": [
      1452590222527
    ]
  },
  "sort": [
    1452590222527
  ]
}

Elasticsearch template

To apply dockerbeat template:

curl -XPUT 'http://localhost:9200/_template/dockerbeat' -d@etc/dockerbeat.template.json

Build dockerbeat

To launch a dockerbeat, build and run the executable. Executable can be compiled either with make command (this requires a fully functional golang environment) or in a docker container.

Build with make

Just Simply run the make command at the root project directory. Your golang development environment should be fully functional).

Build in a container

If you don't have (and don't want) to setup a golang environment in your host, you can run a make dockermake to launch compilation into a golang doker container (you just need a fully functionnal docker environment).

Run dockerbeat

Project compilation generate a dockerbeat executable file in the root directory. To launch dockerbeat, run the following command:

./dockerbeat -c etc/dockerbeat.yml

Run in a docker container

The easiest way to launch dockerbeat is to run it in a container. To achieve this, use the ingensi/dockerbeat docker image, available on the docker hub.

Docker run command should:

  • mount the target Docker socket to /var/run/docker.sock
  • link an Elasticsearch node as elasticsearch

Example:

docker run -d -v /var/run/docker.sock:/var/run/docker.sock --link elastic:elasticsearch ingensi/dockerbeat:1.0.0-beta2

To override the default configuration, just link yours to /etc/dockerbeat/dockerbeat.yml:

 docker run -d -v /var/run/docker.sock:/var/run/docker.sock -v /your/custom/conf.yml:/etc/dockerbeat/dockerbeat.yml --link elastic:elasticsearch ingensi/dockerbeat:1.0.0-beta2

Contribute to the project

All contribs are welcome! Read the CONTRIBUTING documentation to get more information.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Godeps
_workspace/src/github.com/davecgh/go-spew/spew
Package spew implements a deep pretty printer for Go data structures to aid in debugging.
Package spew implements a deep pretty printer for Go data structures to aid in debugging.
_workspace/src/github.com/elastic/beats/libbeat/common/streambuf
The streambuf module provides helpers for buffering multiple packet payloads and some general parsing functions.
The streambuf module provides helpers for buffering multiple packet payloads and some general parsing functions.
_workspace/src/github.com/elastic/beats/libbeat/outputs/mode
Package mode defines and implents output strategies with failover or load balancing modes for use by output plugins.
Package mode defines and implents output strategies with failover or load balancing modes for use by output plugins.
_workspace/src/github.com/fsouza/go-dockerclient
Package docker provides a client for the Docker remote API.
Package docker provides a client for the Docker remote API.
_workspace/src/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus
Package logrus is a structured logger for Go, completely API compatible with the standard library logger.
Package logrus is a structured logger for Go, completely API compatible with the standard library logger.
_workspace/src/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/pools
Package pools provides a collection of pools which provide various data types with buffers.
Package pools provides a collection of pools which provide various data types with buffers.
_workspace/src/github.com/fsouza/go-dockerclient/external/github.com/docker/go-units
Package units provides helper function to parse and print size and time units in human-readable format.
Package units provides helper function to parse and print size and time units in human-readable format.
_workspace/src/github.com/fsouza/go-dockerclient/external/github.com/gorilla/context
Package context stores values shared during a request lifetime.
Package context stores values shared during a request lifetime.
_workspace/src/github.com/fsouza/go-dockerclient/external/github.com/gorilla/mux
Package gorilla/mux implements a request router and dispatcher.
Package gorilla/mux implements a request router and dispatcher.
_workspace/src/github.com/fsouza/go-dockerclient/external/golang.org/x/net/context
Package context defines the Context type, which carries deadlines, cancelation signals, and other request-scoped values across API boundaries and between processes.
Package context defines the Context type, which carries deadlines, cancelation signals, and other request-scoped values across API boundaries and between processes.
_workspace/src/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix
Package unix contains an interface to the low-level operating system primitives.
Package unix contains an interface to the low-level operating system primitives.
_workspace/src/github.com/fsouza/go-dockerclient/testing
Package testing provides a fake implementation of the Docker API, useful for testing purpose.
Package testing provides a fake implementation of the Docker API, useful for testing purpose.
_workspace/src/github.com/garyburd/redigo/internal/redistest
Package redistest contains utilities for writing Redigo tests.
Package redistest contains utilities for writing Redigo tests.
_workspace/src/github.com/garyburd/redigo/redis
Package redis is a client for the Redis database.
Package redis is a client for the Redis database.
_workspace/src/github.com/pmezard/go-difflib/difflib
Package difflib is a partial port of Python difflib module.
Package difflib is a partial port of Python difflib module.
_workspace/src/github.com/satori/go.uuid
Package uuid provides implementation of Universally Unique Identifier (UUID).
Package uuid provides implementation of Universally Unique Identifier (UUID).
_workspace/src/github.com/stretchr/objx
objx - Go package for dealing with maps, slices, JSON and other data.
objx - Go package for dealing with maps, slices, JSON and other data.
_workspace/src/github.com/stretchr/testify/assert
Package assert provides a set of comprehensive testing tools for use with the normal Go testing system.
Package assert provides a set of comprehensive testing tools for use with the normal Go testing system.
_workspace/src/github.com/stretchr/testify/mock
Provides a system by which it is possible to mock your objects and verify calls are happening as expected.
Provides a system by which it is possible to mock your objects and verify calls are happening as expected.
_workspace/src/gopkg.in/yaml.v2
Package yaml implements YAML support for the Go language.
Package yaml implements YAML support for the Go language.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL