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

Commit c713e8e

Browse files
Merge pull request #1803 from splunk/urbiz-redis-rx
[5868]: Redis rx
2 parents 64f1bda + c6f5bfa commit c713e8e

File tree

2 files changed

+112
-7
lines changed

2 files changed

+112
-7
lines changed
Lines changed: 111 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,121 @@
11
.. _redis-receiver:
22

3-
****************************
3+
****************************************
44
Redis receiver
5-
****************************
5+
****************************************
66

77
.. meta::
8-
:description: Retrieves Redis ``INFO`` data from a specific Redis instance and builds metrics from it.
8+
:description: The Redis receiver retrieves Redis ``INFO`` data from a specific Redis instance and builds metrics from it.
99

10-
.. note:: Document coming soon!
10+
Get started
11+
======================
1112

12-
The Splunk Distribution of the OpenTelemetry Collector supports the Redis receiver, but it is not yet documented.
13+
The Redis receiver is designed to retrieve Redis ``INFO`` data from a single Redis instance, build metrics from that data, and send them to the next consumer at a configurable interval.
1314

14-
To find information about this component, see the documentation in the GitHub repository at :new-page:`Redis receiver <https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/redisreceiver>`.
15+
Understand the Redis receiver and the ``INFO`` command
16+
----------------------------------------------------------------------
1517

18+
The Redis ``INFO`` command returns information and statistics about a Redis server. The Redis receiver extracts values from the result and converts them to OpenTelemetry metrics.
1619

20+
For example, the Redis ``INFO`` command returns ``used_cpu_sys``, which indicates the system CPU consumed by the Redis server, expressed in seconds, since the start of the Redis instance. The Redis receiver turns this data into a gauge with a metric name of ``redis.cpu.time`` and a unit value of seconds.
21+
22+
For more information, see :
23+
24+
* :new-page:`Redis commands info <https://redis.io/commands/info>`
25+
* The list of Redis receiver metrics at :ref:`redis-receiver-metrics`
26+
27+
Configure the Redis receiver
28+
----------------------------------------------------------------------
29+
30+
To activate the Redis receiver manually in the Collector configuration, add ``redis`` to the ``receivers`` section of your configuration file, as shown in the following example:
31+
32+
.. code:: yaml
33+
34+
receivers:
35+
redis:
36+
endpoint: "localhost:6379"
37+
username: "test"
38+
password: "test"
39+
collection_interval: 10s
40+
tls:
41+
insecure: true
42+
43+
To complete the configuration, include the receiver in the ``metrics`` pipeline of the ``service`` section of your configuration file. For example:
44+
45+
.. code:: yaml
46+
47+
service:
48+
pipelines:
49+
metrics:
50+
receivers: [redis]
51+
52+
Configuration settings
53+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
54+
55+
The following setting is required:
56+
57+
* ``endpoint``: The hostname and port of the Redis instance, separated by a colon. No default value.
58+
59+
The following settings are optional:
60+
61+
* ``collection_interval``: This receiver runs on an interval. Each time it runs, it queries Redis, creates metrics, and sends them to the next consumer. The ``collection_interval`` configuration option tells this receiver the duration between runs.
62+
63+
* ``collection_interval`` must be a string readable by Golang's ParseDuration function, such as ``1h30m``. Valid time units are ns, us (or µs), ms, s, m, h. ``10s`` by default.
64+
65+
* ``password``: The password used to access the Redis instance; must match the password specified in the requirepass server configuration option. No default value.
66+
67+
* ``transport``: Defines the network to use for connecting to the server: ``tcp`` or ``unix``. ``tcp`` by default.
68+
69+
* ``tls``:
70+
71+
* ``insecure``: Whether to disable client transport security for the exporter's connection. ``true`` by default.
72+
73+
* ``ca_file``: The path to the CA certification. For a client this verifies the server certificate.
74+
75+
* Only use if ``insecure`` is set to ``false``.
76+
77+
* ``cert_file``: The path to the TLS certification to use for TLS required connections.
78+
79+
* Only use if ``insecure`` is set to ``false``.
80+
81+
* ``key_file``: The path to the TLS key to use for TLS required connections.
82+
83+
* Only use if ``insecure`` is set to ``false``.
84+
85+
Configure the receiver using environment variables
86+
----------------------------------------------------------------------
87+
88+
In OpenTelemetry you can configure any component using environment variables. For example, to pick up the value of an environment variable ``REDIS_PASSWORD``, use:
89+
90+
.. code:: yaml
91+
92+
receivers:
93+
redis:
94+
endpoint: "localhost:6379"
95+
collection_interval: 10s
96+
password: ${env:REDIS_PASSWORD}
97+
98+
Settings
99+
======================
100+
101+
The following table shows the configuration options for the Redis receiver:
102+
103+
.. raw:: html
104+
105+
<div class="metrics-standard" category="included" url="https://raw.githubusercontent.com/splunk/collector-config-tools/main/cfg-metadata/receiver/redis.yaml"></div>
106+
107+
.. _redis-receiver-metrics:
108+
109+
Metrics
110+
=====================
111+
112+
The following metrics, resource attributes, and attributes are available.
113+
114+
.. raw:: html
115+
116+
<div class="metrics-component" category="included" url="https://raw.githubusercontent.com/splunk/collector-config-tools/main/metric-metadata/redisreceiver.yaml"></div>
117+
118+
Troubleshooting
119+
======================
120+
121+
.. include:: /_includes/troubleshooting-components.rst

gdi/opentelemetry/discovery-mode.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Discovery mode supports the following host services and applications:
5353
- Smart Agent with collectd/nginx monitor type. See :ref:`nginx`.
5454

5555
* - Redis
56-
- Redis receiver.
56+
- Redis receiver. See :ref:`redis-receiver`.
5757

5858
Discovery mode is available for the following platforms:
5959

0 commit comments

Comments
 (0)