{"id":13451691,"url":"https://github.com/Ingensi/dockbeat","last_synced_at":"2025-03-23T19:32:31.081Z","repository":{"id":64306787,"uuid":"43419931","full_name":"Ingensi/dockbeat","owner":"Ingensi","description":"Dockbeat - the elastic Beat for docker daemon monitoring","archived":false,"fork":false,"pushed_at":"2018-01-15T09:23:07.000Z","size":26320,"stargazers_count":286,"open_issues_count":24,"forks_count":70,"subscribers_count":23,"default_branch":"develop","last_synced_at":"2024-10-28T18:15:50.552Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ingensi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-30T08:00:05.000Z","updated_at":"2024-09-27T11:33:52.000Z","dependencies_parsed_at":"2023-01-15T10:45:33.933Z","dependency_job_id":null,"html_url":"https://github.com/Ingensi/dockbeat","commit_stats":null,"previous_names":["ingensi/dockerbeat"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ingensi%2Fdockbeat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ingensi%2Fdockbeat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ingensi%2Fdockbeat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ingensi%2Fdockbeat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ingensi","download_url":"https://codeload.github.com/Ingensi/dockbeat/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245158089,"owners_count":20570117,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T07:00:59.279Z","updated_at":"2025-03-23T19:32:26.119Z","avatar_url":"https://github.com/Ingensi.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# Dockbeat\n\n(if you're on the fast lane, check the TL;DR at the bottom of the readme)\n\nBuild status : [![Build Status](https://travis-ci.org/Ingensi/dockbeat.svg?branch=develop)](https://travis-ci.org/Ingensi/dockbeat)\n\nTest coverage : [![codecov.io](http://codecov.io/github/Ingensi/dockbeat/coverage.svg?branch=develop)](http://codecov.io/github/Ingensi/dockbeat?branch=develop)\n\nDockbeat is the new Dockerbeat name. We had to rename the project due to the [Docker trademarking policy](https://www.docker.com/trademark-guidelines). Dockbeat is a [Beat](https://www.elastic.co/products/beats) 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.\n\n## Exported document types\n\nThere are five types of documents exported:\n\n- `type: container`: container attributes\n- `type: cpu`: container CPU usage statistics. One document per container is generated.\n- `type: net`: container network statistics. One document per network container is generated.\n- `type: memory`: container memory statistics. One document per container is generated.\n- `type: blkio`: container io access statistics. One document per container is generated.\n- `type: log`: dockbeat status information. One document per tick is generated if an error occurred.\n\nTo get a detailed list of all generated fields, please read the [fields documentation page](docs/fields.asciidoc).\n\n## Elasticsearch template \n\nTo apply Dockbeat template (recommended but not required) :\n\n```bash\ncurl -XPUT 'http://elastic:9200/_template/dockbeat' -d@etc/dockbeat.template.json\n```\n    \n## Build Dockbeat\n\nEnsure that this folder is at the following location:\n`${GOPATH}/github.com/ingensi`\n\n\n### Requirements\n\n* [Golang](https://golang.org/dl/) 1.7\n* [Glide](https://github.com/Masterminds/glide) \u003e= 0.10.0\n\n\n### Build\n\nTo build the binary for Dockbeat run the command below. This will generate a binary\nin the same directory with the name dockbeat.\n\n```\nmake\n```\n \n## Run dockbeat\n\nProject compilation generate a `dockbeat` executable file in the root directory. To launch dockbeat, run the following command:\n\n```bash\n./dockbeat -c etc/dockbeat.yml\n```\n\n## Run in a docker container\n\nThe easiest way to launch dockbeat is to run it in a container. To achieve this, use the `ingensi/dockbeat` docker image, available on the [docker hub](https://hub.docker.com/r/ingensi/dockbeat/).\n\nDocker run command should:\n\n* mount the target Docker socket to `/var/run/docker.sock`\n* link an Elasticsearch node as `elasticsearch`\n\nExample:\n\n```\ndocker run -d -v /var/run/docker.sock:/var/run/docker.sock \\\n  --link elastic:elasticsearch ingensi/dockbeat:1.0.0-rc3\n```\n\nTo override the default configuration, just link yours to `/etc/dockbeat/dockbeat.yml`:\n\n```\ndocker run -d --link elastic:elasticsearch \\\n  -v /var/run/docker.sock:/var/run/docker.sock \\\n  -v /volumes/dockbeat-config/:/etc/dockbeat \\\n  ingensi/dockbeat:1.0.0-rc3\n```\n\nBy default, when dockbeat is running from this image, it logs into the `/var/log/dockbeat` directory. To access this logs from the host, link a directory to the dockbeat logging directory:\n```\ndocker run -d --link elastic:elasticsearch \\\n  -v /var/run/docker.sock:/var/run/docker.sock \\\n  -v /volumes/dockbeat-config/:/etc/dockbeat \\\n  -v /volumes/dockbeat-logs/:/var/logs/dockbeat \\\n  ingensi/dockbeat:1.0.0-rc3\n```\n\n### Configuring Dockbeat\n\nDockbeat configuration file is located at `etc/dockbeat.yml`. This default template provides the following environment variable mapping:\n\n  - How often to read server statistics \n    - ENV : `PERIOD`\n    - Beats variable : `input.period`\n    - Default value : `5`\n  - Docker socket path\n    - ENV : `DOCKER_SOCKET`\n    - Beats variable : `input.socket`\n    - Default value : `unix:///var/run/docker.sock`\n  - Enable TLS encryption\n    - ENV : `DOCKER_ENABLE_TLS`\n    - Beats variable : `input.tls.enable`\n    - Default value : `false`\n  - Path to the CA file (when TLS is enabled)\n    - ENV : `DOCKER_CA_PATH`\n    - Beats variable : `input.tls.ca_path`\n    - Default value : no default value\n  - Path to the CERT file (when TLS is enabled)\n    - ENV : `DOCKER_CERT_PATH`\n    - Beats variable : `input.tls.cert_path`\n    - Default value : no default value\n  - Path to the KEY file (when TLS is enabled)\n    - ENV : `DOCKER_KEY_PATH`\n    - Beats variable : `input.tls.key_path`\n    - Default value : no default value\n                                       \nWhen launching it inside a docker container, you can modify the environment variables using the `-e` flag :\n\n```bash\ndocker run -d \\\n  -v /var/run/docker.sock:/another/path.sock  \\\n  --link elastic1:es1 \\\n  --link elastic2:es2 \\\n  -e PERIOD=30 \\\n  -e DOCKER_SOCKET=unix:///another/path.sock \\\n  ingensi/dockbeat:1.0.0-rc3\n```\n\n### Contribute to the project\n\nAll contribs are welcome! Read the [CONTRIBUTING](CONTRIBUTING.md) documentation to get more information.\n\n### TL;DR\n\nI want to monitor a host :\n(If kibana can't join elastic, check its network configuration.)\n\n```\n$ docker network create dockernet\n\n$ docker run -d --net=dockernet --name=elastic \\\n  -v /mnt/volumes/elastic/config:/usr/share/elasticsearch/config \\\n  -v /mnt/volumes/elastic/data:/usr/share/elasticsearch/data \\\n  elasticsearch:2.2.0\n\n$ docker run -d --net=dockernet --name=kibana -p 5601:5601 \\\n  -e ELASTICSEARCH_URL=http://elastic:9200 \\\n  kibana:4.4.1\n\n$ docker run -d --net=dockernet --name=dockbeat \\\n  -v /var/run/docker.sock:/var/run/docker.sock \\\n  -v /mnt/dv/dockbeat:/etc/dockbeat ingensi/dockbeat:latest\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FIngensi%2Fdockbeat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FIngensi%2Fdockbeat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FIngensi%2Fdockbeat/lists"}