From 5b46d4cf30871a997dff0d7624194dfdaa15cc38 Mon Sep 17 00:00:00 2001 From: nadeemshahzad Date: Tue, 7 May 2024 12:04:04 +0500 Subject: [PATCH] feat: add datadog mongo check --- playbooks/roles/datadog/tasks/main.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/playbooks/roles/datadog/tasks/main.yml b/playbooks/roles/datadog/tasks/main.yml index d55f5c04277..5a2e5b2ff84 100644 --- a/playbooks/roles/datadog/tasks/main.yml +++ b/playbooks/roles/datadog/tasks/main.yml @@ -22,3 +22,24 @@ - name: Install datadog Agent include_role: name: datadog.datadog +- name: Configure Datadog MongoDB check + copy: + content: | + init_config: + service: edx-mongodb + instances: + - hosts: + - "127.0.0.1:27018" + username: "{{ datadog_mongo_username | default('admin') }}" + password: "{{ datadog_mongo_password | default('password') }}" + logs: + - type: file + path: /edx/var/log/mongo/mongodb.log + source: mongodb + start_position: beginning + dest: /etc/datadog-agent/conf.d/mongo.d/conf.yaml + when: (datadog_mongo_check | default(false)) +- name: Restart Datadog Agent + service: + name: datadog-agent + state: restarted