{"id":13558680,"url":"https://github.com/signalfx/docker-collectd","last_synced_at":"2025-04-03T13:31:51.170Z","repository":{"id":51363827,"uuid":"44349906","full_name":"signalfx/docker-collectd","owner":"signalfx","description":"Collectd within a Docker image ","archived":true,"fork":false,"pushed_at":"2019-06-14T10:00:52.000Z","size":89,"stargazers_count":58,"open_issues_count":0,"forks_count":14,"subscribers_count":91,"default_branch":"master","last_synced_at":"2024-11-04T09:37:32.277Z","etag":null,"topics":["collectd","docker","docker-collectd","docker-container","docker-image","metrics","report-metrics"],"latest_commit_sha":null,"homepage":"https://quay.io/repository/signalfuse/collectd","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/signalfx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-15T22:48:48.000Z","updated_at":"2024-03-12T12:39:52.000Z","dependencies_parsed_at":"2022-09-11T17:24:19.363Z","dependency_job_id":null,"html_url":"https://github.com/signalfx/docker-collectd","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/signalfx%2Fdocker-collectd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/signalfx%2Fdocker-collectd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/signalfx%2Fdocker-collectd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/signalfx%2Fdocker-collectd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/signalfx","download_url":"https://codeload.github.com/signalfx/docker-collectd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247009682,"owners_count":20868589,"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":["collectd","docker","docker-collectd","docker-container","docker-image","metrics","report-metrics"],"created_at":"2024-08-01T12:05:05.804Z","updated_at":"2025-04-03T13:31:50.911Z","avatar_url":"https://github.com/signalfx.png","language":"Shell","funding_links":[],"categories":["Shell","docker"],"sub_categories":[],"readme":"# docker-collectd\n\n## Description\n\n[collectd](http://collectd.org) is a daemon which collects system performance\nstatistics periodically and provides mechanisms to store the values in a\nvariety of ways, for example in RRD files.\n\nThis image allows you to run collectd in a completely containerized\nenvironment, but while retaining the ability to report statistics about the\n_host_ the collectd container is running on.\n\nThe SignalFx collectd Docker plugin is also included, and will report metrics\nabout your containers.\n\n## Image Options\n\n| Base Image | Image Name |\n| ---------- | ------------ |\n| Ubuntu | `quay.io/signalfuse/collectd` |\n| Alpine Linux |  `quay.io/signalfuse/collectd-alpine` |\n\n## How to use this image\n\nRun collectd with the default configuration with the following command:\n\n```\ndocker run --privileged \\\n  --net=\"host\" \\\n  -e \"SF_API_TOKEN=ORG_ACCESS_TOKEN\" \\\n  -e \"SF_INGEST_HOST=ingest.YOUR_SIGNALFX_REALM.signalfx.com\"\n  -v /:/hostfs:ro \\\n  -v /var/run/docker.sock:/var/run/docker.sock \\\n  quay.io/signalfuse/collectd\n```\n\nIf you don't want to report Docker metrics from the SignalFx Docker collectd \nplugin, then you can leave out the argument that mounts\nthe Docker socket `-v /var/run/docker.sock:/var/run/docker.sock`.\n\n```\ndocker run --privileged \\\n  --net=\"host\" \\\n  -e \"SF_API_TOKEN=ORG_ACCESS_TOKEN\" \\\n  -e \"SF_INGEST_HOST=ingest.YOUR_SIGNALFX_REALM.signalfx.com\" \\\n  -v /:/hostfs:ro \\\n  quay.io/signalfuse/collectd\n```\n\nIf you just want to look around inside the image, you can run `bash`.\nThen you can run `/opt/setup/run.sh` yourself to configure the bind mount\nand start collectd.\n\n```\ndocker run -ti --privileged \\\n  --net=\"host\" \\\n  -e \"SF_API_TOKEN=ORG_ACCESS_TOKEN\" \\\n  -e \"SF_INGEST_HOST=ingest.YOUR_SIGNALFX_REALM.signalfx.com\" \\\n  -v /:/hostfs:ro \\\n  -v /var/run/docker.sock:/var/run/docker.sock \\\n  quay.io/signalfuse/collectd bash\n```\n\nIf you don't want to pass your API token through a command-line argument, you\ncan put `SF_API_TOKEN=ORG_ACCESS_TOKEN` into a file (that you can\n`chmod 600`) and use the `--env-file` command-line argument:\n\n```\ndocker run --privileged --env-file=token.env \\\n  --net=\"host\" \\\n  -e \"SF_INGEST_HOST=ingest.YOUR_SIGNALFX_REALM.signalfx.com\" \\\n  -v /var/run/docker.sock:/var/run/docker.sock \\\n  -v /:/hostfs:ro \\\n  quay.io/signalfuse/collectd\n```\n\nIf you want to apply custom dimensions and values to all metrics, you set the \nenvironment variable `DIMENSIONS` to a string of space separated  Key/Value \npairs defined `KEY=VALUE`.\n\n```\ndocker run --privileged --env-file=token.env \\\n  --net=\"host\" \\\n  -e DIMENSIONS=\"hello=world foo=bar\" \\\n  -e \"SF_API_TOKEN=ORG_ACCESS_TOKEN\" \\\n  -e \"SF_INGEST_HOST=ingest.YOUR_SIGNALFX_REALM.signalfx.com\" \\\n  -v /var/run/docker.sock:/var/run/docker.sock \\\n  -v /:/hostfs:ro \\\n  quay.io/signalfuse/collectd\n```\n\nOn CoreOS because /etc/*-release are symlinks you want to mount\n/usr/share/coreos in place of /etc.\n\n```\ndocker run --privileged \\\n  --net=\"host\" \\\n  -e \"SF_API_TOKEN=ORG_ACCESS_TOKEN\" \\\n  -e \"SF_INGEST_HOST=ingest.YOUR_SIGNALFX_REALM.signalfx.com\" \\\n  -v /:/hostfs:ro \\\n  -v /var/run/docker.sock:/var/run/docker.sock \\\n  quay.io/signalfuse/collectd\n```\n\nIf you're using the dogstatsd listener in the SignalFx plugin.  You will need to expose the container port and\nspecify the port with an environment variable.\n```\ndocker run --privileged \\\n  --net=\"host\" \\\n  -e \"SF_API_TOKEN=ORG_ACCESS_TOKEN\" \\\n  -e \"SF_INGEST_HOST=ingest.YOUR_SIGNALFX_REALM.signalfx.com\" \\\n  -e DOG_STATSD_PORT=8126 \\\n  -p 8126:8126 \\\n  -v /var/run/docker.sock:/var/run/docker.sock \\\n  -v /:/hostfs:ro \\\n  quay.io/signalfuse/collectd\n```\n\n## FAQ\n\n### Do I need to run the container as privileged?\n\nYes. Collectd needs access to the parent host's `/proc` filesystem to get\nstatistics. It's possible to run collectd without passing the parent host's\n`/proc` filesystem without running the container as privileged, but the metrics\nwould not be accurate.\n\n### Do I need to provide the network flag?\n\nYes.  Setting the `--net` option to `\"host\"` allows the container to see the host's networking stack and provide accurate information.\n\n\n### Do I need to mount the host's / to /hostfs?\n\nThis is a requirement for the collectd to accurately report information about the underlying host.\n\n### Do I need to provide a host name?\n\nYou may set `FQDN_LOOKUP` to `true` to enable collectd to perform an FQDN look up, but this may not work in all circumstances.\nIf a lookup fails the container will exit and log a message indicating that fqdn lookup failed.\nYou may optionally set the environment variable using the runtime\noption `-e \"COLLECTD_HOSTNAME=\u003chostname\u003e\"` where `\u003chostname\u003e` is a\nvalid host name string. You may also set the environment variable in an optional\nenvironment file.  If a host name is not specified `/hostfs/etc/hostname` name will be used.\nThe container will exit with an error if `FQDN_LOOKUP` is not true, `COLLECTD_HOSTNAME` is not set, and hostname can't\nbe found under `/hostfs/etc/hostname`.\n\n### Can I configure anything?\n\nYes! You are required to set the `SF_API_TOKEN`,\nbut you also can set the following:\n\n| Environment Variable | Description | Example |\n| -------------------- | ----------- | ------- |\n| `COLLECTD_BUFFERSIZE` | If set we will set `write_http`'s buffersize to the value provided, otherwise a default value of 16384 will be used. | `-e \"COLLECTD_BUFFERSIZE=\u003csize\u003e\"` |\n| `COLLECTD_CONFIGS` | If set we will include `$COLLECTD_CONFIGS/*.conf` in collectd.conf where you can include any other plugins you want to enable. These of course would need to be mounted in the container with -v. | `-e \"COLLECTD_CONFIGS=\u003cpath to confs\u003e\"` |\n| `COLLECTD_FLUSHINTERVAL` | if set we will set `write_http`'s flush interval to the value provided, otherwise a default value of what COLLECTD_INTERVAL is set to will be used. | `-e \"COLLECTD_FLUSHINTERVAL=\u003cinterval\u003e\"` |\n| `FQDN_LOOKUP=true` | If set to [ True, true, or TRUE ], then collectd will be configured to use FQDNLook up to identify the value for host.\n| `COLLECTD_HOSTNAME` | If set and `FQDN_LOOKUP` is unset or false, then we will set the collectd hostname to the supplied value in `/etc/collectd/collectd.conf`.  If the environment variable is not set, we will attempt to cat `/mnt/hostname` for the host's hostname.  If no hostname is discovered, we will exit with an error code of 1 and display a message indicating that a hostname could not be found. | `-e \"COLLECTD_HOSTNAME=\u003chostname\u003e\"` |\n| `USE_AWS_UNIQUE_ID_AS_HOSTNAME` | If non-empty, the hostname will be set to the AWS Unique ID, which is determined using the EC2 metadata endpoint.  This is useful in ECS clusters where the container's hostname might be localhost.  Note that you will also have a dimension called AWSUniqueId with the same value as the `host` dimension.  This is necessary duplication because we do property syncing to the `AWSUniqueId` dimension and not to `host`. | `-e USE_AWS_UNIQUE_ID_AS_HOSTNAME=true` |\n| `COLLECTD_INTERVAL` | If set we will use the specified interval for collectd and the plugin, otherwise the default interval is 10 seconds. | `-e \"COLLECTD_INTERVAL=\u003cinterval\u003e\"` |\n| `WRITE_HTTP_TIMEOUT` | If set we will set `write_http`'s timeout to the value provided, otherwise the default value of WRITE_HTTP_TIMEOUT will be `9000`. | `-e WRITE_HTTP_TIMEOUT=9000` |\n| `LOG_HTTP_ERROR` | If set we will set `write_http`'s LogHttpError settting to the value provided, otherwise the default value of LOG_HTTP_ERROR will be `false`. | `-e LOG_HTTP_ERROR=false` |\n| `DIMENSIONS` | If set with a string of space separated `key=value` dimension pairs, then each metric dipatched will be tagged with those dimensions. | `-e DIMENSIONS=\"foo=bar hello=world\"` |\n| `DISABLE_AGGREGATION` | If set to [ True, true, or TRUE ], disables the collectd aggregation plugin | `-e \"DISABLE_AGGREGATION=True\"` |\n| `DISABLE_CPU` | If set to [ True, true, or TRUE ], disables the collectd cpu plugin | `-e \"DISABLE_CPU=True\"` |\n| `DISABLE_CPUFREQ` | If set to [ True, true, or TRUE ], disables the collectd cpu frequency plugin | `-e \"DISABLE_CPUFREQ=True\"` |\n| `DISABLE_DF` | If set to [ True, true, or TRUE ], disables the collectd df plugin | `-e \"DISABLE_DF=True\"` |\n| `DISABLE_DISK` | If set to [ True, true, or TRUE ], disables the collectd disk plugin | `-e \"DISABLE_DISK=True\"` |\n| `DISABLE_DOCKER` | If set to [ True, true, or TRUE ], disables the collectd docker plugin | `-e \"DISABLE_DOCKER=True\"` |\n| `DISABLE_HOST_MONITORING` | If set to [ True, true, or TRUE ], disables the collectd aggregation, cpu, cpu frequency, df, disk, docker, interface, load, memory, protocols, vmem, uptime, SignalFx collectd, and write http plugins | `-e \"DISABLE_HOST_MONITORING=True\"` |\n| `DISABLE_INTERFACE` | If set to [ True, true, or TRUE ], disables the collectd interface plugin | `-e \"DISABLE_INTERFACE=True\"` |\n| `DISABLE_LOAD` | If set to [ True, true, or TRUE ], disables the collectd load plugin | `-e \"DISABLE_LOAD=True\"` |\n| `DISABLE_MEMORY` | If set to [ True, true, or TRUE ], disables the collectd memory plugin | `-e \"DISABLE_MEMORY=True\"` |\n| `DISABLE_PROTOCOLS` | If set to [ True, true, or TRUE ], disables the collectd protocols plugin | `-e \"DISABLE_PROTOCOLS=True\"` |\n| `DISABLE_VMEM` | If set to [ True, true, or TRUE ], disables the collectd vmem plugin | `-e \"DISABLE_VMEM=True\"` |\n| `DISABLE_UPTIME` | If set to [ True, true, or TRUE ], disables the collectd uptime plugin | `-e \"DISABLE_UPTIME=True\"` |\n| `DISABLE_SFX_PLUGIN` | If set to [ True, true, or TRUE ], disables the SignalFx collectd plugin | `-e \"DISABLE_SFX_PLUGIN=True\"` |\n| `DISABLE_WRITE_HTTP` | If set to [ True, true, or TRUE ], disables the collectd write http plugin | `-e \"DISABLE_WRITE_HTTP=True\"` |\n| `DISABLE_AGENT_PROCESS_STATS` | If set to [True, true, or TRUE ], disables metrics about the collectd process | `-e \"DISABLE_AGENT_PROCESS_STATS=True\"` |\n| `PER_CORE_CPU_UTIL` | If set to [True, true, or TRUE], configures the SignalFx collectd plugin to report CPU utilization per core | `-e \"PER_CORE_CPU_UTIL=True` |\n| `DOG_STATSD_PORT` | If specified, configures the SignalFx collectd plugin to read DogStatsdD metrics over the configured port.  You must also expose this port on the container. | `-e \"STATSD_PORT=8126` |\n| `DOCKER_TIMEOUT` | The number of seconds calls to the Docker API should wait to timeout | `-e \"DOCKER_TIMEOUT=3\"` |\n| `DOCKER_INTERVAL` | If set we will use the specified interval for the docker plugin, otherwise the global collectd interval (defaulted to 10 secs) will be used | `-e \"DOCKER_INTERVAL=10\"` |\n| `SF_INGEST_HOST` | Will set the ingest url on the signalfx metadata plugin and on collectd itself | `-e \"SF_INGEST_HOST=http://ingest.proxy.com\" ` |\n\n### Extending\n[Click this link to read about Extending SignalFx Docker collectd image](./docs/EXTENDING.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsignalfx%2Fdocker-collectd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsignalfx%2Fdocker-collectd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsignalfx%2Fdocker-collectd/lists"}