From b90d83a28891d1601e753b7e6f9bddc1a7e37e41 Mon Sep 17 00:00:00 2001 From: Zhengda Lu Date: Thu, 24 Jul 2025 10:59:19 -0400 Subject: [PATCH 1/5] [DBMON-5536] collect index stats on replica set secondaries (#20819) * collect index stats on replica set secondaries * add changelog --- mongo/changelog.d/20819.added | 1 + mongo/datadog_checks/mongo/collectors/index_stats.py | 12 +++++++++++- mongo/tests/test_integration.py | 1 + 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 mongo/changelog.d/20819.added diff --git a/mongo/changelog.d/20819.added b/mongo/changelog.d/20819.added new file mode 100644 index 0000000000000..c11487872f2f8 --- /dev/null +++ b/mongo/changelog.d/20819.added @@ -0,0 +1 @@ +Collect index stats metric `mongodb.collection.indexes.accesses.opsps` on replica set secondary nodes. diff --git a/mongo/datadog_checks/mongo/collectors/index_stats.py b/mongo/datadog_checks/mongo/collectors/index_stats.py index 397467328f7ad..993ac4095fbe8 100644 --- a/mongo/datadog_checks/mongo/collectors/index_stats.py +++ b/mongo/datadog_checks/mongo/collectors/index_stats.py @@ -5,6 +5,7 @@ from pymongo.errors import OperationFailure from datadog_checks.mongo.collectors.base import MongoCollector, collection_interval_checker +from datadog_checks.mongo.common import ReplicaSetDeployment from datadog_checks.mongo.metrics import INDEX_METRICS @@ -20,7 +21,16 @@ def __init__(self, check, db_name, tags, coll_names=None): self._collector_key = (self.__class__.__name__, db_name) # db_name is part of collector key def compatible_with(self, deployment): - # Can only be run once per cluster. + if isinstance(deployment, ReplicaSetDeployment): + # Collecting index stats on both primary and secondary nodes for replica set + if deployment.is_arbiter: + self.log.debug("IndexStatsCollector can not be run on arbiter nodes.") + return False + if deployment.use_shards: + self.log.debug("IndexStatsCollector can not be run on shards on sharded clusters.") + return False + return True + # Collecting index stats for standalone or mongos on sharding deployments return deployment.is_principal() def _get_collections(self, api): diff --git a/mongo/tests/test_integration.py b/mongo/tests/test_integration.py index ee553834c64c1..732c6fd9e6804 100644 --- a/mongo/tests/test_integration.py +++ b/mongo/tests/test_integration.py @@ -782,6 +782,7 @@ def test_integration_replicaset_secondary( 'dbstats-local', 'fsynclock', 'hostinfo', + 'indexes-stats', ] if collect_custom_queries: metrics_categories.append('custom-queries') From f6d09b63b5a02401a8de5145a9ca1ee2314ee6ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Desgroppes?= Date: Thu, 24 Jul 2025 17:48:10 +0200 Subject: [PATCH 2/5] Lift `pyodbc` dependency exclusion for macOS on AArch64/ARM64 (#20812) This removes a special case where `pyodbc` was depended on by all target platforms (including macOS on x86_64/AMD64) *except macOS on AArch64/ARM64*. There's no reason to keep the exclusion since `pyodbc` 5.2.0 is available for `macosx_11_0_arm64`, see: https://pypi.org/project/pyodbc/5.2.0/#files --- agent_requirements.in | 2 +- ibm_i/changelog.d/20812.fixed | 1 + ibm_i/pyproject.toml | 2 +- sqlserver/changelog.d/20812.fixed | 1 + sqlserver/pyproject.toml | 2 +- 5 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 ibm_i/changelog.d/20812.fixed create mode 100644 sqlserver/changelog.d/20812.fixed diff --git a/agent_requirements.in b/agent_requirements.in index 14e20e940df81..2fed54052c1b8 100644 --- a/agent_requirements.in +++ b/agent_requirements.in @@ -40,7 +40,7 @@ pyjwt==2.10.1 pymongo[srv]==4.8.0; python_version >= '3.9' pymqi==1.12.11 pymysql==1.1.1 -pyodbc==5.2.0; sys_platform != 'darwin' or platform_machine != 'arm64' +pyodbc==5.2.0 pyopenssl==25.1.0 pysmi==1.2.1 pysnmp-mibs==0.1.6 diff --git a/ibm_i/changelog.d/20812.fixed b/ibm_i/changelog.d/20812.fixed new file mode 100644 index 0000000000000..1640228d3f620 --- /dev/null +++ b/ibm_i/changelog.d/20812.fixed @@ -0,0 +1 @@ +Lift `pyodbc` dependency exclusion for macOS on AArch64/ARM64 diff --git a/ibm_i/pyproject.toml b/ibm_i/pyproject.toml index 81a8c2f08a528..a1e24009853ad 100644 --- a/ibm_i/pyproject.toml +++ b/ibm_i/pyproject.toml @@ -37,7 +37,7 @@ license = "BSD-3-Clause" [project.optional-dependencies] deps = [ - "pyodbc==5.2.0; sys_platform != 'darwin' or platform_machine != 'arm64'", + "pyodbc==5.2.0", ] [project.urls] diff --git a/sqlserver/changelog.d/20812.fixed b/sqlserver/changelog.d/20812.fixed new file mode 100644 index 0000000000000..1640228d3f620 --- /dev/null +++ b/sqlserver/changelog.d/20812.fixed @@ -0,0 +1 @@ +Lift `pyodbc` dependency exclusion for macOS on AArch64/ARM64 diff --git a/sqlserver/pyproject.toml b/sqlserver/pyproject.toml index f14df11d81b71..89fcb06ca50e3 100644 --- a/sqlserver/pyproject.toml +++ b/sqlserver/pyproject.toml @@ -39,7 +39,7 @@ license = "BSD-3-Clause" deps = [ "azure-identity==1.23.0", "lxml==5.1.1", - "pyodbc==5.2.0; sys_platform != 'darwin' or platform_machine != 'arm64'", + "pyodbc==5.2.0", "pywin32==310; sys_platform == 'win32'", ] From 1ac737480d8ace98c359ab99944b0b34821bb410 Mon Sep 17 00:00:00 2001 From: Bryce Eadie Date: Thu, 24 Jul 2025 09:01:56 -0700 Subject: [PATCH 3/5] Add link to config example (#20835) --- microsoft_sysmon/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/microsoft_sysmon/README.md b/microsoft_sysmon/README.md index f8d171329f79a..474d3a299cdc2 100644 --- a/microsoft_sysmon/README.md +++ b/microsoft_sysmon/README.md @@ -40,6 +40,8 @@ Run powershell.exe as admin and execute the following command: sourcecategory: windowsevent ``` +See the [sample microsoft_sysmon.d/conf.yaml][9] for available configuration options. + 3. [Restart the Agent][3]. #### Configure Sysmon @@ -115,3 +117,4 @@ Need help? Contact [Datadog support][1]. [6]: https://docs.datadoghq.com/agent/guide/integration-management/?tab=windowspowershell#install [7]: https://learn.microsoft.com/en-us/sysinternals/downloads/sysmon#configuration-files [8]: https://docs.datadoghq.com/agent/guide/agent-commands/#agent-status-and-information +[9]: https://github.com/DataDog/integrations-core/blob/master/microsoft_sysmon/datadog_checks/microsoft_sysmon/data/conf.yaml.example From 035e0b052e7ec84c991c7b068197cdddc427a1bf Mon Sep 17 00:00:00 2001 From: Piotr WOLSKI Date: Thu, 24 Jul 2025 11:11:02 -0600 Subject: [PATCH 4/5] kafka_consumer: lowercase Kafka cluster in data streams messages feature (#20842) --- .../datadog_checks/kafka_consumer/kafka_consumer.py | 2 +- kafka_consumer/tests/test_unit.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/kafka_consumer/datadog_checks/kafka_consumer/kafka_consumer.py b/kafka_consumer/datadog_checks/kafka_consumer/kafka_consumer.py index e094f45a8f87d..df1df586ee023 100644 --- a/kafka_consumer/datadog_checks/kafka_consumer/kafka_consumer.py +++ b/kafka_consumer/datadog_checks/kafka_consumer/kafka_consumer.py @@ -418,7 +418,7 @@ def data_streams_live_message(self, highwater_offsets, cluster_id): config_id = cfg["id"] if self._messages_have_been_retrieved(config_id): continue - if cluster != cluster_id: + if not cluster or not cluster_id or cluster.lower() != cluster_id.lower(): continue start_offsets = resolve_start_offsets(highwater_offsets, topic, partition, start_offset, n_messages) diff --git a/kafka_consumer/tests/test_unit.py b/kafka_consumer/tests/test_unit.py index 6160b9bdccd3b..b4631696ba83f 100644 --- a/kafka_consumer/tests/test_unit.py +++ b/kafka_consumer/tests/test_unit.py @@ -26,7 +26,7 @@ def fake_consumer_offsets_for_times(partitions): return [(t, p, 80) for t, p in partitions] -def seed_mock_client(): +def seed_mock_client(cluster_id="cluster_id"): """Set some common defaults for the mock client to kafka.""" client = mock.create_autospec(KafkaClient) client.list_consumer_groups.return_value = ["consumer_group1"] @@ -34,7 +34,7 @@ def seed_mock_client(): client.list_consumer_group_offsets.return_value = [("consumer_group1", [("topic1", "partition1", 2)])] client.describe_consumer_group.return_value = 'STABLE' client.consumer_get_cluster_id_and_list_topics.return_value = ( - "cluster_id", + cluster_id, # topics [ # Used in unit tets @@ -618,7 +618,7 @@ def test_data_streams_messages( } ), ) - mock_client = seed_mock_client() + mock_client = seed_mock_client(cluster_id="Cluster_id") mock_client.get_next_message.side_effect = [ MockedMessage( b'{"name": "Peter Parker", "age": 18, "transaction_amount": 123, "currency": "dollar"}', From 6c3916ba2c1e192e5f2b7ec3cb8c0d9c5820c07b Mon Sep 17 00:00:00 2001 From: Gabriel Dos Santos <91925154+gabedos@users.noreply.github.com> Date: Thu, 24 Jul 2025 14:52:21 -0400 Subject: [PATCH 5/5] ECS Fargate docs update (#20845) --- ecs_fargate/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ecs_fargate/README.md b/ecs_fargate/README.md index f2f9cd2f16b90..56ab45bec174c 100644 --- a/ecs_fargate/README.md +++ b/ecs_fargate/README.md @@ -201,7 +201,7 @@ partial --> ```hcl module "ecs_fargate_task" { - source = "https://registry.terraform.io/modules/DataDog/ecs-datadog/aws/latest" + source = "DataDog/ecs-datadog/aws//modules/ecs_fargate" version = "1.0.0" # Configure Datadog @@ -1038,7 +1038,7 @@ To enable logging through the [Datadog ECS Fargate Terraform][71] module, config ```hcl module "ecs_fargate_task" { - source = "https://registry.terraform.io/modules/DataDog/ecs-datadog/aws/latest" + source = "DataDog/ecs-datadog/aws//modules/ecs_fargate" version = "1.0.0" # Configure Datadog