From 74c710b6f5b6623f23e11af99392f261f0ef6581 Mon Sep 17 00:00:00 2001 From: Gaetan Craig-Riou Date: Wed, 11 Dec 2024 16:08:32 +1100 Subject: [PATCH] Fix new relic redis configuration By default New Relic monitor the redis instance running on port 6379. We are interested in monitoring the cache instance of redis, running on port 6380. This add a task to update the port to 6380. --- playbooks/provision.yml | 10 ++++++++++ roles/common/handlers/main.yml | 7 +++++++ 2 files changed, 17 insertions(+) diff --git a/playbooks/provision.yml b/playbooks/provision.yml index 41829b7ca..fff5471b6 100644 --- a/playbooks/provision.yml +++ b/playbooks/provision.yml @@ -119,6 +119,16 @@ become_user: "{{ app_user }}" when: ansible_distribution_major_version >= '20' + - name: update new relic redis configuration # update redis port to monitor cache instance + replace: + dest: "/etc/newrelic-infra/integrations.d/redis-config.yml" + regexp: '^(\s*PORT:)\s6379$' + replace: '\1 6380' + become: yes + notify: restart newrelic + tags: + - newrelic_redis + - meta: flush_handlers # Ensure handlers run successfully before reporting success - name: notify slack diff --git a/roles/common/handlers/main.yml b/roles/common/handlers/main.yml index 7ebe6b8c6..3d5640d8e 100644 --- a/roles/common/handlers/main.yml +++ b/roles/common/handlers/main.yml @@ -5,3 +5,10 @@ name: redis-server state: restarted become: yes + +- name: restart newrelic + service: + name: newrelic-infra + state: restarted + become: yes +