collectd #3

Supports: trusty bionic focal

Description

collectd is a small daemon which collects system information periodically and provides mechanisms to monitor and store the values in a variety of ways. Since the daemon doesn't need to startup every time it wants to update the values it's very fast and easy on the system. Also, the statistics are very fine grained since the files are updated every 10 seconds by default. The collected information can be used to find current performance bottlenecks (performance analysis) and predict future system load (capacity planning). This charm was initially developed and maintained by Prometheus Charmers


Juju collectd subordinate charm

This subordinate charm will deploy collectd daemon

Supports: Trusty, Bionic, Focal

Available features

  • Added support for bionic.
  • "write_prometheus" plugin support enabled by default.
  • Option "prometheus_output_port" to publish metrics in a custom port.
  • Added support for collectd and Prometheus Juju relation.
  • Support extra plugin configuration via charm option.
  • Fix clean-up logic when the unit removes

Prometheus Output

By default, write_prometheus plugin enabled and can be used for metrics scraping without using any additional exporter.

How to deploy the charm

The charm relates with any principal charm using juju-info interface. Assuming that the principal service is ubuntu.

juju deploy cs:~open-charmers/collectd collectd
# and 
juju add-relation ubuntu collectd

To send metrics to the graphite server listening on 192.168.99.10 port 2003:

juju set collectd graphite_endpoint=192.168.99.10:2003

To expose metrics for prometheus on port 9104 under "/metrics" API path:

juju config collectd prometheus_output_port="9104"

See config.yaml for more details about configuration options


Configuration

default_package
(boolean) If set to False, packages added under files/ are considered. Version: 5.11, Repo source: archive.ubuntu.com
True
extra_config
(string) Extra plugin configuration added and enabled based on the option 'plugins'. No pre-installation validation for the added config lines. Note: To enable the plugins, add plugins: "syslog, df" example: <Plugin "syslog"> LogLevel "info" NotifyLevel "OKAY" </Plugin> <Plugin "df"> IgnoreSelected true </Plugin>
graphite_endpoint
(string) Optional graphite hostname(or IP) and port. For example: graphite.example.com:2003 If set write_graphite will be enabled and configured
graphite_prefix
(string) Prepended to unit hostname in graphite. Only used in graphite_endpoint is set
collectd.
graphite_protocol
(string) TCP or UDP. Only used if graphite_endpoint is set
TCP
hostname_type
(string) Controls how hostname is determined by collectd. Accepted values are: fqdn - sets "FQDNLookup true" in the collectd.conf hostname - use python socket.gethostname() to get hostname. Useful in clouds where FQDN lookup does not work If unset or set to empty string defaults to fqdn
install_keys
(string) YAML list of GPG keys for installation sources, as a string. For apt repository URLs, use the public key ID used to verify package signatures. For other sources such as PPA, use empty string. This list must have the same number of elements as install_sources, even if the key items are all empty string. An example to go with the above for install_sources: install_keys: | - "" - ""
install_sources
(string) YAML list of additional installation sources, as a string. The number of install_sources must match the number of install_keys. For example: install_sources: | - ppa:project1/ppa - ppa:project2/ppa
interval
(int) Interval at which to query values by default
10
nagios_context
(string) A string that will be prepended to instance name to set the host name in nagios. So for instance the hostname would be something like: juju-myservice-0 If you're running multiple environments with the same services in them this allows you to differentiate between them.
juju
nagios_servicegroups
(string) Comma separated list of nagios servicegroups for the graphite check
juju
network_target
(string) Configured collectd to send data over network to remote collectd intance. Example: 192.168.99.99:25826
plugins
(string) Comma separated list of plugins to enable. If set to "default" list of plugins will match defaults shipped with Ubuntu package
default
prometheus_output_port
(string) If set write_prometheus output plugin will be configured to listen on the provided port. If set to string "default" the charm will use default port (9104)"
9104