-
Notifications
You must be signed in to change notification settings - Fork 428
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added multi target feature * added connect timeout opts * added tests * fixed test * fixed dockerfile * Bump github.com/golangci/golangci-lint from 1.47.3 to 1.52.2 in /tools (#639) Bumps [github.com/golangci/golangci-lint](https://github.com/golangci/golangci-lint) from 1.47.3 to 1.52.2. - [Release notes](https://github.com/golangci/golangci-lint/releases) - [Changelog](https://github.com/golangci/golangci-lint/blob/master/CHANGELOG.md) - [Commits](golangci/golangci-lint@v1.47.3...v1.52.2) --- updated-dependencies: - dependency-name: github.com/golangci/golangci-lint dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump github.com/golangci/golangci-lint from 1.52.2 to 1.53.2 in /tools (#665) Bumps [github.com/golangci/golangci-lint](https://github.com/golangci/golangci-lint) from 1.52.2 to 1.53.2. - [Release notes](https://github.com/golangci/golangci-lint/releases) - [Changelog](https://github.com/golangci/golangci-lint/blob/master/CHANGELOG.md) - [Commits](golangci/golangci-lint@v1.52.2...v1.53.2) --- updated-dependencies: - dependency-name: github.com/golangci/golangci-lint dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Remove `prometheus/client_golang` replace (#682) * Remove prometheus/client_golang replace * Apply formater * Downgrade client_golang to previous version * Upgrade exporter-toolkit to v0.10.0 * added multi target feature * added connect timeout opts * fixed connect * formatted code * fixed linter warnings * Update README.md * Update README.md * updated license * Update exporter/server.go Co-authored-by: Nurlan Moldomurov <[email protected]> * fixed according to review * formatted the code * minor changes according to the linters --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Marc Tudurí <[email protected]> Co-authored-by: Jiří Čtvrtka <[email protected]> Co-authored-by: Nurlan Moldomurov <[email protected]> Co-authored-by: Nurlan Moldomurov <[email protected]>
- Loading branch information
1 parent
8597f3a
commit e02fe4f
Showing
10 changed files
with
371 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,18 @@ | ||
FROM alpine AS builder | ||
RUN apk add --no-cache ca-certificates | ||
|
||
FROM scratch AS final | ||
FROM golang:alpine as builder2 | ||
|
||
RUN apk update && apk add make | ||
RUN mkdir /source | ||
COPY . /source | ||
WORKDIR /source | ||
RUN make init | ||
RUN make build | ||
|
||
FROM alpine AS final | ||
USER 65535:65535 | ||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
COPY ./mongodb_exporter / | ||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
COPY --from=builder2 /source/mongodb_exporter / | ||
EXPOSE 9216 | ||
ENTRYPOINT ["/mongodb_exporter"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,6 +86,17 @@ export MONGODB_PASSWORD=YYY | |
mongodb_exporter_linux_amd64/mongodb_exporter --mongodb.uri=mongodb://127.0.0.1:17001 --mongodb.collstats-colls=db1.c1,db2.c2 | ||
``` | ||
|
||
#### Multi-target support | ||
You can run the exporter specifying multiple URIs, devided by a comma in --mongodb.uri option or MONGODB_URI environment variable in order to monitor multiple mongodb instances with the a single mongodb_exporter instance. | ||
```sh | ||
--mongodb.uri=mongodb://user:[email protected]:27017/admin,mongodb://user2:[email protected]:27018/admin | ||
``` | ||
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 | ||
```sh | ||
GET /scrape?target=mongodb://127.0.0.1:27018 | ||
``` | ||
|
||
|
||
#### Enabling collstats metrics gathering | ||
`--mongodb.collstats-colls` receives a list of databases and collections to monitor using collstats. | ||
Usage example: `--mongodb.collstats-colls=database1.collection1,database2.collection2` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.