This project will no longer be maintained by Intel.
Intel has ceased development and contributions including, but not limited to, maintenance, bug fixes, new releases, or updates, to this project.
Intel no longer accepts patches to this project.
If you have an ongoing need to use this project, are interested in independently developing it, or would like to maintain patches for the open source software community, please create your own fork of this project.
Observability collectd is a containerized version of Collectd. The goal is to produce minimal size docker image based on Alpine linux that has most of collectd available plugins.
- Linux kernel version 3.13 or later.
- Docker version 20.10.6
Supported plugins enabled by default does not require any additional configuration and run immediately after the start of the container. By default no additional configuration is required.
To get metrics metrics from plugins disabled by default or unsupported user should provide appropriate configuration and install required dependencies on host machine. For more information on required configuration for these plugins please follow collectd wiki pages. User should remember to uncomment required configuration files located in src/collectd/sample_configs-stable
, src/collectd/sample_configs-latest
(depending on chosen --flavor
) or custom location (if --config_path
is provided) before container creation and also to deliver own configuration files for unsupported plugins.
- Install Docker 20.10.6. or newer. Docker installation guide
- Clone Observability-collectd repository
cd observability-collectd
- Execute
./collectd_intel_docker.sh build-run <image-name> <container-name>
command to build and run Docker container in default stable flavor - Execute
./collectd_intel_docker.sh logs <container-name>
to watch logs - Browse files in
/tmp/collectd/
on host to see provided metrics
Observability-collectd is prepared to run single instance of image. It is not recommended to start more than one container in parallel.
- See available options with:
./collectd_intel_docker.sh
- Build and run observability-collectd container:
./collectd_intel_docker.sh build-run <image-name> <container-name>
- Build observability-collectd image:
./collectd_intel_docker.sh build <image-name>
- Run observability-collectd Docker image:
./collectd_intel_docker.sh run <image-name> <container-name>
- Restart observability-collectd container (equivalent to:
docker restart <container-name>
):
./collectd_intel_docker.sh restart <container-name>
- Stop and remove observability-collectd container and images linked to it:
./collectd_intel_docker.sh remove <image-name> <container-name>
- Remove observability-collectd images:
./collectd_intel_docker.sh remove-build <image-name>
- Enter observability-collectd container via the bash:
./collectd_intel_docker.sh enter <container-name>
- See collectd logs with:
./collectd_intel_docker.sh logs <container-name>
Observability-collectd is based on Docker. When user creates, builds and runs containers everything behind the scenes is managed by Docker. This is why user can either use collectd_intel_docker.sh
script to prepare some containers operations (restart, logs, etc.) or pure Docker commands like docker restart <container-name>
, docker logs <container-name>
.
There are also additional flags that can be used for building the image or running the container.
- --flavor can be used to set the collectd version for image build. It can be set to one of stable or latest. The stable means most recent stable commit from main branch. Stable commit has been arbitrarily chosen as 54f7699. The latest is the most recent code from main branch (experimental feature). By default the build is made basing on stable flavor.
./collectd_intel_docker.sh build-run <image-name> <container-name> --flavor stable
- --config_path can be used to set the alternative host directory with plugins configuration when running the container. It mounts provided path as volume for container. It is not recommended to mount potentialy insecure locations (eg. /tmp), it is better to mount something like
/home/user/collectd_configuration/
. Do not provide here path to single configuration file. This option is intended to provide a directory with configuration files for particular plugins.
./collectd_intel_docker.sh run <image-name> <container-name> --config_path /opt/collectd/etc/collectd.conf.d/
- --mount_dir option can be used to mount custom directories and files in a container (this works as a Docker volume in
rw
mode). This option can be used multiple times to mount multiple directories or files. Format of parameter is/path/on/host:/path/in/container
. Path on host must point to existing directory or file. Path in a container is verified by a Docker engine and also must point to accessible resource. This option is very useful for mounting resources of plugins that are disabled by default or unsupported.
It is recommended to mount into a container only those resources from the host system that are required by individual plugins.
Avoid mounting the entire/var/run/
directory to prevent inadvertent mounting hosts' docker socket file and other sensitive resources inside the container.
Please refer to the collectd documentation to determine the requirements of each plugin. Details on configuring individual plugins can be found in the collectd repository file: colectd.conf.pod
Example below mounts DPDK root directory to enable DPDK plugin to access DPDK socket on host, it also mounts user-owned directorycollectd_metrics
to enable user an easy access to collectd metrics:
./collectd_intel_docker.sh run <image-name> <container-name> --mount_dir /var/run/dpdk:/var/run/dpdk --mount_dir /home/user/collectd_metrics:/tmp/collectd
There are few possible combinations of --flavor and --config_path flags:
- by default if no --flavor or --config_path option is set then stable container is built with default stable configuration
- if only --flavor flag is set then appropriate configuration is provided for the build (stable or latest)
- if only --config_path is set then build is made stable with given path for configuration
- if both --flavor and --config_path is set then given configuration path is set for chosen flavor
For image build some of the host environmental variables are used.
- COLLECTD_DEBUG - if set to y, the Collectd will be build with debug logs enabled, otherwise debug is disabled. It can be set for single build, for example:
COLLECTD_DEBUG=y ./collectd_intel_docker.sh build
- http_proxy and https_proxy - if set on host system, the proxy will be used during image build for network connectivity.
The main collectd configuration file is located in src/collectd/collectd.conf
.
It loads all files with plugins configuration from default (src/collectd/sample_configs-stable
) or specified (--config_path
) directory.
To modify the settings of particular plugin modify the corresponding file, for example:
src/collectd/sample_configs-stable/mcelog.conf
.
By default all configuration files are copied into image, so when user would like to edit and reload configuration there are two possible scenarios:
- rebuild and run image and container from scratch using
build
,run
orbuild-run
commands - use existing image and create container with
run
command and--config_path
option provided to mount volume with new configuration files into container. See usage examples.
To ensure everything is correct user can check collectd logs with ./collectd_intel_docker.sh logs collectd-cnt
command.
Observability-collectd is build with set of plugins. They are divided into two groups: supported and unsupported. Supported ones are partialy disabled by configuration files.
All of the plugins can be enabled but some of them (disabled and unsupported) require specific configuration and dependencies installed on host system. Unsupported plugins are normally compiled with all the others inside image but are not tested and user need to provide configuration files for them.
- capabilities
- contextswitch
- cpu
- csv
- df
- disk
- ethstat
- exec
- hugepages
- intel_rdt
- ipc
- irq
- load
- logfile
- memory
- netlink
- numa
- pcie_errors
- processes
- smart
- swap
- turbostat
- uptime
- write_prometheus
- cpufreq
- dpdk_telemetry
- intel_pmu
- ipmi
- logparser
- mcelog
- network
- ovs_events
- ovs_stats
- python
- ras
- snmp_agent
- unixsock
- virt
- write_http
- write_kafka
- write_log
- aggregation
- amqp
- apache
- apcups
- ascent
- battery
- bind
- buddyinfo
- ceph
- cgroups
- chrony
- check_uptime
- connectivity
- conntrack
- cpusleep
- curl
- curl_json
- curl_xml
- dbi
- dns
- drbd
- entropy
- fhcount
- filecount
- fscache
- hddtemp
- infiniband
- interface
- iptables
- ipvs
- log_logstash
- madwifi
- match_empty_counter
- match_hashed
- match_regex
- match_timediff
- match_value
- mbmon
- md
- mdevents
- memcachec
- memcached
- multimeter
- mysql
- nfs
- nginx
- notify_desktop
- notify_nagios
- ntpd
- olsrd
- openldap
- openvpn
- pinba
- ping
- postgresql
- powerdns
- procevent
- protocols
- redis
- rrdcached
- rrdtool
- sensors
- serial
- snmp
- statsd
- synproxy
- sysevent
- syslog
- table
- tail_csv
- tail
- target_notification
- target_replace
- target_scale
- target_set
- target_v5upgrade
- tcpconns
- teamspeak2
- ted
- thermal
- threshold
- ubi
- users
- uuid
- vmem
- vserver
- wireless
- write_graphite
- write_influxdb_udp
- write_mongodb
- write_redis
- write_sensu
- write_stackdriver
- write_syslog
- write_tsdb
- zfs_arc
- zookeeper
- Creating and running Collectd Docker image:
./collectd_intel_docker.sh build-run collectd-img collectd-cnt
This command will create and run CollectD Docker image with given collectd-img
name and run it as a collectd-cnt
named container.
- Building just the image and running it later with a separate command:
./collectd_intel_docker.sh build collectd-img
./collectd_intel_docker.sh run collectd-img collectd-cnt
- To see logs from collectd in the container:
./collectd_intel_docker.sh logs collectd-cnt
To exit viewing logs press: CTRL + C
.
- To load new collectd configuration files:
./collectd_intel_docker.sh run collectd-img collectd-cnt --config_path /home/user/collectd_config/
This will use existing collectd-img
image and create container with custom configuration provided. If collectd-cnt
already exists it needs to be removed with docker rm collectd-cnt
command.