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
@@ -107,7 +108,8 @@ test-cover: env ## Run tests and collect cross-package coverage inf
107
108
go test -race -timeout 30s -coverprofile=cover.out -covermode=atomic -coverpkg=./... ./...
108
109
109
110
test-cluster: env ## Starts MongoDB test cluster. Use env var TEST_MONGODB_IMAGE to set flavor and version. Example: TEST_MONGODB_IMAGE=mongo:3.6 make test-cluster
110
-
docker compose up -d --wait
111
+
docker compose up --build -d
112
+
./docker/scripts/setup-pbm.sh
111
113
112
114
test-cluster-clean: env ## Stops MongoDB test cluster.
113
-
docker compose down --remove-orphans --volumes --timeout 1
Copy file name to clipboardExpand all lines: README.md
+35-3Lines changed: 35 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,10 @@ Currently, these metric sources are implemented:
16
16
- replSetGetStatus
17
17
- serverStatus
18
18
19
+
## Supported MongoDB versions
20
+
21
+
The exporter works with Percona Server for MongoDB and MongoDB Community or Enterprise Edition versions 4.4 and newer. Older versions might also work but are not tested anymore.
22
+
19
23
## Info on Percona MongoDB exporter versions
20
24
21
25
The old 0.1x.y version (ex `master` branch) has been moved to the `release-0.1x` branch.
@@ -48,10 +52,10 @@ A docker image is available on the [official percona repository](https://hub.doc
48
52
49
53
```sh
50
54
# with podman
51
-
podman run -d -p 9216:9216 -p 17001:17001 percona/mongodb_exporter:0.20 --mongodb.uri=mongodb://127.0.0.1:17001
55
+
podman run -d -p 9216:9216 percona/mongodb_exporter:0.40 --mongodb.uri=mongodb://127.0.0.1:17001
52
56
53
57
# with docker
54
-
docker run -d -p 9216:9216 -p 17001:17001 percona/mongodb_exporter:0.20 --mongodb.uri=mongodb://127.0.0.1:17001
58
+
docker run -d -p 9216:9216 percona/mongodb_exporter:0.40 --mongodb.uri=mongodb://127.0.0.1:17001
55
59
```
56
60
57
61
#### Permissions
@@ -91,11 +95,28 @@ You can run the exporter specifying multiple URIs, devided by a comma in --mongo
In this case you can use the **/scrape** endpoint with the **target** parameter to retreive the specified tartget's metrics. When querying the data you can use just mongodb://host:port in the targer parameter without other parameters and, of course without host credentials
98
+
In this case you can use the **/scrape** endpoint with the **target** parameter to retreive the specified tartget's metrics. When querying the data you can use just mongodb://host:port in the target parameter without other parameters and, of course without host credentials
95
99
```sh
96
100
GET /scrape?target=mongodb://127.0.0.1:27018
97
101
```
102
+
If your URI is prefixed by mongodb:// or mongodb+srv:// schema, any host not prefixed by it after comma is being treated as part of a cluster rather then as a standalone host. Thus clusters and standalone hosts can be combined like this:
You can use the --split-cluster option to split all cluster nodes into separate targets. This mode is useful when cluster nodes are defined as SRV records and the mongodb_exporter is running with mongodb+srv domain specified. In this case SRV records will be queried upon mongodb_exporter start and each cluster node can be queried using the **target** parameter of multitarget endpoint.
108
+
109
+
#### Overall targets request endpoint
98
110
111
+
There is an overall targets endpoint **/scrapeall** that queries all the targets in one request. It can be used to store multiple node metrics without separate target requests. In this case, each node metric will have a **instance** label containing the node name as a host:port pair (or just host if no port was not specified). For example, for mongodb_exporter running with the options:
|1| The profiler collects data for operations that take longer than the value of `slowms` or that match a filter.<br> When a filter is set: <ul><li> The `slowms` and `sampleRate` options are not used for profiling.</li><li>The profiler only captures operations that match the filter.</li></ul>
129
150
|2|The profiler collects data for all operations.|
130
151
152
+
#### Enabling shards metrics gathering
153
+
When shard metrics collection is enabled by `--collector.shards`, the exporter will expose metrics related to sharded Mongo.
154
+
Example, if shards collector is enabled:
155
+
```
156
+
# HELP mongodb_shards_collection_chunks_count sharded collection chunks.
157
+
# TYPE mongodb_shards_collection_chunks_count counter
0 commit comments