datadog-checks-base 37.7.0__py2.py3-none-any.whl → 37.8.0__py2.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.
Files changed (47) hide show
  1. datadog_checks/base/__about__.py +1 -1
  2. datadog_checks/base/__init__.py +3 -43
  3. datadog_checks/base/__init__.pyi +31 -0
  4. datadog_checks/base/checks/__init__.py +2 -4
  5. datadog_checks/base/checks/__init__.pyi +7 -0
  6. datadog_checks/base/checks/base.py +58 -27
  7. datadog_checks/base/checks/kube_leader/__init__.py +2 -5
  8. datadog_checks/base/checks/kube_leader/__init__.pyi +8 -0
  9. datadog_checks/base/checks/kubelet_base/__init__.py +6 -0
  10. datadog_checks/base/checks/kubelet_base/__init__.pyi +6 -0
  11. datadog_checks/base/checks/openmetrics/__init__.py +2 -4
  12. datadog_checks/base/checks/openmetrics/__init__.pyi +6 -0
  13. datadog_checks/base/checks/openmetrics/v2/scraper.py +0 -2
  14. datadog_checks/base/checks/openmetrics/v2/transformers/__init__.py +3 -10
  15. datadog_checks/base/checks/openmetrics/v2/transformers/__init__.pyi +26 -0
  16. datadog_checks/base/checks/prometheus/__init__.py +2 -5
  17. datadog_checks/base/checks/prometheus/__init__.pyi +8 -0
  18. datadog_checks/base/checks/prometheus/mixins.py +1 -1
  19. datadog_checks/base/checks/win/__init__.py +2 -4
  20. datadog_checks/base/checks/win/__init__.pyi +7 -0
  21. datadog_checks/base/checks/win/wmi/__init__.py +2 -386
  22. datadog_checks/base/checks/win/wmi/__init__.pyi +32 -0
  23. datadog_checks/base/checks/win/wmi/base.py +390 -0
  24. datadog_checks/base/log.py +10 -8
  25. datadog_checks/base/stubs/datadog_agent.py +5 -6
  26. datadog_checks/base/utils/_http_utils.py +51 -0
  27. datadog_checks/base/utils/db/__init__.py +3 -2
  28. datadog_checks/base/utils/db/__init__.pyi +7 -0
  29. datadog_checks/base/utils/db/sql.py +2 -2
  30. datadog_checks/base/utils/db/utils.py +3 -3
  31. datadog_checks/base/utils/discovery/__init__.py +3 -1
  32. datadog_checks/base/utils/discovery/__init__.pyi +6 -0
  33. datadog_checks/base/utils/format/__init__.py +3 -0
  34. datadog_checks/base/utils/format/_json.py +43 -0
  35. datadog_checks/base/utils/format/json.py +30 -0
  36. datadog_checks/base/utils/http.py +37 -66
  37. datadog_checks/base/utils/metadata/__init__.py +3 -1
  38. datadog_checks/base/utils/metadata/__init__.pyi +6 -0
  39. datadog_checks/base/utils/prometheus/__init__.py +2 -1
  40. datadog_checks/base/utils/prometheus/__init__.pyi +6 -0
  41. datadog_checks/base/utils/replay/execute.py +6 -5
  42. datadog_checks/base/utils/replay/redirect.py +8 -7
  43. datadog_checks/base/utils/serialization.py +5 -0
  44. datadog_checks/base/utils/tracing.py +10 -1
  45. {datadog_checks_base-37.7.0.dist-info → datadog_checks_base-37.8.0.dist-info}/METADATA +18 -8
  46. {datadog_checks_base-37.7.0.dist-info → datadog_checks_base-37.8.0.dist-info}/RECORD +47 -29
  47. {datadog_checks_base-37.7.0.dist-info → datadog_checks_base-37.8.0.dist-info}/WHEEL +0 -0
@@ -1,4 +1,4 @@
1
1
  # (C) Datadog, Inc. 2018-present
2
2
  # All rights reserved
3
3
  # Licensed under a 3-clause BSD style license (see LICENSE)
4
- __version__ = "37.7.0"
4
+ __version__ = "37.8.0"
@@ -1,51 +1,11 @@
1
1
  # (C) Datadog, Inc. 2018-present
2
2
  # All rights reserved
3
3
  # Licensed under a 3-clause BSD style license (see LICENSE)
4
- from datadog_checks.base.agent import datadog_agent
4
+ import lazy_loader
5
5
 
6
- from .__about__ import __version__
7
- from .checks import AgentCheck
8
- from .checks.openmetrics import OpenMetricsBaseCheck
9
- from .checks.openmetrics.v2.base import OpenMetricsBaseCheckV2
10
- from .config import is_affirmative
11
- from .errors import ConfigurationError
12
- from .utils.common import ensure_bytes, ensure_unicode, to_native_string, to_string
6
+ __getattr__, __dir__, __all__ = lazy_loader.attach_stub(__name__, __file__)
13
7
 
14
- if datadog_agent.get_config('use_boringssl'):
8
+ if __getattr__('datadog_agent').get_config('use_boringssl'):
15
9
  import urllib3.contrib.pyopenssl
16
10
 
17
11
  urllib3.contrib.pyopenssl.inject_into_urllib3()
18
-
19
- # Windows-only
20
- try:
21
- from .checks.win import PDHBaseCheck
22
- except ImportError:
23
- PDHBaseCheck = None
24
-
25
- # Windows-only and Python 3+
26
- try:
27
- from .checks.windows.perf_counters import PerfCountersBaseCheck
28
- except Exception:
29
- PerfCountersBaseCheck = None
30
-
31
- # Kubernetes dep will not always be installed
32
- try:
33
- from .checks.kube_leader import KubeLeaderElectionBaseCheck
34
- except ImportError:
35
- KubeLeaderElectionBaseCheck = None
36
-
37
- __all__ = [
38
- '__version__',
39
- 'AgentCheck',
40
- 'KubeLeaderElectionBaseCheck',
41
- 'OpenMetricsBaseCheck',
42
- 'OpenMetricsBaseCheckV2',
43
- 'PDHBaseCheck',
44
- 'PerfCountersBaseCheck',
45
- 'ConfigurationError',
46
- 'ensure_bytes',
47
- 'ensure_unicode',
48
- 'is_affirmative',
49
- 'to_native_string',
50
- 'to_string', # For backwards compat (was renamed to `to_native_string`).
51
- ]
@@ -0,0 +1,31 @@
1
+ # (C) Datadog, Inc. 2025-present
2
+ # All rights reserved
3
+ # Licensed under a 3-clause BSD style license (see LICENSE)
4
+ from .__about__ import __version__
5
+ from .agent import datadog_agent
6
+ from .checks import AgentCheck
7
+ from .checks.kube_leader import KubeLeaderElectionBaseCheck
8
+ from .checks.openmetrics import OpenMetricsBaseCheck
9
+ from .checks.openmetrics.v2.base import OpenMetricsBaseCheckV2
10
+ from .checks.win import PDHBaseCheck
11
+ from .checks.windows.perf_counters import PerfCountersBaseCheck
12
+ from .config import is_affirmative
13
+ from .errors import ConfigurationError
14
+ from .utils.common import ensure_bytes, ensure_unicode, to_native_string, to_string
15
+
16
+ __all__ = [
17
+ '__version__',
18
+ 'AgentCheck',
19
+ 'ConfigurationError',
20
+ 'KubeLeaderElectionBaseCheck',
21
+ 'OpenMetricsBaseCheck',
22
+ 'OpenMetricsBaseCheckV2',
23
+ 'PDHBaseCheck',
24
+ 'PerfCountersBaseCheck',
25
+ 'datadog_agent',
26
+ 'ensure_bytes',
27
+ 'ensure_unicode',
28
+ 'is_affirmative',
29
+ 'to_native_string',
30
+ 'to_string',
31
+ ]
@@ -1,8 +1,6 @@
1
1
  # (C) Datadog, Inc. 2018-present
2
2
  # All rights reserved
3
3
  # Licensed under a 3-clause BSD style license (see LICENSE)
4
+ import lazy_loader
4
5
 
5
- from .base import AgentCheck
6
- from .network import EventType, NetworkCheck, Status
7
-
8
- __all__ = ['AgentCheck', 'NetworkCheck', 'Status', 'EventType']
6
+ __getattr__, __dir__, __all__ = lazy_loader.attach_stub(__name__, __file__)
@@ -0,0 +1,7 @@
1
+ # (C) Datadog, Inc. 2025-present
2
+ # All rights reserved
3
+ # Licensed under a 3-clause BSD style license (see LICENSE)
4
+ from .base import AgentCheck
5
+ from .network import EventType, NetworkCheck, Status
6
+
7
+ __all__ = ['AgentCheck', 'EventType', 'NetworkCheck', 'Status']
@@ -1,15 +1,14 @@
1
1
  # (C) Datadog, Inc. 2018-present
2
2
  # All rights reserved
3
3
  # Licensed under a 3-clause BSD style license (see LICENSE)
4
+ from __future__ import annotations
5
+
4
6
  import copy
5
7
  import functools
6
8
  import importlib
7
- import inspect
8
9
  import logging
9
10
  import os
10
11
  import re
11
- import traceback
12
- import unicodedata
13
12
  from collections import deque
14
13
  from os.path import basename
15
14
  from typing import ( # noqa: F401
@@ -27,10 +26,10 @@ from typing import ( # noqa: F401
27
26
  Union,
28
27
  )
29
28
 
30
- import yaml
31
- from pydantic import BaseModel, ValidationError
29
+ import lazy_loader
32
30
 
33
31
  from datadog_checks.base.agent import AGENT_RUNNING, aggregator, datadog_agent
32
+ from datadog_checks.base.utils.format import json
34
33
 
35
34
  from ..config import is_affirmative
36
35
  from ..constants import ServiceCheck
@@ -46,15 +45,8 @@ from ..types import (
46
45
  )
47
46
  from ..utils.agent.utils import should_profile_memory
48
47
  from ..utils.common import ensure_bytes, to_native_string
49
- from ..utils.diagnose import Diagnosis
50
48
  from ..utils.fips import enable_fips
51
- from ..utils.http import RequestsWrapper
52
- from ..utils.limiter import Limiter
53
- from ..utils.metadata import MetadataManager
54
- from ..utils.secrets import SecretsSanitizer
55
- from ..utils.serialization import from_json, to_json
56
49
  from ..utils.tagging import GENERIC_TAGS
57
- from ..utils.tls import TlsContextWrapper
58
50
  from ..utils.tracing import traced_class
59
51
 
60
52
  if AGENT_RUNNING:
@@ -87,7 +79,18 @@ if is_affirmative(datadog_agent.get_config('integration_profiling')):
87
79
  prof.start()
88
80
 
89
81
  if TYPE_CHECKING:
82
+ import inspect as _module_inspect
90
83
  import ssl # noqa: F401
84
+ import traceback as _module_traceback
85
+ import unicodedata as _module_unicodedata
86
+
87
+ from datadog_checks.base.utils.diagnose import Diagnosis
88
+ from datadog_checks.base.utils.http import RequestsWrapper
89
+ from datadog_checks.base.utils.metadata import MetadataManager
90
+
91
+ inspect: _module_inspect = lazy_loader.load('inspect')
92
+ traceback: _module_traceback = lazy_loader.load('traceback')
93
+ unicodedata: _module_unicodedata = lazy_loader.load('unicodedata')
91
94
 
92
95
  # Metric types for which it's only useful to submit once per set of tags
93
96
  ONE_PER_CONTEXT_METRIC_TYPES = [aggregator.GAUGE, aggregator.RATE, aggregator.MONOTONIC_COUNT]
@@ -342,6 +345,9 @@ class AgentCheck(object):
342
345
  limit = self._get_metric_limit(instance=instance)
343
346
 
344
347
  if limit > 0:
348
+ # See Performance Optimizations in this package's README.md.
349
+ from datadog_checks.base.utils.limiter import Limiter
350
+
345
351
  return Limiter(name, 'metrics', limit, self.warning)
346
352
 
347
353
  return None
@@ -386,17 +392,22 @@ class AgentCheck(object):
386
392
  """
387
393
  Convenience wrapper to ease programmatic use of this class from the C API.
388
394
  """
395
+ # See Performance Optimizations in this package's README.md.
396
+ import yaml
397
+
389
398
  return yaml.safe_load(yaml_str)
390
399
 
391
400
  @property
392
- def http(self):
393
- # type: () -> RequestsWrapper
401
+ def http(self) -> RequestsWrapper:
394
402
  """
395
403
  Provides logic to yield consistent network behavior based on user configuration.
396
404
 
397
405
  Only new checks or checks on Agent 6.13+ can and should use this for HTTP requests.
398
406
  """
399
407
  if not hasattr(self, '_http'):
408
+ # See Performance Optimizations in this package's README.md.
409
+ from datadog_checks.base.utils.http import RequestsWrapper
410
+
400
411
  self._http = RequestsWrapper(self.instance or {}, self.init_config, self.HTTP_CONFIG_REMAPPER, self.log)
401
412
 
402
413
  return self._http
@@ -432,12 +443,14 @@ class AgentCheck(object):
432
443
  return self.__formatted_tags
433
444
 
434
445
  @property
435
- def diagnosis(self):
436
- # type: () -> Diagnosis
446
+ def diagnosis(self) -> Diagnosis:
437
447
  """
438
448
  A Diagnosis object to register explicit diagnostics and record diagnoses.
439
449
  """
440
450
  if not hasattr(self, '_diagnosis'):
451
+ # See Performance Optimizations in this package's README.md.
452
+ from datadog_checks.base.utils.diagnose import Diagnosis
453
+
441
454
  self._diagnosis = Diagnosis(sanitize=self.sanitize)
442
455
  return self._diagnosis
443
456
 
@@ -451,6 +464,9 @@ class AgentCheck(object):
451
464
  Since: Agent 7.24
452
465
  """
453
466
  if not hasattr(self, '_tls_context_wrapper'):
467
+ # See Performance Optimizations in this package's README.md.
468
+ from datadog_checks.base.utils.tls import TlsContextWrapper
469
+
454
470
  self._tls_context_wrapper = TlsContextWrapper(
455
471
  self.instance or {}, self.TLS_CONFIG_REMAPPER, overrides=overrides
456
472
  )
@@ -461,8 +477,7 @@ class AgentCheck(object):
461
477
  return self._tls_context_wrapper.tls_context
462
478
 
463
479
  @property
464
- def metadata_manager(self):
465
- # type: () -> MetadataManager
480
+ def metadata_manager(self) -> MetadataManager:
466
481
  """
467
482
  Used for sending metadata via Go bindings.
468
483
  """
@@ -470,6 +485,9 @@ class AgentCheck(object):
470
485
  if not self.check_id and AGENT_RUNNING:
471
486
  raise RuntimeError('Attribute `check_id` must be set')
472
487
 
488
+ # See Performance Optimizations in this package's README.md.
489
+ from datadog_checks.base.utils.metadata import MetadataManager
490
+
473
491
  self._metadata_manager = MetadataManager(self.name, self.check_id, self.log, self.METADATA_TRANSFORMERS)
474
492
 
475
493
  return self._metadata_manager
@@ -498,8 +516,9 @@ class AgentCheck(object):
498
516
  return False
499
517
 
500
518
  def log_typos_in_options(self, user_config, models_config, level):
501
- # only import it when running in python 3
519
+ # See Performance Optimizations in this package's README.md.
502
520
  from jellyfish import jaro_winkler_similarity
521
+ from pydantic import BaseModel
503
522
 
504
523
  user_configs = user_config or {} # type: Dict[str, Any]
505
524
  models_config = models_config or {}
@@ -570,6 +589,8 @@ class AgentCheck(object):
570
589
 
571
590
  model = getattr(package, model_name, None)
572
591
  if model is not None:
592
+ from pydantic import ValidationError
593
+
573
594
  try:
574
595
  config_model = model.model_validate(config, context=context)
575
596
  except ValidationError as e:
@@ -598,12 +619,14 @@ class AgentCheck(object):
598
619
  def _get_config_model_context(self, config):
599
620
  return {'logger': self.log, 'warning': self.warning, 'configured_fields': frozenset(config)}
600
621
 
601
- def register_secret(self, secret):
602
- # type: (str) -> None
622
+ def register_secret(self, secret: str) -> None:
603
623
  """
604
624
  Register a secret to be scrubbed by `.sanitize()`.
605
625
  """
606
626
  if not hasattr(self, '_sanitizer'):
627
+ # See Performance Optimizations in this package's README.md.
628
+ from datadog_checks.base.utils.secrets import SecretsSanitizer
629
+
607
630
  # Configure lazily so that checks that don't use sanitization aren't affected.
608
631
  self._sanitizer = SecretsSanitizer()
609
632
  self.log.setup_sanitization(sanitize=self.sanitize)
@@ -953,6 +976,10 @@ class AgentCheck(object):
953
976
  # type: (str, ServiceCheckStatus, Sequence[str], str, str, bool) -> None
954
977
  """Send the status of a service.
955
978
 
979
+ !!! warning "Soft Deprecation"
980
+ When building new checks avoid submitting service checks.
981
+ **Checks that already submit service checks will continue to do so.**
982
+
956
983
  Parameters:
957
984
  name (str):
958
985
  the name of the service check
@@ -1005,15 +1032,15 @@ class AgentCheck(object):
1005
1032
  # convert seconds to milliseconds
1006
1033
  attributes['timestamp'] = int(timestamp * 1000)
1007
1034
 
1008
- datadog_agent.send_log(to_json(attributes), self.check_id)
1035
+ datadog_agent.send_log(json.encode(attributes), self.check_id)
1009
1036
  if cursor is not None:
1010
- self.write_persistent_cache('log_cursor_{}'.format(stream), to_json(cursor))
1037
+ self.write_persistent_cache('log_cursor_{}'.format(stream), json.encode(cursor))
1011
1038
 
1012
1039
  def get_log_cursor(self, stream='default'):
1013
1040
  # type: (str) -> dict[str, Any] | None
1014
1041
  """Returns the most recent log cursor from disk."""
1015
1042
  data = self.read_persistent_cache('log_cursor_{}'.format(stream))
1016
- return from_json(data) if data else None
1043
+ return json.decode(data) if data else None
1017
1044
 
1018
1045
  def _log_deprecation(self, deprecation_key, *args):
1019
1046
  # type: (str, *str) -> None
@@ -1184,7 +1211,11 @@ class AgentCheck(object):
1184
1211
  The agent calls this method to retrieve diagnostics from integrations. This method
1185
1212
  runs explicit diagnostics if available.
1186
1213
  """
1187
- return to_json([d._asdict() for d in (self.diagnosis.diagnoses + self.diagnosis.run_explicit())])
1214
+ return json.encode([d._asdict() for d in (self.diagnosis.diagnoses + self.diagnosis.run_explicit())])
1215
+
1216
+ def _clear_diagnosis(self) -> None:
1217
+ if hasattr(self, '_diagnosis'):
1218
+ self._diagnosis.clear()
1188
1219
 
1189
1220
  def _get_requests_proxy(self):
1190
1221
  # type: () -> ProxySettings
@@ -1268,7 +1299,7 @@ class AgentCheck(object):
1268
1299
  def run(self):
1269
1300
  # type: () -> str
1270
1301
  try:
1271
- self.diagnosis.clear()
1302
+ self._clear_diagnosis()
1272
1303
  # Ignore check initializations if running in a separate process
1273
1304
  if is_affirmative(self.instance.get('process_isolation', self.init_config.get('process_isolation', False))):
1274
1305
  from ..utils.replay.execute import run_with_isolation
@@ -1304,7 +1335,7 @@ class AgentCheck(object):
1304
1335
  except Exception as e:
1305
1336
  message = self.sanitize(str(e))
1306
1337
  tb = self.sanitize(traceback.format_exc())
1307
- error_report = to_json([{'message': message, 'traceback': tb}])
1338
+ error_report = json.encode([{'message': message, 'traceback': tb}])
1308
1339
  finally:
1309
1340
  if self.metric_limiter:
1310
1341
  if is_affirmative(self.debug_metrics.get('metric_contexts', False)):
@@ -1,9 +1,6 @@
1
1
  # (C) Datadog, Inc. 2018-present
2
2
  # All rights reserved
3
3
  # Licensed under a 3-clause BSD style license (see LICENSE)
4
+ import lazy_loader
4
5
 
5
- from .base_check import KubeLeaderElectionBaseCheck
6
- from .mixins import KubeLeaderElectionMixin
7
- from .record import ElectionRecordAnnotation, ElectionRecordLease
8
-
9
- __all__ = ['KubeLeaderElectionMixin', 'ElectionRecordAnnotation', 'ElectionRecordLease', 'KubeLeaderElectionBaseCheck']
6
+ __getattr__, __dir__, __all__ = lazy_loader.attach_stub(__name__, __file__)
@@ -0,0 +1,8 @@
1
+ # (C) Datadog, Inc. 2025-present
2
+ # All rights reserved
3
+ # Licensed under a 3-clause BSD style license (see LICENSE)
4
+ from .base_check import KubeLeaderElectionBaseCheck
5
+ from .mixins import KubeLeaderElectionMixin
6
+ from .record import ElectionRecordAnnotation, ElectionRecordLease
7
+
8
+ __all__ = ['ElectionRecordAnnotation', 'ElectionRecordLease', 'KubeLeaderElectionBaseCheck', 'KubeLeaderElectionMixin']
@@ -0,0 +1,6 @@
1
+ # (C) Datadog, Inc. 2025-present
2
+ # All rights reserved
3
+ # Licensed under a 3-clause BSD style license (see LICENSE)
4
+ import lazy_loader
5
+
6
+ __getattr__, __dir__, __all__ = lazy_loader.attach_stub(__name__, __file__)
@@ -0,0 +1,6 @@
1
+ # (C) Datadog, Inc. 2025-present
2
+ # All rights reserved
3
+ # Licensed under a 3-clause BSD style license (see LICENSE)
4
+ from .base import KubeletBase
5
+
6
+ __all__ = ['KubeletBase']
@@ -1,8 +1,6 @@
1
1
  # (C) Datadog, Inc. 2018-present
2
2
  # All rights reserved
3
3
  # Licensed under a 3-clause BSD style license (see LICENSE)
4
+ import lazy_loader
4
5
 
5
-
6
- from .base_check import OpenMetricsBaseCheck
7
-
8
- __all__ = ['OpenMetricsBaseCheck']
6
+ __getattr__, __dir__, __all__ = lazy_loader.attach_stub(__name__, __file__)
@@ -0,0 +1,6 @@
1
+ # (C) Datadog, Inc. 2025-present
2
+ # All rights reserved
3
+ # Licensed under a 3-clause BSD style license (see LICENSE)
4
+ from .base_check import OpenMetricsBaseCheck
5
+
6
+ __all__ = ['OpenMetricsBaseCheck']
@@ -50,7 +50,6 @@ class OpenMetricsScraper:
50
50
  """
51
51
  The base class for any scraper overrides.
52
52
  """
53
-
54
53
  self.config = config
55
54
 
56
55
  # Save a reference to the check instance
@@ -393,7 +392,6 @@ class OpenMetricsScraper:
393
392
  """
394
393
  Yield the connection line.
395
394
  """
396
-
397
395
  try:
398
396
  with self.get_connection() as connection:
399
397
  # Media type will be used to select parser dynamically
@@ -1,13 +1,6 @@
1
1
  # (C) Datadog, Inc. 2020-present
2
2
  # All rights reserved
3
3
  # Licensed under a 3-clause BSD style license (see LICENSE)
4
- from .counter import get_counter
5
- from .counter_gauge import get_counter_gauge
6
- from .gauge import get_gauge
7
- from .histogram import get_histogram
8
- from .metadata import get_metadata
9
- from .rate import get_rate
10
- from .service_check import get_service_check
11
- from .summary import get_summary
12
- from .temporal_percent import get_temporal_percent
13
- from .time_elapsed import get_time_elapsed
4
+ import lazy_loader
5
+
6
+ __getattr__, __dir__, __all__ = lazy_loader.attach_stub(__name__, __file__)
@@ -0,0 +1,26 @@
1
+ # (C) Datadog, Inc. 2025-present
2
+ # All rights reserved
3
+ # Licensed under a 3-clause BSD style license (see LICENSE)
4
+ from .counter import get_counter
5
+ from .counter_gauge import get_counter_gauge
6
+ from .gauge import get_gauge
7
+ from .histogram import get_histogram
8
+ from .metadata import get_metadata
9
+ from .rate import get_rate
10
+ from .service_check import get_service_check
11
+ from .summary import get_summary
12
+ from .temporal_percent import get_temporal_percent
13
+ from .time_elapsed import get_time_elapsed
14
+
15
+ __all__ = [
16
+ 'get_counter',
17
+ 'get_counter_gauge',
18
+ 'get_gauge',
19
+ 'get_histogram',
20
+ 'get_metadata',
21
+ 'get_rate',
22
+ 'get_service_check',
23
+ 'get_summary',
24
+ 'get_temporal_percent',
25
+ 'get_time_elapsed',
26
+ ]
@@ -1,9 +1,6 @@
1
1
  # (C) Datadog, Inc. 2018-present
2
2
  # All rights reserved
3
3
  # Licensed under a 3-clause BSD style license (see LICENSE)
4
+ import lazy_loader
4
5
 
5
- from .base_check import GenericPrometheusCheck, PrometheusScraper
6
- from .mixins import PrometheusFormat, UnknownFormatError
7
- from .prometheus_base import PrometheusCheck
8
-
9
- __all__ = ['PrometheusFormat', 'UnknownFormatError', 'PrometheusCheck', 'GenericPrometheusCheck', 'PrometheusScraper']
6
+ __getattr__, __dir__, __all__ = lazy_loader.attach_stub(__name__, __file__)
@@ -0,0 +1,8 @@
1
+ # (C) Datadog, Inc. 2025-present
2
+ # All rights reserved
3
+ # Licensed under a 3-clause BSD style license (see LICENSE)
4
+ from .base_check import GenericPrometheusCheck, PrometheusScraper
5
+ from .mixins import PrometheusFormat, UnknownFormatError
6
+ from .prometheus_base import PrometheusCheck
7
+
8
+ __all__ = ['GenericPrometheusCheck', 'PrometheusCheck', 'PrometheusFormat', 'PrometheusScraper', 'UnknownFormatError']
@@ -569,7 +569,7 @@ class PrometheusScraperMixin(object):
569
569
  and not handler.ignore_tls_warning
570
570
  and not is_affirmative(handler.options.get('ssl_verify', True))
571
571
  ):
572
- self.log.warning(u'An unverified HTTPS request is being made to %s', endpoint)
572
+ self.log.debug(u'An unverified HTTPS request is being made to %s', endpoint)
573
573
 
574
574
  try:
575
575
  response = handler.get(endpoint, extra_headers=headers, stream=False)
@@ -1,8 +1,6 @@
1
1
  # (C) Datadog, Inc. 2018-present
2
2
  # All rights reserved
3
3
  # Licensed under a 3-clause BSD style license (see LICENSE)
4
+ import lazy_loader
4
5
 
5
- from .winpdh import WinPDHCounter
6
- from .winpdh_base import PDHBaseCheck
7
-
8
- __all__ = ['PDHBaseCheck', 'WinPDHCounter']
6
+ __getattr__, __dir__, __all__ = lazy_loader.attach_stub(__name__, __file__)
@@ -0,0 +1,7 @@
1
+ # (C) Datadog, Inc. 2025-present
2
+ # All rights reserved
3
+ # Licensed under a 3-clause BSD style license (see LICENSE)
4
+ from .winpdh import WinPDHCounter
5
+ from .winpdh_base import PDHBaseCheck
6
+
7
+ __all__ = ['PDHBaseCheck', 'WinPDHCounter']