dt-extensions-sdk 1.7.1__py3-none-any.whl → 1.7.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dt_extensions_sdk-1.7.1.dist-info → dt_extensions_sdk-1.7.2.dist-info}/METADATA +1 -1
- {dt_extensions_sdk-1.7.1.dist-info → dt_extensions_sdk-1.7.2.dist-info}/RECORD +9 -9
- dynatrace_extension/__about__.py +1 -1
- dynatrace_extension/sdk/communication.py +1 -1
- dynatrace_extension/sdk/extension.py +3 -3
- dynatrace_extension/sdk/status.py +19 -15
- {dt_extensions_sdk-1.7.1.dist-info → dt_extensions_sdk-1.7.2.dist-info}/WHEEL +0 -0
- {dt_extensions_sdk-1.7.1.dist-info → dt_extensions_sdk-1.7.2.dist-info}/entry_points.txt +0 -0
- {dt_extensions_sdk-1.7.1.dist-info → dt_extensions_sdk-1.7.2.dist-info}/licenses/LICENSE.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: dt-extensions-sdk
|
3
|
-
Version: 1.7.
|
3
|
+
Version: 1.7.2
|
4
4
|
Project-URL: Documentation, https://github.com/dynatrace-extensions/dt-extensions-python-sdk#readme
|
5
5
|
Project-URL: Issues, https://github.com/dynatrace-extensions/dt-extensions-python-sdk/issues
|
6
6
|
Project-URL: Source, https://github.com/dynatrace-extensions/dt-extensions-python-sdk
|
@@ -1,4 +1,4 @@
|
|
1
|
-
dynatrace_extension/__about__.py,sha256=
|
1
|
+
dynatrace_extension/__about__.py,sha256=qRNIJuMF_5DRmYm6b4aociCQcAdhCKOCXEIN81aEsPQ,110
|
2
2
|
dynatrace_extension/__init__.py,sha256=MJNJYCFWLEwPmBLoETWFZddyUCMDgZfKkRycmmGM_w4,806
|
3
3
|
dynatrace_extension/cli/__init__.py,sha256=HCboY_eJPoqjFmoPDsBL8Jk6aNvank8K7JpkVrgwzUM,123
|
4
4
|
dynatrace_extension/cli/main.py,sha256=OTjJ4XHJvvYXj10a7WFFHVNnkyECPg1ClW6Os8piN8k,20168
|
@@ -18,21 +18,21 @@ dynatrace_extension/cli/create/extension_template/extension_name/__main__.py.tem
|
|
18
18
|
dynatrace_extension/sdk/__init__.py,sha256=RsqQ1heGyCmSK3fhuEKAcxQIRCg4gEK0-eSkIehL5Nc,86
|
19
19
|
dynatrace_extension/sdk/activation.py,sha256=KIoPWMZs3tKiMG8XhCfeNgRlz2vxDKcAASgSACcEfIQ,1456
|
20
20
|
dynatrace_extension/sdk/callback.py,sha256=woumpcWID09QHGc_rSrukNslVG8Qo0UQEgv8VTB6m7c,6681
|
21
|
-
dynatrace_extension/sdk/communication.py,sha256
|
21
|
+
dynatrace_extension/sdk/communication.py,sha256=uTSURmgSHit2N1hHUc3-yKmEBVMHi6hDBrdb1EaCAsE,18419
|
22
22
|
dynatrace_extension/sdk/event.py,sha256=J261imbFKpxfuAQ6Nfu3RRcsIQKKivy6fme1nww2g-8,388
|
23
|
-
dynatrace_extension/sdk/extension.py,sha256=
|
23
|
+
dynatrace_extension/sdk/extension.py,sha256=8P0ANxF3WVjVeGAA73MXTeSekpL1MarEBB6ZoKGnpZY,49669
|
24
24
|
dynatrace_extension/sdk/helper.py,sha256=m4gGHtIKYkfANC2MOGdxKUZlmH5tnZO6WTNqll27lyY,6476
|
25
25
|
dynatrace_extension/sdk/metric.py,sha256=-kq7JWpk7UGvcjqafTt-o6k4urwhsGVXmnuQg7Sf9PQ,3622
|
26
26
|
dynatrace_extension/sdk/runtime.py,sha256=7bC4gUJsVSHuL_E7r2EWrne95nm1BjZiMGkyNqA7ZCU,2796
|
27
27
|
dynatrace_extension/sdk/snapshot.py,sha256=LnWVCtCK4NIEV3_kX-ly_LGHpNBSeErtsxCI1PH3L28,7521
|
28
|
-
dynatrace_extension/sdk/status.py,sha256=
|
28
|
+
dynatrace_extension/sdk/status.py,sha256=fE0qCGaanV7Ss1144p-dLX9uJMKIb0Rs6A0pLZLPlrI,8599
|
29
29
|
dynatrace_extension/sdk/throttled_logger.py,sha256=JXDiHh8syl8R0gJ-wfxmmBqvGCBMQX4pxPkxscaCsXo,3292
|
30
30
|
dynatrace_extension/sdk/vendor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
31
31
|
dynatrace_extension/sdk/vendor/mureq/LICENSE,sha256=8AVcgZgiT_mvK1fOofXtRRr2f1dRXS_K21NuxQgP4VM,671
|
32
32
|
dynatrace_extension/sdk/vendor/mureq/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
33
33
|
dynatrace_extension/sdk/vendor/mureq/mureq.py,sha256=znF4mvzk5L03CLNozRz8UpK-fMijmSkObDFwlbhwLUg,14656
|
34
|
-
dt_extensions_sdk-1.7.
|
35
|
-
dt_extensions_sdk-1.7.
|
36
|
-
dt_extensions_sdk-1.7.
|
37
|
-
dt_extensions_sdk-1.7.
|
38
|
-
dt_extensions_sdk-1.7.
|
34
|
+
dt_extensions_sdk-1.7.2.dist-info/METADATA,sha256=FVuIQEkut5SwCh77eZrb92ngUurYD_LxUhFZab6Diw8,2721
|
35
|
+
dt_extensions_sdk-1.7.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
36
|
+
dt_extensions_sdk-1.7.2.dist-info/entry_points.txt,sha256=pweyOCgENGHjOlT6_kXYaBPOrE3p18K0UettqnNlnoE,55
|
37
|
+
dt_extensions_sdk-1.7.2.dist-info/licenses/LICENSE.txt,sha256=3Zihv0lOVYHNfDkJC-tUAU6euP9r2NexsDW4w-zqgVk,1078
|
38
|
+
dt_extensions_sdk-1.7.2.dist-info/RECORD,,
|
dynatrace_extension/__about__.py
CHANGED
@@ -343,7 +343,7 @@ class DebugClient(CommunicationClient):
|
|
343
343
|
def get_feature_sets(self) -> dict[str, list[str]]:
|
344
344
|
# This is only called from dt-sdk run, where PyYaml is installed because of dt-cli
|
345
345
|
# Do NOT move this to the top of the file
|
346
|
-
import yaml #
|
346
|
+
import yaml # noqa: PLC0415
|
347
347
|
|
348
348
|
# Grab the feature sets from the extension.yaml file
|
349
349
|
extension_yaml = yaml.safe_load(self.extension_config)
|
@@ -184,7 +184,7 @@ class Extension:
|
|
184
184
|
|
185
185
|
def __new__(cls, *args, **kwargs): # noqa: ARG004
|
186
186
|
if Extension._instance is None:
|
187
|
-
Extension._instance = super(
|
187
|
+
Extension._instance = super().__new__(cls)
|
188
188
|
return Extension._instance
|
189
189
|
|
190
190
|
def __init__(self, name: str = "") -> None:
|
@@ -412,7 +412,7 @@ class Extension:
|
|
412
412
|
else:
|
413
413
|
self._schedule_callback(callback)
|
414
414
|
|
415
|
-
def query(self):
|
415
|
+
def query(self) -> Any:
|
416
416
|
"""Callback to be executed every minute by default.
|
417
417
|
|
418
418
|
Optional method that can be implemented by subclasses.
|
@@ -683,7 +683,7 @@ class Extension:
|
|
683
683
|
msg = f"Event type must be a DtEventType enum value, got: {value}"
|
684
684
|
raise ValueError(msg)
|
685
685
|
if key == "properties":
|
686
|
-
for prop_key, prop_val in
|
686
|
+
for prop_key, prop_val in value.items():
|
687
687
|
if not isinstance(prop_key, str) or not isinstance(prop_val, str):
|
688
688
|
msg = f'invalid "properties" member: {prop_key}: {prop_val}, required: "str": str'
|
689
689
|
raise ValueError(msg)
|
@@ -114,6 +114,9 @@ class EndpointStatus:
|
|
114
114
|
def __eq__(self, other):
|
115
115
|
return isinstance(other, EndpointStatus) and self.__dict__ == other.__dict__
|
116
116
|
|
117
|
+
def __hash__(self):
|
118
|
+
return hash(tuple(sorted(self.__dict__.items())))
|
119
|
+
|
117
120
|
|
118
121
|
class EndpointStatuses:
|
119
122
|
def __init__(self, total_endpoints_number=None) -> None:
|
@@ -227,33 +230,34 @@ class EndpointStatusesMap:
|
|
227
230
|
with self._lock:
|
228
231
|
# Summarize all statuses
|
229
232
|
ok_count = 0
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
+
warning_count = 0
|
234
|
+
error_count = 0
|
235
|
+
messages_to_report = []
|
233
236
|
|
234
237
|
for ep_record in self._ep_records.values():
|
235
238
|
ep_status = ep_record.ep_status
|
236
|
-
if ep_status.status.is_warning():
|
237
|
-
has_warning_status = True
|
238
239
|
|
239
|
-
if ep_status.status.
|
240
|
-
|
241
|
-
|
240
|
+
if ep_status.status.is_warning():
|
241
|
+
warning_count += 1
|
242
|
+
messages_to_report.append(f"{ep_status.endpoint} - {ep_status.status.value} {ep_status.message}")
|
243
|
+
elif ep_status.status.is_error():
|
244
|
+
error_count += 1
|
245
|
+
messages_to_report.append(f"{ep_status.endpoint} - {ep_status.status.value} {ep_status.message}")
|
242
246
|
else:
|
243
247
|
ok_count += 1
|
244
248
|
|
249
|
+
status_msg = f"Endpoints OK: {ok_count} WARNING: {warning_count} ERROR: {error_count}"
|
250
|
+
|
245
251
|
# Early return if all OK
|
246
|
-
if
|
247
|
-
return Status(StatusValue.OK,
|
252
|
+
if error_count == 0 and warning_count == 0:
|
253
|
+
return Status(StatusValue.OK, status_msg)
|
248
254
|
|
249
255
|
# Build final status if some errors present
|
250
|
-
|
251
|
-
all_endpoints_faulty = ok_count == 0
|
256
|
+
status_msg += f" Unhealthy endpoints: {', '.join(messages_to_report)}"
|
252
257
|
|
253
|
-
if
|
258
|
+
if ok_count == 0 and warning_count == 0:
|
254
259
|
status_value = StatusValue.GENERIC_ERROR
|
255
260
|
else:
|
256
261
|
status_value = StatusValue.WARNING
|
257
262
|
|
258
|
-
|
259
|
-
return Status(status=status_value, message=message)
|
263
|
+
return Status(status=status_value, message=status_msg)
|
File without changes
|
File without changes
|
{dt_extensions_sdk-1.7.1.dist-info → dt_extensions_sdk-1.7.2.dist-info}/licenses/LICENSE.txt
RENAMED
File without changes
|