Skip to content

Commit

Permalink
Add sqlserver engine editition && version to DBM event payloads (#14499)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmeunier28 authored and aweaver89 committed May 10, 2023
1 parent 572b411 commit 00c1db9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sqlserver/datadog_checks/sqlserver/activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from datadog_checks.base.utils.db.utils import DBMAsyncJob, default_json_event_encoding, obfuscate_sql_with_metadata
from datadog_checks.base.utils.serialization import json
from datadog_checks.base.utils.tracking import tracked_method
from datadog_checks.sqlserver.const import STATIC_INFO_ENGINE_EDITION, STATIC_INFO_VERSION
from datadog_checks.sqlserver.utils import extract_sql_comments, is_statement_proc

try:
Expand Down Expand Up @@ -275,6 +276,8 @@ def _create_activity_event(self, active_sessions, active_connections):
"collection_interval": self.collection_interval,
"ddtags": self.tags,
"timestamp": time.time() * 1000,
'sqlserver_version': self.check.static_info_cache.get(STATIC_INFO_VERSION, ""),
'sqlserver_engine_edition': self.check.static_info_cache.get(STATIC_INFO_ENGINE_EDITION, ""),
"cloud_metadata": self.check.cloud_metadata,
"sqlserver_activity": active_sessions,
"sqlserver_connections": active_connections,
Expand Down
2 changes: 2 additions & 0 deletions sqlserver/datadog_checks/sqlserver/statements.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,8 @@ def _collect_plans(self, rows, cursor, deadline):
"timestamp": time.time() * 1000,
"dbm_type": "plan",
"cloud_metadata": self.check.cloud_metadata,
'sqlserver_version': self.check.static_info_cache.get(STATIC_INFO_VERSION, ""),
'sqlserver_engine_edition': self.check.static_info_cache.get(STATIC_INFO_ENGINE_EDITION, ""),
"db": {
"instance": row.get("database_name", None),
"plan": {
Expand Down

0 comments on commit 00c1db9

Please sign in to comment.