Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.

Commit 18edcd6

Browse files
Update telegraf.rst
More edits
1 parent e83fcb0 commit 18edcd6

File tree

1 file changed

+55
-20
lines changed

1 file changed

+55
-20
lines changed

gdi/monitors-monitoring/telegraf.rst

Lines changed: 55 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
.. _telegraf:
22

3-
Telegraf Exec (OpenTelemetry)
4-
==============================
3+
Monitor services with Telegraf and OpenTelemetry
4+
========================================================
55

66
.. meta::
77
:description: Use this Splunk Observability Cloud integration for the Telegraf monitor. See benefits, install, configuration, and metrics.
88

9-
To monitor your system with Telegraf Exec using native OpenTelemetry, install the Telegraf plugin independently, then push metrics to the Splunk Opentelemetry Collector
9+
To monitor your service with Telegraf using native OpenTelemetry in Splunk Observability Cloud, install the service's Telegraf plugin then push metrics to the Splunk Opentelemetry Collector
1010
via OTLP.
1111

1212
.. note:: This setup is designed for a Linux Ubuntu OS but should be replicable on any machines running Linux OS with Debian flavor. These instructions might not work on other OS (MacOS/Windows).
@@ -21,11 +21,12 @@ Configuration
2121

2222
Follow these steps to scrape Telegraf metrics with the OTel Collector:
2323

24-
1. Install the Telegraf Exec Input plugin
25-
2. Set up the OpenTelemetry Output plugin
26-
3. Configure the OpenTelemetry Collector
24+
1. Install Telegraf
25+
2. Set up your service's Telegraf Input plugin
26+
3. Set up the Telegraf OpenTelemetry Output plugin
27+
4. Configure the OpenTelemetry Collector
2728

28-
1. Install the Telegraf Exec Input Plugin plugin
29+
1. Install Telegraf
2930
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3031

3132
Run the following commands to install Telegraf from the InfluxData repository:
@@ -40,7 +41,39 @@ Run the following commands to install Telegraf from the InfluxData repository:
4041
| sudo tee /etc/apt/sources.list.d/influxdata.list
4142
sudo apt-get update && sudo apt-get install telegraf
4243
43-
2. Set up the OpenTelemetry Output plugin
44+
2. Set up your service's Telegraf Input plugin
45+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
46+
47+
Next, install the Telegraf Input plugin for the service you want to monitor. Available plugins include Chrony, Consul, Docker, Elasticsearch, Fluentd, GitHub, Jenkins, RabbitMQ or SQL. Find a complete list of Input plugins at :new-page:`Telegraf Input plugins <https://github.com/influxdata/telegraf/tree/master/plugins/inputs/exec>` in GitHub.
48+
49+
For example, if you want to monitor Exec, use a setup like:
50+
51+
.. code::
52+
53+
# Read metrics from one or more commands that can output to stdout
54+
[[inputs.exec]]
55+
56+
## Commands array
57+
commands = ["sh /etc/otelcustom/mqmscripts/fileagemonitor.sh"]
58+
timeout = "30s"
59+
data_format = "influx"
60+
61+
## Environment variables
62+
## Array of "key=value" pairs to pass as environment variables
63+
## e.g. "KEY=value", "USERNAME=John Doe",
64+
## "LD_LIBRARY_PATH=/opt/custom/lib64:/usr/local/libs"
65+
# environment = []
66+
67+
## Measurement name suffix
68+
## Used for separating different commands
69+
# name_suffix = ""
70+
71+
## Ignore Error Code
72+
## If set to true, a non-zero error code in not considered an error and the
73+
## plugin will continue to parse the output.
74+
# ignore_error = false
75+
76+
3. Set up the Telegraf OpenTelemetry Output plugin
4477
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4578

4679
Next, add the OTel Output plugin to your Telegraf configuration file:
@@ -52,26 +85,28 @@ Next, add the OTel Output plugin to your Telegraf configuration file:
5285
5386
The config file usually resides on the ./etc/telegraf/telegraf.d directory.
5487

55-
For detailed information on the Telegraf Opentelemetry output plugin see the :new-page:`Exec Input Plugin <https://github.com/influxdata/telegraf/blob/master/plugins/outputs/opentelemetry/README.md>` documentation in GitHub.
88+
For detailed information see Telegraf's :new-page:`OpenTelemetry Output plugin <https://github.com/influxdata/telegraf/blob/master/plugins/outputs/opentelemetry/README.md>` documentation in GitHub.
5689

57-
3. Configure the OpenTelemetry Collector
90+
4. Configure the OpenTelemetry Collector
5891
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5992

6093
Add the following configuration to the OTel Collector to retrieve metrics from the Telegraf installation:
6194

6295
.. code:: yaml
6396
64-
receivers:
65-
otlp:
97+
receivers:
98+
otlp:
6699
protocols:
67-
http:
68-
grpc:
69-
signalfx:
70-
exporters:
71-
signalfx:
72-
access_token: "SPLUNK_TOKEN"
73-
realm: "us0"
74-
service:
100+
http:
101+
grpc:
102+
signalfx:
103+
104+
exporters:
105+
signalfx:
106+
access_token: "SPLUNK_TOKEN"
107+
realm: "us0"
108+
109+
service:
75110
pipelines:
76111
metrics:
77112
receivers: [otlp]

0 commit comments

Comments
 (0)