Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update discovery-mode.rst #1046

Merged
merged 1 commit into from
Nov 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 39 additions & 1 deletion gdi/opentelemetry/discovery-mode.rst
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ Custom configurations consist of the fields you want to override in the default

.. code-block:: yaml


# <some-receiver-type-with-optional-name.discovery.yaml>
<receiver_type>(/<receiver_name>):
enabled: <true | false> # true by default
Expand Down Expand Up @@ -196,6 +195,45 @@ To define a custom directory for discovery settings, use the ``--config-dir`` op

otelcol --discovery --config-dir <custom_path>

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 <realm> – <token> --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: "<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
======================
Expand Down