Skip to content

Commit

Permalink
feat: add mongodb metrics exporter
Browse files Browse the repository at this point in the history
  • Loading branch information
Olivier Cervello committed Nov 25, 2021
2 parents 1f1ecc3 + 74d6625 commit bce8205
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,17 @@ PRODUCT_OPENER_FLAVOR=openfoodfacts
PRODUCT_OPENER_FLAVOR_SHORT=off
POSTGRES_USER=productopener
POSTGRES_PASSWORD=productopener
MONGODB_HOST=mongodb
MONGODB_CACHE_SIZE=8 # GB
MONGO_INITDB_ROOT_USERNAME=root
MONGO_INITDB_ROOT_PASSWORD=test
ROBOTOFF_URL=http://host.docker.internal:5500 # connect to Robotoff running in separate docker-compose deployment
GOOGLE_CLOUD_VISION_API_KEY=
CROWDIN_PROJECT_IDENTIFIER=
CROWDIN_PROJECT_KEY=
GEOLITE2_PATH=
GEOLITE2_LICENSE_KEY=
GEOLITE2_ACCOUNT_ID=
ELASTICSEARCH_HOSTS=
LOG_LEVEL_ROOT=TRACE
LOG_LEVEL_MONGODB=TRACE
1 change: 1 addition & 0 deletions .github/workflows/mongo-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ jobs:
echo "COMPOSE_PATH_SEPARATOR=;" >> .env
echo "COMPOSE_FILE=docker/mongodb.yml" >> .env
echo "MONGODB_CACHE_SIZE=${{ secrets.MONGODB_CACHE_SIZE }}" >> .env
echo "MONGODB_HOST=${{ secrets.HOST }}" >> .env
- name: Create MongoDB Docker volume
uses: appleboy/ssh-action@master
Expand Down
4 changes: 4 additions & 0 deletions docker/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ services:
- ./html:/opt/product-opener/html/
mongodb:
image: mongo:4.4
command: mongod --wiredTigerCacheSizeGB ${MONGODB_CACHE_SIZE}
environment:
- MONGO_INITDB_ROOT_USERNAME
- MONGO_INITDB_ROOT_PASSWORD
networks:
- webnet
ports:
Expand Down
14 changes: 14 additions & 0 deletions docker/mongodb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,22 @@ services:
command: mongod --wiredTigerCacheSizeGB ${MONGODB_CACHE_SIZE}
volumes:
- dbdata:/data/db
environment:
- MONGO_INITDB_ROOT_USERNAME
- MONGO_INITDB_ROOT_PASSWORD
ports:
- 27017:27017
networks:
- db
mongodb_exporter:
image: bitnami/mongodb-exporter:0
command: mongodb_exporter --discovering-mode --mongodb.uri=mongodb://${MONGO_INITDB_ROOT_USERNAME}:${MONGO_INITDB_ROOT_PASSWORD}@${MONGODB_HOST}:27017/admin?ssl=true
ports:
- 9216:9216
networks:
- db
networks:
db:
volumes:
dbdata:
external: true
Expand Down

0 comments on commit bce8205

Please sign in to comment.