|
| 1 | +.. _other-ingestion-collectd: |
| 2 | + |
| 3 | +Monitor services with collectd and OpenTelemetry |
| 4 | +===================================================================== |
| 5 | + |
| 6 | +.. meta:: |
| 7 | + :description: Use collectd and native OpenTelemetry to monitor services in Splunk Observability Cloud. See benefits, install, configuration, and metrics. |
| 8 | + |
| 9 | +To monitor your services with collectd using native OpenTelemetry in Splunk Observability Cloud, connect a collectd daemon to your Collector instance as described in this document. |
| 10 | + |
| 11 | +Benefits |
| 12 | +-------- |
| 13 | + |
| 14 | +.. raw:: html |
| 15 | + |
| 16 | + <div class="include-start" id="benefits.rst"></div> |
| 17 | + |
| 18 | +.. include:: /_includes/benefits.rst |
| 19 | + |
| 20 | +.. raw:: html |
| 21 | + |
| 22 | + <div class="include-stop" id="benefits.rst"></div> |
| 23 | + |
| 24 | + |
| 25 | +Configuration |
| 26 | +---------------------------------- |
| 27 | + |
| 28 | +This example shows how to connect a collectd daemon running on a host to an OpenTelemetry Collector. |
| 29 | + |
| 30 | +.. note:: In this example, the host is represented by an Ubuntu 24.04 docker image. |
| 31 | + |
| 32 | +1. Install and configure collectd |
| 33 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 34 | + |
| 35 | +Follow these steps to install and configure the collectd daemon: |
| 36 | + |
| 37 | +#. Install collectd as a Debian package in your host using stock instructions |
| 38 | +#. Configure the daemon to ingest free disk related metrics through `collectd/metrics.conf` |
| 39 | +#. Configure the daemon to send data over HTTP using `collectd/http.conf` |
| 40 | + |
| 41 | +.. code:: |
| 42 | +
|
| 43 | + version: "3" |
| 44 | + services: |
| 45 | + collectd: |
| 46 | + build: collectd |
| 47 | + container_name: collectd |
| 48 | + depends_on: |
| 49 | + - otelcollector |
| 50 | + volumes: |
| 51 | + - ./collectd/http.conf:/etc/collectd/collectd.conf.d/http.conf |
| 52 | + - ./collectd/metrics.conf:/etc/collectd/collectd.conf.d/metrics.conf |
| 53 | + |
| 54 | + # OpenTelemetry Collector |
| 55 | + otelcollector: |
| 56 | + image: quay.io/signalfx/splunk-otel-collector:latest |
| 57 | + container_name: otelcollector |
| 58 | + command: ["--config=/etc/otel-collector-config.yml", "--set=service.telemetry.logs.level=debug"] |
| 59 | + volumes: |
| 60 | + - ./otel-collector-config.yml:/etc/otel-collector-config.yml |
| 61 | +
|
| 62 | +2. Configure the OpenTelemetry Collector |
| 63 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 64 | + |
| 65 | +Set up your Collector instance to listen for traffic from the collectd daemon over HTTP with the :ref:`collectd-receiver`: |
| 66 | + |
| 67 | +.. code:: yaml |
| 68 | +
|
| 69 | + receivers: |
| 70 | + collectd: |
| 71 | + endpoint: "0.0.0.0:8081" |
| 72 | +
|
| 73 | + exporters: |
| 74 | + debug: |
| 75 | + verbosity: detailed |
| 76 | +
|
| 77 | + service: |
| 78 | + pipelines: |
| 79 | + metrics: |
| 80 | + receivers: [collectd] |
| 81 | + exporters: [debug] |
| 82 | +
|
| 83 | +.. caution:: Make sure to use ``0.0.0.0`` to expose port 8081 over the Docker network interface so that both Docker containers can interact. |
| 84 | + |
| 85 | +3. Run the example |
| 86 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 87 | + |
| 88 | +Run the example with the instruction to start the docker-compose setup and build the collectd container: |
| 89 | + |
| 90 | +.. code:: bash |
| 91 | +
|
| 92 | + $> docker compose up --build |
| 93 | +
|
| 94 | +Check that the Collector is receiving metrics and logging them to ``stdout`` via the debug exporter: |
| 95 | + |
| 96 | +.. code:: bash |
| 97 | +
|
| 98 | + $> docker logs otelcollector |
| 99 | +
|
| 100 | +A typical output is: |
| 101 | + |
| 102 | +.. code:: |
| 103 | +
|
| 104 | + StartTimestamp: 1970-01-01 00:00:00 +0000 UTC |
| 105 | + Timestamp: 2024-12-20 19:55:44.006000128 +0000 UTC |
| 106 | + Value: 38.976566 |
| 107 | + Metric #17 |
| 108 | + Descriptor: |
| 109 | + -> Name: percent_bytes.reserved |
| 110 | + -> Description: |
| 111 | + -> Unit: |
| 112 | + -> DataType: Gauge |
| 113 | + NumberDataPoints #0 |
| 114 | + Data point attributes: |
| 115 | + -> plugin: Str(df) |
| 116 | + -> plugin_instance: Str(etc-hosts) |
| 117 | + -> host: Str(ea1d62c7a229) |
| 118 | + -> dsname: Str(value) |
| 119 | + StartTimestamp: 1970-01-01 00:00:00 +0000 UTC |
| 120 | + Timestamp: 2024-12-20 19:55:44.006000128 +0000 UTC |
| 121 | + Value: 5.102245 |
| 122 | + {"kind": "exporter", "data_type": "metrics", "name": "debug"} |
| 123 | +
|
| 124 | +Troubleshooting |
| 125 | +--------------- |
| 126 | + |
| 127 | +.. raw:: html |
| 128 | + |
| 129 | + <div class="include-start" id="troubleshooting-components.rst"></div> |
| 130 | + |
| 131 | +.. include:: /_includes/troubleshooting-components.rst |
| 132 | + |
| 133 | +.. raw:: html |
| 134 | + |
| 135 | + <div class="include-stop" id="troubleshooting-components.rst"></div> |
| 136 | + |
| 137 | + |
| 138 | + |
0 commit comments