Skip to content

Commit

Permalink
Remove extra space and add integration_version
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandre-normand committed Aug 11, 2023
1 parent 2c65eb9 commit 1945742
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mysql/datadog_checks/mysql/mysql.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
)
from datadog_checks.base.utils.serialization import json

from .__about__ import __version__
from .activity import MySQLActivity
from .collection_utils import collect_all_scalars, collect_scalar, collect_string, collect_type
from .config import MySQLConfig
Expand Down Expand Up @@ -1240,6 +1241,7 @@ def _send_database_instance_metadata(self):
"kind": "database_instance",
"collection_interval": self._config.database_instance_collection_interval,
'dbms_version': self.version.version + '+' + self.version.build,
'integration_version': __version__,
"tags": self._non_internal_tags,
"timestamp": time.time() * 1000,
"cloud_metadata": self._config.cloud_metadata,
Expand All @@ -1248,5 +1250,5 @@ def _send_database_instance_metadata(self):
"connection_host": self._config.host,
},
}
self. _database_instance_emitted[self.resolved_hostname] = event
self._database_instance_emitted[self.resolved_hostname] = event
self.database_monitoring_metadata(json.dumps(event, default=default_json_event_encoding))
2 changes: 2 additions & 0 deletions mysql/tests/test_mysql.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from datadog_checks.base.utils.platform import Platform
from datadog_checks.dev.utils import get_metadata_metrics
from datadog_checks.mysql import MySql
from datadog_checks.mysql.__about__ import __version__
from datadog_checks.mysql.const import (
BINLOG_VARS,
GALERA_VARS,
Expand Down Expand Up @@ -667,6 +668,7 @@ def test_database_instance_metadata(aggregator, dd_run_check, instance_complex,
assert event['host'] == expected_host
assert event['dbms'] == "mysql"
assert event['tags'].sort() == tags.METRIC_TAGS.sort()
assert event['integration_version'] == __version__
assert event['collection_interval'] == 1800
assert event['metadata'] == {
'dbm': dbm_enabled,
Expand Down

0 comments on commit 1945742

Please sign in to comment.