Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cisco_aci/changelog.d/23350.removed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[Cisco ACI] Remove tenant faults as events, faults are now only to send as logs
10 changes: 0 additions & 10 deletions cisco_aci/datadog_checks/cisco_aci/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,16 +224,6 @@ def get_tenant_stats(self, tenant):
# return only the list of stats
return self._parse_response(response)

def get_tenant_events(self, tenant, page=0, page_size=15):
query1 = 'rsp-subtree-include=event-logs,no-scoped,subtree'
query2 = 'order-by=eventRecord.created|desc'
query3 = 'page={}&page-size={}'.format(page, page_size)
query = '{}&{}&{}'.format(query1, query2, query3)
path = "/api/node/mo/uni/tn-{}.json?{}".format(tenant, query)
response = self.make_request(path)
# return only the list of stats
return self._parse_response(response)

def get_fabric_pods(self):
path = '/api/mo/topology.json?query-target=subtree&target-subtree-class=fabricPod'
response = self.make_request(path)
Expand Down
1 change: 0 additions & 1 deletion cisco_aci/datadog_checks/cisco_aci/cisco.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class CiscoACICheck(AgentCheck):
def __init__(self, name, init_config, instances):
super(CiscoACICheck, self).__init__(name, init_config, instances)
self.tenant_metrics = make_tenant_metrics()
self.last_events_ts = {}
self.external_host_tags = {}
self._api_cache = {}
self.check_tags = ['cisco']
Expand Down
27 changes: 0 additions & 27 deletions cisco_aci/datadog_checks/cisco_aci/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,33 +113,6 @@ def _get_value_from_dn(regex, dn):
return None


def get_event_tags_from_dn(dn):
"""
This grabs the event tags from the dn designator. They look like this:
uni/tn-DataDog/ap-DtDg-AP1-EcommerceApp/epg-DtDg-Ecomm/HDl2IngrPktsAg1h
"""
tags = []
node = get_node_from_dn(dn)
if node:
tags.append("node:" + node)
app = get_app_from_dn(dn)
if app:
tags.append("app:" + app)
bd = get_bd_from_dn(dn)
if bd:
tags.append("bd:" + bd)
cep = get_cep_from_dn(dn)
if cep:
tags.append("mac:" + cep)
ip = get_ip_from_dn(dn)
if ip:
tags.append("ip:" + ip)
epg = get_epg_from_dn(dn)
if epg:
tags.append("epg:" + epg)
return tags


def get_hostname_from_dn(dn):
"""
This parses the hostname from a dn designator. They look like this:
Expand Down
79 changes: 0 additions & 79 deletions cisco_aci/datadog_checks/cisco_aci/tenant.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)

import datetime
import re
import time

from . import exceptions, helpers


Expand Down Expand Up @@ -58,10 +54,6 @@ def collect(self):
except (exceptions.APIConnectionException, exceptions.APIParsingException):
pass
self._submit_ten_data(t)
try:
self.collect_events(t)
except (exceptions.APIConnectionException, exceptions.APIParsingException):
pass

def _submit_app_data(self, tenant, app):
a = app.get('fvAp', {})
Expand Down Expand Up @@ -120,74 +112,3 @@ def submit_raw_obj(self, raw_stats, tags, obj_type):
metrics[dd_metric] = mval

self.submit_metrics(metrics, tags, instance=self.instance)

def collect_events(self, tenant, page=0, page_size=15):
# If there are too many events, it'll break the agent
# stop sending after it reaches page 10 (150 events per tenant)
if page >= 10:
return

event_list = self.api.get_tenant_events(tenant, page=page, page_size=15)

now = int(time.time())
prior_ts = self.last_events_ts.get(tenant)
time_window = 600
if prior_ts:
time_window = now - prior_ts

self.last_events_ts[tenant] = now

log_line = "Fetched: {} events".format(len(event_list))
if len(event_list) > 0:
created = event_list[0].get('eventRecord', {}).get('attributes', {}).get('created')
log_line += ", most recent is from: {}".format(created)
self.log.info(log_line)

for event in event_list:
ev = event.get('eventRecord', {}).get('attributes', {})
created = ev.get('created')
create_date = re.search(r'\d{4}-\d{2}-\d{1,2}T\d{2}:\d{2}:\d{2}', created).group(0)

self.log.debug("ev time: %s", created)
strptime = datetime.datetime.strptime(create_date, '%Y-%m-%dT%H:%M:%S')
timestamp = (strptime - datetime.datetime(1970, 1, 1)).total_seconds()
if now - timestamp > time_window:
return

self.log.debug("sending an event!")

title = "The resource: " + ev['affected'] + " emitted an event"
dn_tags = helpers.get_event_tags_from_dn(ev['dn'])
tags = ["tenant:" + tenant]
tags = tags + self.user_tags + self.check_tags
if 'code' in ev:
tags.append("code:" + ev['code'])
if 'user' in ev:
tags.append("user:" + ev['user'])
if 'cause' in ev:
tags.append("cause:" + ev['cause'])
if 'severity' in ev:
tags.append("severity:" + ev['severity'])
self.check.event(
{
'timestamp': timestamp,
'event_type': 'cisco_aci',
'msg_title': title,
'msg_text': ev['descr'],
"tags": tags + dn_tags,
"aggregation_key": ev['id'],
'host': self.check.hostname,
}
)

# if we get to the end without running out of new events, move onto the next page
# there is a bug when sometimes it'll return 30 events despite the page size setting
if len(event_list) != 0 and len(event_list) % 15 == 0:
self.collect_events(tenant, page=page + 1, page_size=15)

@property
def last_events_ts(self):
if self.instance_hash not in self.check.last_events_ts:
self.check.last_events_ts[self.instance_hash] = {}

return self.check.last_events_ts[self.instance_hash]
2 changes: 0 additions & 2 deletions cisco_aci/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,6 @@
# 0d6ca781810665156211b355129ba2f1 - Api.get_eqpt_capacity
'_api_mo_topology_json_query_target_subtree_target_subtree_class_fabricPod',
# 643d217904f09445fbc9f7b43cd131f0 - Api.get_fabric_pods
'_api_node_mo_uni_tn_DataDog_json_rsp_subtree_include_event_logs_no_scoped_subtree_order_by_eventRecord_created_desc_page_0_page_size_15', # noqa: E501
# d0260e4832537b43b1acb38bcfa58063 - Api.get_tenant_events
'_api_mo_uni_tn_DataDog_json_query_target_subtree_target_subtree_class_fvAp',
# 4efe80304d50330f5ed0f79252ef0a84 - Api.get_apps
'_api_mo_uni_tn_DataDog_json_rsp_subtree_include_stats_no_scoped',
Expand Down
22 changes: 0 additions & 22 deletions cisco_aci/tests/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
get_bd_from_dn,
get_cep_from_dn,
get_epg_from_dn,
get_event_tags_from_dn,
get_hostname_from_dn,
get_ip_from_dn,
get_node_from_dn,
Expand Down Expand Up @@ -117,27 +116,6 @@ def test_parse_capacity_tags():
assert all(a == b for a, b in zip(res, ['fabric_pod_id:1']))


def test_get_event_tags_from_dn():
assert get_event_tags_from_dn(None) == []
assert get_event_tags_from_dn("") == []
res = get_event_tags_from_dn("aa/ap-AA/epg-BB/pod-1/node-2/ip-CC/cep-DD/BD-EE/aa")
assert all(
a == b
for a, b in zip(
res,
[
'node:2',
'app:AA',
'bd:EE',
'mac:DD',
'ip:CC',
'epg:BB',
'pod:1',
],
)
)


def test_get_hostname_from_dn():
assert get_hostname_from_dn(None) is None
assert get_hostname_from_dn("") is None
Expand Down
3 changes: 0 additions & 3 deletions cisco_aci/tests/test_tenant.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ def get_tenant_stats(self, tenant):
{"other": {"attributes": {"attr": "3"}}},
]

def get_tenant_events(self, tenant, page=0, page_size=15):
return []

def get_epg_meta(self, tenant, app, epg):
return [{"fvCEp": {"attributes": {"ip": "ip1", "mac": "mac1", "encap": "encap1"}}}]

Expand Down
1 change: 1 addition & 0 deletions kafka_consumer/changelog.d/23388.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Lower log level from WARN to DEBUG for the message emitted when a consumer group has offsets for a partition but no stored highwater offset (typically during leader failover).
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ def report_consumer_offsets_and_lag(
reported_contexts += 1

if (topic, partition) not in highwater_offsets:
self.log.warning(
self.log.debug(
"Consumer group: %s has offsets for topic: %s partition: %s, "
"but no stored highwater offset (likely the partition is in the middle of leader failover) "
"so cannot calculate consumer lag.",
Expand Down
2 changes: 1 addition & 1 deletion sqlserver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The SQL Server integration tracks the performance of your SQL Server instances.

Enable [Database Monitoring](https://docs.datadoghq.com/database_monitoring/setup_sql_server/) (DBM) for enhanced insight into query performance and database health. In addition to the standard integration, Datadog DBM provides query-level metrics, live and historical query snapshots, wait event analysis, database load, query explain plans, and blocking query insights.

SQL Server 2012, 2014, 2016, 2017, 2019, and 2022 are supported.
SQL Server 2012, 2014, 2016, 2017, 2019, 2022, and 2025 are supported.

**Minimum Agent version:** 6.0.0

Expand Down
1 change: 1 addition & 0 deletions sqlserver/changelog.d/23395.added
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add SQL Server 2025 to list of supported versions.
Loading