Skip to content

Commit

Permalink
fix instance
Browse files Browse the repository at this point in the history
  • Loading branch information
lu-zhengda committed Oct 25, 2024
1 parent 8ace82a commit 1b48283
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mongo/datadog_checks/mongo/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def __init__(self, instance, log):
self.dbm_enabled = is_affirmative(instance.get('dbm', False))
self.database_instance_collection_interval = instance.get('database_instance_collection_interval', 300)
self.cluster_name = instance.get('cluster_name', None)
self.cloud_metadata = self._compute_cloud_metadata()
self.cloud_metadata = self._compute_cloud_metadata(instance)
self._operation_samples_config = instance.get('operation_samples', {})
self._slow_operations_config = instance.get('slow_operations', {})
self._schemas_config = instance.get('schemas', {})
Expand Down Expand Up @@ -159,9 +159,9 @@ def _compute_metric_tags(self):
tags.append('clustername:%s' % self.cluster_name)
return tags

def _compute_cloud_metadata(self):
def _compute_cloud_metadata(self, instance):
cloud_metadata = {}
if aws := self.instance.get('aws'):
if aws := instance.get('aws'):
cloud_metadata['aws'] = {
'instance_endpoint': aws.get('instance_endpoint'),
'cluster_identifier': aws.get('cluster_identifier') or self.cluster_name,
Expand Down

0 comments on commit 1b48283

Please sign in to comment.