diff --git a/gdi/opentelemetry/discovery-mode.rst b/gdi/opentelemetry/discovery-mode.rst index c1194cf8c..a66209ba2 100644 --- a/gdi/opentelemetry/discovery-mode.rst +++ b/gdi/opentelemetry/discovery-mode.rst @@ -166,7 +166,6 @@ Custom configurations consist of the fields you want to override in the default .. code-block:: yaml - # (/): enabled: # true by default @@ -196,6 +195,45 @@ To define a custom directory for discovery settings, use the ``--config-dir`` op otelcol --discovery --config-dir +Usage example +====================== + +The following example show how to install the Collector with discovery mode to find a MySQL database and retrieve metrics. + +#. Install the collector on the host using the `--discovery` flag: + + .. code-block:: shell + + curl -sSL https://dl.signalfx.com/splunk-otel-collector.sh > /tmp/splunk-otel-collector.sh && \ + sudo sh /tmp/splunk-otel-collector.sh --realm --mode agent --discovery + +#. Create the properties.discovery.yaml file in the `/etc/otel/collector/config.d` directory with the following content: + + .. code-block:: yaml + + splunk.discovery: + receivers: + smartagent/collectd/mysql: + enabled: true + config: + username: "root" + password: "" + databases: "[{name: 'information_schema'}]" + +#. Tail the Collector logs with the following command to confirm that it has discovered the MySQL database successfully: + + .. code-block:: shell + + journalctl -u splunk-otel-collector + +#. When successful, the logs include lines similar to the following: + + .. code-block:: text + + info collectd/logging.go:49 plugin "logfile" successfully loaded. {"kind": "receiver", "name": "receiver_creator/discovery", "data_type": "metrics", "name": + "smartagent/collectd/mysql/receiver_creator/discovery{endpoint=\"[::]:3306\"}/(host_observer)[::]-3306-TCP-2005", "collectdInstance": "monitor- + smartagentcollectdmysqlreceiver_creatordiscoveryendpoint3306host_observer3306TCP2005", "monitorID": "smartagentcollectdmysqlreceiver_creatordiscoveryendpoint3306host_observer3306TCP2005", "monitorType": + "collectd/mysql", "plugin": "plugin_load"} Troubleshooting ======================