Collectd plugin π
Description π
The Splunk Distribution of OpenTelemetry Collector provides this integration as the collectd/custom
monitor type for the Smart Agent Receiver. This monitor lets you provide a custom collectd configuration to be run by the managed collectd instance.
Note
This monitor is not available on Windows as collectd plugins are only supported in Linux and Kubernetes.
You can provide configurations for as many plugins as you want in a single instance of this monitor configuration by either putting multiple <Plugin>
blocks in a single template
option or by specifying multiple templates
.
Note that a distinct instance of collectd is run for each instance of this monitor, so it is more efficient to group plugin configurations into a single monitor configuration (either in one large template
text blob or split into multiple templates
). If using a discoveryRule
, do not group configurations to avoid creating a duplicate configuration for each instance of the service endpoint discovered.
You can also use your own Python plugins in conjunction with the ModulePath
option in collectd-python
. If your Python plugin has dependencies of its own, you can specify the path to them by specifying multiple ModulePath
options with those paths.
Hereβs an example of a configuration with a custom Python plugin:
- type: collectd/custom
discoveryRule: container_image =~ "myservice"
template: |
LoadPlugin "python"
<Plugin python>
ModulePath "/usr/lib/python2.7/dist-packages/health_checker"
Import "health_checker"
<Module health_checker>
URL "http://{{.Host}}:{{.Port}}"
JSONKey "isRunning"
JSONVal "1"
</Module>
</Plugin>
There are many collectd plugins included in the container image that are not exposed as monitors. You can see the plugins in the <AGENT_BUNDLE>/lib/collectd
directory, where <AGENT_BUNDLE>
is the root of the file system in the containerized version, and is normally /usr/lib/signalfx-agent
in the non-containerized agent.
Running the collectd/exec plugin π
You can use the collectd/custom
monitor to run the collectd/exec
plugin. If you are not running the Smart Agent in the container, you can use any appropriate user on your system.
If you are running the Smart Agent in a container, then you need to use a non-root user when you run your script, as shown in the following example:
- type: collectd/custom
template: |
LoadPlugin exec
<Plugin exec>
Exec "`non-root user`" "/path/to/script.sh"
</Plugin>
Replace non-root user
with an actual non-root user on your host.
Installation π
This monitor is available in the Smart Agent Receiver, which is part of the Splunk Distribution of OpenTelemetry Collector.
To install this integration:
Deploy the Splunk Distribution of OpenTelemetry Collector to your host or container platform.
Configure the monitor, as described in the next section.
Configuration π
This Splunk Distribution of OpenTelemetry Collector allows embedding a Smart Agent monitor configuration in an associated Smart Agent Receiver instance.
Note: Providing a Custom monitor entry in your Collector or Smart Agent (deprecated) configuration is required for its use. Use the appropriate form for your agent type.
Splunk Distribution of OpenTelemetry Collector π
To activate this monitor in the Splunk Distribution of OpenTelemetry Collector, add the following to your agent configuration:
receivers:
smartagent/custom:
type: collectd/custom
... # Additional config
See configuration examples for specific use cases that show how the Splunk Distribution of OpenTelemetry Collector can integrate and complement existing environments.
Smart Agent π
To activate this monitor in the Smart Agent, add the following to your agent configuration:
monitors: # All monitor config goes under this key
- type: collectd/custom
... # Additional config
See Smart Agent example configuration for an autogenerated example of a YAML configuration file, with default values where applicable.
Configuration settings π
The following table shows the configuration options for this monitor:
Option |
Required |
Type |
Description |
---|---|---|---|
|
no |
|
This option is filled in by the agent if using service discovery. It can be accessed in the provided configuration template with |
|
no |
|
This option is filled in by the agent if using service discovery. It can be accessed in the provided configuration template with |
|
no |
|
This option is filled in by the agent if using service discovery. It can be accessed in the provided configuration template with |
|
no |
|
A configuration template for collectd. You can include as many plugin blocks as you want in this value. It is rendered as a standard Go template, so be mindful of the delimiters |
|
no |
|
A list of templates, but otherwise equivalent to the above |
|
no |
|
The number of read threads to use in collectd. This option defaults to the number of templates provided, capped at 10, but if you manually specify it, there is no limit. (default: |
Metrics π
The Splunk Distribution of OpenTelemetry Collector does not do any built-in filtering of metrics coming out of this monitor.
Get help π
If you are not able to see your data in Splunk Observability Cloud, try these tips:
Submit a case in the Splunk Support Portal
Available to Splunk Observability Cloud customers
-
Available to Splunk Observability Cloud customers
Ask a question and get answers through community support at Splunk Answers
Available to Splunk Observability Cloud customers and free trial users
Join the Splunk #observability user group Slack channel to communicate with customers, partners, and Splunk employees worldwide
Available to Splunk Observability Cloud customers and free trial users
To learn how to join, see Get Started with Splunk Community - Chat groups
To learn about even more support options, see Splunk Customer Success.