Skip to content

Commit 6d7744f

Browse files
authored
Add debug logging for unknown server statuses (#11587)
* add debug logging for unknown server statuses * update logging * log only for unknown * clarify service checks description * update service check descriptions
1 parent 0268fe0 commit 6d7744f

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

silk/assets/service_checks.json

+6-7
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"warning"
1414
],
1515
"name": "Silk system state",
16-
"description": "Returns `WARNING` if the check cannot access the system state but connects to endpoint, and `CRITICAL` if endpoint is inaccessible. Returns `OK` if ONLINE, `UNKNOWN` if endpoint is unaccessible."
16+
"description": "Returns `CRITICAL` if the system is degraded, `WARNING` if the system is offline. Returns `OK` if ONLINE, `UNKNOWN` if the endpoint is is inaccessible."
1717
},
1818
{
1919
"agent_version": "7.35.0",
@@ -24,12 +24,10 @@
2424
"check": "silk.server.state",
2525
"statuses": [
2626
"ok",
27-
"critical",
28-
"unknown",
29-
"warning"
27+
"unknown"
3028
],
3129
"name": "Silk servers state",
32-
"description": "Returns `WARNING` if the check cannot access the system's server state but connects to endpoint, and `CRITICAL` if endpoint is inaccessible. Returns `OK` if ONLINE, `UNKNOWN` if endpoint is unaccessible. Tagged by `server_name`."
30+
"description": "Returns `OK` if the server is ONLINE, `UNKNOWN` if the endpoint is inaccessible or returns a non-OK status. Tagged by `server_name`."
3331
},
3432
{
3533
"agent_version": "7.35.0",
@@ -40,9 +38,10 @@
4038
"check": "silk.can_connect",
4139
"statuses": [
4240
"ok",
43-
"critical"
41+
"critical",
42+
"warning"
4443
],
4544
"name": "Can connect",
46-
"description": "Returns `CRITICAL` if check cannot access stats endpoints. Returns `OK` otherwise."
45+
"description": "Returns `CRITICAL` if check cannot access stats endpoints, `WARNING` if an error response is encountered. Returns `OK` otherwise."
4746
}
4847
]

silk/datadog_checks/silk/check.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,9 @@ def submit_server_state(self):
115115
else:
116116
if server_data:
117117
for server in server_data:
118+
server_name = server.get('name')
118119
tags = deepcopy(self._tags) + [
119-
'server_name:{}'.format(server.get('name')),
120+
'server_name:{}'.format(server_name),
120121
]
121122
state = server.get('status').lower()
122123

@@ -125,6 +126,7 @@ def submit_server_state(self):
125126
else:
126127
# Other states are not documented
127128
self.service_check(self.SERVERS_SERVICE_CHECK, AgentCheck.UNKNOWN, tags=tags)
129+
self.log.debug("Server %s is reporting unknown status of `%s`.", server_name, state)
128130
else:
129131
msg = "Could not access server state, got response: {}".format(code)
130132
self.log.debug(msg)

0 commit comments

Comments
 (0)