Merge pull request #12494 from AlanCoding/revival

Register system again if deleted by another pod
This commit is contained in:
Alan Rominger
2022-08-17 10:12:39 -04:00
committed by GitHub
4 changed files with 19 additions and 5 deletions

View File

@@ -166,7 +166,11 @@ class Metrics:
elif settings.IS_TESTING():
self.instance_name = "awx_testing"
else:
self.instance_name = Instance.objects.me().hostname
try:
self.instance_name = Instance.objects.me().hostname
except Exception as e:
self.instance_name = settings.CLUSTER_HOST_ID
logger.info(f'Instance {self.instance_name} seems to be unregistered, error: {e}')
# metric name, help_text
METRICSLIST = [