Skip to content

Commit

Permalink
feat(configV4): migrate config file to v4 (#69)
Browse files Browse the repository at this point in the history
- feat(configV4): migrate config file to v4 (#69)
  • Loading branch information
paologallinaharbur authored Aug 30, 2021
1 parent 14d7843 commit 51a208f
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 48 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## 2.7.0 (2021-09-30)
### Changed
- Moved default config.sample to [V4](https://docs.newrelic.com/docs/create-integrations/infrastructure-integrations-sdk/specifications/host-integrations-newer-configuration-format/), added a dependency for infra-agent version 1.20.0

Please notice that old [V3](https://docs.newrelic.com/docs/create-integrations/infrastructure-integrations-sdk/specifications/host-integrations-standard-configuration-format/) configuration format is deprecated, but still supported.

## 2.6.1 (2021-06-09)
### Changed
- Added support for ARM
Expand Down
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ FROM newrelic/infrastructure:latest
ENV NRIA_IS_FORWARD_ONLY true
ENV NRIA_K8S_INTEGRATION true
COPY --from=builder /go/src/github.com/newrelic/nri-mongodb/bin/nri-mongodb /nri-sidecar/newrelic-infra/newrelic-integrations/bin/nri-mongodb
COPY --from=builder /go/src/github.com/newrelic/nri-mongodb/mongodb-definition.yml /nri-sidecar/newrelic-infra/newrelic-integrations/definition.yml
USER 1000
12 changes: 8 additions & 4 deletions build/.goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ nfpms:
- nri-nix

dependencies:
- "newrelic-infra"
- newrelic-infra (>= 1.20.0)

bindir: "/var/db/newrelic-infra/newrelic-integrations/bin"

Expand All @@ -55,7 +55,7 @@ nfpms:
dst: "/usr/share/doc/nri-mongodb/README.md"
- src: "LICENSE"
dst: "/usr/share/doc/nri-mongodb/LICENSE"
- src: "mongodb-definition.yml"
- src: "legacy/mongodb-definition.yml"
dst: "/var/db/newrelic-infra/newrelic-integrations/mongodb-definition.yml"
type: config

Expand All @@ -77,7 +77,9 @@ archives:
name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Version }}_{{ .Arch }}_dirty"
files:
- mongodb-config.yml.sample
- mongodb-definition.yml
- src: 'legacy/mongodb-definition.yml'
dst: .
strip_parent: true
format: tar.gz

- id: nri-win
Expand All @@ -86,7 +88,9 @@ archives:
name_template: "{{ .ProjectName }}-{{ .Arch }}.{{ .Version }}_dirty"
files:
- mongodb-config.yml.sample
- mongodb-win-definition.yml
- src: 'legacy/mongodb-win-definition.yml'
dst: .
strip_parent: true
format: zip

# we use custom publisher for fixing archives and signing them
Expand Down
2 changes: 1 addition & 1 deletion build/release.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
BUILD_DIR := ./bin/
GORELEASER_VERSION := v0.169.0
GORELEASER_VERSION := v0.174.1
GORELEASER_BIN ?= bin/goreleaser

bin:
Expand Down
File renamed without changes.
File renamed without changes.
88 changes: 46 additions & 42 deletions mongodb-config.yml.sample
Original file line number Diff line number Diff line change
@@ -1,43 +1,47 @@
integration_name: com.newrelic.mongodb
integrations:
- name: nri-mongodb
env:
# The mongos to connect to
HOST: my-mongos.company.localnet
# The port the mongos is running on
PORT: "27017"

instances:
- name: all
# Available commands are "all", "metrics", and "inventory"
command: all
arguments:
# The mongos to connect to
host: my-mongos.company.localnet
# The port the mongos is running on
port: 27017
# The username of the user created to monitor the cluster.
# This user should exist on the cluster as a whole as well
# as on each of the individual mongods.
username: monitor
# The password for the monitoring user
password: password
# The database on which the monitoring user is stored
auth_source: admin
# A user-defined cluster name. Required.
mongodb_cluster_name: testcluster
# Connect using SSL
ssl: true
# Skip verification of the certificate sent by the host.
# This can make the connection susceptible to man-in-the-middle attacks,
# and should only be used for testing
ssl_insecure_skip_verify: true
# Path to the CA certs file
ssl_ca_certs: /sample/path/to/ca_certs
# Client Certificate to present to the server (optional)
pem_key_file: /sample/file.pem
# Passphrase to decrypt PEMKeyFile file (optional)
passphrase: secret
# A JSON map of database names to an array of collection names. If empty,
# defaults to all databases and collections. If the list of collections is null,
# collects all collections for the database.
filters: '{"db1":null,"db2":["collection1","collection2"],"db3":[]}'
# The number of entities to collect metrics for concurrently. Tunable to
# limit CPU and memory usage
concurrent_collections: 50
labels:
env: production
label: mongo-cluster-1
# The username of the user created to monitor the cluster.
# This user should exist on the cluster as a whole as well
# as on each of the individual mongods.
USERNAME: monitor
# The password for the monitoring user
PASSWORD: password
# The database on which the monitoring user is stored
AUTH_SOURCE: admin

# A user-defined cluster name. Required.
MONGODB_CLUSTER_NAME: testcluster

# Connect using SSL
SSL: "true"
# Path to the CA certs file
SSL_CA_CERTS: /sample/path/to/ca_certs
# Skip verification of the certificate sent by the host.
# This can make the connection susceptible to man-in-the-middle attacks,
# and should only be used for testing
SSL_INSECURE_SKIP_VERIFY: "true"
# Passphrase to decrypt PEMKeyFile file (optional)
PASSPHRASE: secret
# Client Certificate to present to the server (optional)
PEM_KEY_FILE: /sample/file.pem

# The number of entities to collect metrics for concurrently. Tunable to
# limit CPU and memory usage
CONCURRENT_COLLECTIONS: "50"

# A JSON map of database names to an array of collection names. If empty,
# defaults to all databases and collections. If the list of collections is null,
# collects all collections for the database.
FILTERS: '{"db1":null,"db2":["collection1","collection2"],"db3":[]}'

interval: 15s
labels:
env: production
label: mongo-cluster-1
inventory_source: config/mongodb

0 comments on commit 51a208f

Please sign in to comment.