You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 2, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: gdi/opentelemetry/components/ngninx-receiver.rst
+19-67Lines changed: 19 additions & 67 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,37 +5,11 @@ NGINX receiver
5
5
***********************
6
6
7
7
.. meta::
8
-
:description: The NGNINX receiver fetches stats from a Nginx instance using the ``ngx_http_stub_status_module`` module's status endpoint.
8
+
:description: The NGINX receiver fetches stats from a NGINX instance using the ``ngx_http_stub_status_module`` module's status endpoint.
9
9
10
-
The NGNINX receiver fetches stats from a Nginx instance using the ``ngx_http_stub_status_module`` module's status endpoint. The supported pipeline type is ``metrics``. See :ref:`otel-data-processing` for more information.
10
+
The NGINX receiver fetches stats from a NGINX instance using the ``ngx_http_stub_status_module`` module's status endpoint. The supported pipeline type is ``metrics``. See :ref:`otel-data-processing` for more information.
11
11
12
-
13
-
14
-
15
-
16
-
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
The receiver collects stats with MongoDB's ``dbStats`` and ``serverStatus`` commands, and uses the golang mongo driver. See more at :new-page:`Mongo Go driver documentation <https://github.com/mongodb/mongo-go-driver>`.
25
-
26
-
.. note:: Use the MongoDB receiver in place of the deprecated SignalFx Smart Agent ``mongodb`` monitor type.
27
-
28
-
Prerequisites
29
-
======================
30
-
31
-
The MongoDB receiver supports MongoDB versions 4.0+ and 5.0.
32
-
33
-
MongoDB recommends to set up a least privilege user (LPU) with a ``clusterMonitor`` role in order to collect metrics.
34
-
35
-
* For information on MongoDB's roles, see :new-page:`MongoDB built-in roles <https://www.mongodb.com/docs/v5.0/reference/built-in-roles/#mongodb-authrole-clusterMonitor>`.
36
-
* For an example of how to configure these permissions, see :new-page:`lpu.sh <https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/mongodbreceiver/testdata/integration/scripts/lpu.sh>`.
37
-
38
-
.. note:: If you're using automatic discovery with MongoDB, see :ref:`linux-third-party-mongodb`.
12
+
You need to configure NGINX to expose status information. To learn how, see the :new-page:`HTTP status module config guide <https://nginx.org/en/docs/http/ngx_http_stub_status_module.html>` in the NGINX documentation.
39
13
40
14
Get started
41
15
======================
@@ -51,25 +25,17 @@ Follow these steps to configure and activate the component:
51
25
2. Configure the receiver as described in the next section.
52
26
3. Restart the Collector.
53
27
54
-
Sample configurations
28
+
Sample configuration
55
29
---------------------------
56
30
57
-
To activate the MongoDB receiver, add ``mongodb`` to the ``receivers`` section of your configuration file, as shown in the following example:
31
+
To activate the NGINX receiver, add ``nginx`` to the ``receivers`` section of your configuration file, as shown in the following example:
58
32
59
33
.. code:: yaml
60
34
61
35
receivers:
62
-
mongodb:
63
-
hosts:
64
-
- endpoint: localhost:27017
65
-
transport: tcp
66
-
username: otel
67
-
password: ${env:MONGODB_PASSWORD}
68
-
collection_interval: 60s
69
-
initial_delay: 1s
70
-
tls:
71
-
insecure: true
72
-
insecure_skip_verify: true
36
+
nginx:
37
+
endpoint: "http://localhost:80/status"
38
+
collection_interval: 10s
73
39
74
40
To complete the configuration, include the receiver in the ``metrics`` pipeline of the ``service`` section of your configuration file. For example:
75
41
@@ -78,43 +44,31 @@ To complete the configuration, include the receiver in the ``metrics`` pipeline
78
44
service:
79
45
pipelines:
80
46
metrics:
81
-
receivers: [mongodb]
47
+
receivers: [nginx]
82
48
83
49
Configuration options
84
-
--------------------------------------------
85
-
86
-
The following settings are optional:
87
-
88
-
* ``hosts``. ``[localhost:27017]`` by default. List of ``host:port`` or Unix domain socket endpoints.
50
+
-------------------------------------------------
89
51
90
-
* For standalone MongoDB deployments this is the hostname and port of the mongod instance.
52
+
The following settings are available:
91
53
92
-
* For replica sets specify the hostnames and ports of the mongod instances that are in the replica set configuration. If the ``replica_set`` field is specified, nodes will be autodiscovered.
54
+
* ``endpoint``. :strong:`Required`. ``http://localhost:80/status`` by default. The URL of the NGINX status endpoint.
93
55
94
-
* For a sharded MongoDB deployment, specify a list of the ``mongos`` hosts.
56
+
* ``collection_interval``. ``10s`` by default. This receiver runs on an interval. Each time it runs, it queries NGINX, creates metrics, and sends them to the next consumer. This option sets the duration between runs.
95
57
96
-
* ``username``: If authentication is required, provide the ``clusterMonitor`` permissions here.
97
-
98
-
* ``password``: If authentication is required, provide the password here.
99
-
100
-
* ``collection_interval``. ``1m`` by default. This receiver collects metrics on an interval. Valid time units are ``ns``, ``us`` (or ``µs``), ``ms``, ``s``, ``m``, ``h``. This value must be a string readable by Golang's time parseDuration. Learn more at :new-page:`ParseDuration <https://pkg.go.dev/time#ParseDuration>`.
58
+
* Must be a string readable by Golang's ``ParseDuration`` function, for example ``1h30m``.
59
+
60
+
* Valid time units are ``ns``, ``us`` (or ``µs``), ``ms``, ``s``, ``m``, ``h``.
101
61
102
62
* ``initial_delay``. ``1s`` by default. Defines how long this receiver waits before starting.
103
63
104
-
* ``replica_set``: If the deployment of MongoDB is a replica set, use this to specify the replica set name which allows for autodiscovery of other nodes in the replica set.
105
-
106
-
* ``timeout``. ``1m`` by default. The timeout of running commands against mongo.
107
-
108
-
* ``tls``: TLS control. By default insecure settings are rejected and certificate verification is on. See more at :new-page:`TLS Configuration Settings <https://github.com/open-telemetry/opentelemetry-collector/blob/main/config/configtls/README.md>`.
109
-
110
64
Settings
111
65
======================
112
66
113
-
The following table shows the configuration options for the MongoDB receiver:
67
+
The following table shows the configuration options for the NGINX receiver:
0 commit comments