Skip to content

Commit 8abd626

Browse files
mfpierretruthbk
authored andcommitted
Fix deprecation warning on A5 (DataDog#2317)
1 parent 06b2f9d commit 8abd626

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

kubernetes_state/datadog_checks/kubernetes_state/kubernetes_state.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,9 @@ def __init__(self, name, init_config, agentConfig, instances=None):
4242
super(KubernetesState, self).__init__(name, init_config, agentConfig, instances=generic_instances)
4343

4444
self.send_pod_phase_service_checks = is_affirmative(instance.get('send_pod_phase_service_checks', True))
45-
self._deprecations['send_pod_phase_service_checks'] = [
46-
False,
47-
"DEPRECATION NOTICE: pod phase service checks are deprecated. Please set "
48-
"`send_pod_phase_service_checks` to false and rely on corresponding gauges instead",
49-
]
45+
if self.send_pod_phase_service_checks:
46+
self.warning("DEPRECATION NOTICE: pod phase service checks are deprecated. Please set "
47+
"`send_pod_phase_service_checks` to false and rely on corresponding gauges instead")
5048

5149
self.pod_phase_to_status = {
5250
'Pending': self.WARNING,
@@ -400,7 +398,6 @@ def kube_pod_status_phase(self, metric, scraper_config):
400398
if self.send_pod_phase_service_checks:
401399
pod_tag = self._label_to_tag('pod', sample[self.SAMPLE_LABELS], scraper_config)
402400
namespace_tag = self._label_to_tag('namespace', sample[self.SAMPLE_LABELS], scraper_config)
403-
self._log_deprecation('send_pod_phase_service_checks')
404401
self._condition_to_tag_check(sample, check_basename, self.pod_phase_to_status, scraper_config,
405402
tags=[pod_tag, namespace_tag] + scraper_config['custom_tags'])
406403

0 commit comments

Comments
 (0)