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

Commit 3181f42

Browse files
Draft
1 parent c4589b8 commit 3181f42

File tree

1 file changed

+19
-67
lines changed

1 file changed

+19
-67
lines changed

gdi/opentelemetry/components/ngninx-receiver.rst

Lines changed: 19 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,11 @@ NGINX receiver
55
***********************
66

77
.. 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.
99

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.
1111

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.
3913

4014
Get started
4115
======================
@@ -51,25 +25,17 @@ Follow these steps to configure and activate the component:
5125
2. Configure the receiver as described in the next section.
5226
3. Restart the Collector.
5327

54-
Sample configurations
28+
Sample configuration
5529
---------------------------
5630

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:
5832

5933
.. code:: yaml
6034
6135
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
7339
7440
To complete the configuration, include the receiver in the ``metrics`` pipeline of the ``service`` section of your configuration file. For example:
7541

@@ -78,43 +44,31 @@ To complete the configuration, include the receiver in the ``metrics`` pipeline
7844
service:
7945
pipelines:
8046
metrics:
81-
receivers: [mongodb]
47+
receivers: [nginx]
8248
8349
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+
-------------------------------------------------
8951

90-
* For standalone MongoDB deployments this is the hostname and port of the mongod instance.
52+
The following settings are available:
9153

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.
9355

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.
9557

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``.
10161

10262
* ``initial_delay``. ``1s`` by default. Defines how long this receiver waits before starting.
10363

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-
11064
Settings
11165
======================
11266

113-
The following table shows the configuration options for the MongoDB receiver:
67+
The following table shows the configuration options for the NGINX receiver:
11468

11569
.. raw:: html
11670

117-
<div class="metrics-standard" category="included" url="https://raw.githubusercontent.com/splunk/collector-config-tools/main/cfg-metadata/receiver/mongodb.yaml"></div>
71+
<div class="metrics-standard" category="included" url="https://raw.githubusercontent.com/splunk/collector-config-tools/main/cfg-metadata/receiver/nginx.yaml"></div>
11872

11973
Metrics
12074
=====================
@@ -123,9 +77,7 @@ The following metrics, resource attributes, and attributes are available.
12377

12478
.. raw:: html
12579

126-
<div class="metrics-component" category="included" url="https://raw.githubusercontent.com/splunk/collector-config-tools/main/metric-metadata/mongodbreceiver.yaml"></div>
127-
128-
* ``mongodb.extent.count`` is available for versions under 4.4 with mmapv1 storage engine.
80+
<div class="metrics-component" category="included" url="https://raw.githubusercontent.com/splunk/collector-config-tools/main/metric-metadata/nginxreceiver.yaml"></div>
12981

13082
.. include:: /_includes/activate-deactivate-native-metrics.rst
13183

0 commit comments

Comments
 (0)