Skip to content

Commit

Permalink
Enable new_gc_metrics JMX config option for new installations (#9501)
Browse files Browse the repository at this point in the history
* Enable `new_gc_metrics` JMX config option for new installations

* fix tests
  • Loading branch information
ofek authored Jun 11, 2021
1 parent 440dcdc commit 0ef4a3f
Show file tree
Hide file tree
Showing 25 changed files with 40 additions and 33 deletions.
2 changes: 1 addition & 1 deletion activemq/datadog_checks/activemq/data/conf.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ init_config:
## jvm.gc.major_collection_time
## The default value is false to ensure backward compatibility.
#
# new_gc_metrics: false
new_gc_metrics: true

## @param service_check_prefix - string - optional
## Custom service check prefix. e.g. `my_prefix` to get a service check called `my_prefix.can_connect`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def shared_conf(field, value):


def shared_new_gc_metrics(field, value):
return False
return True


def shared_service(field, value):
Expand Down
2 changes: 1 addition & 1 deletion cassandra/datadog_checks/cassandra/data/conf.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ init_config:
## jvm.gc.major_collection_time
## The default value is false to ensure backward compatibility.
#
# new_gc_metrics: false
new_gc_metrics: true

## @param service_check_prefix - string - optional
## Custom service check prefix. e.g. `my_prefix` to get a service check called `my_prefix.can_connect`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ init_config:
## jvm.gc.major_collection_time
## The default value is false to ensure backward compatibility.
#
# new_gc_metrics: false
new_gc_metrics: true

## @param service_check_prefix - string - required
## Service check prefix to use.
Expand Down
5 changes: 5 additions & 0 deletions datadog_checks_dev/datadog_checks/dev/jmx.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,8 @@
'jmx.gc.minor_collection_count',
'jmx.gc.minor_collection_time',
]

JVM_E2E_METRICS_NEW = list(JVM_E2E_METRICS)
JVM_E2E_METRICS_NEW.remove('jvm.gc.cms.count')
JVM_E2E_METRICS_NEW.remove('jvm.gc.parnew.time')
JVM_E2E_METRICS_NEW.extend(m.replace('jmx.', 'jvm.', 1) for m in JMX_E2E_METRICS)
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@
jvm.gc.parnew.time => jvm.gc.minor_collection_time
jvm.gc.major_collection_time
The default value is false to ensure backward compatibility.
enabled: true
value:
display_default: false
example: true
type: boolean
example: false
- name: service_check_prefix
description: |
Custom service check prefix. e.g. `my_prefix` to get a service check called `my_prefix.can_connect`.
Expand Down
2 changes: 1 addition & 1 deletion hazelcast/datadog_checks/hazelcast/data/conf.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ init_config:
## jvm.gc.major_collection_time
## The default value is false to ensure backward compatibility.
#
# new_gc_metrics: false
new_gc_metrics: true

## @param service_check_prefix - string - optional
## Custom service check prefix. e.g. `my_prefix` to get a service check called `my_prefix.can_connect`.
Expand Down
2 changes: 1 addition & 1 deletion hive/datadog_checks/hive/data/conf.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ init_config:
## jvm.gc.major_collection_time
## The default value is false to ensure backward compatibility.
#
# new_gc_metrics: false
new_gc_metrics: true

## @param service_check_prefix - string - optional
## Custom service check prefix. e.g. `my_prefix` to get a service check called `my_prefix.can_connect`.
Expand Down
2 changes: 1 addition & 1 deletion hivemq/datadog_checks/hivemq/data/conf.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ init_config:
## jvm.gc.major_collection_time
## The default value is false to ensure backward compatibility.
#
# new_gc_metrics: false
new_gc_metrics: true

## @param service_check_prefix - string - optional
## Custom service check prefix. e.g. `my_prefix` to get a service check called `my_prefix.can_connect`.
Expand Down
2 changes: 1 addition & 1 deletion ignite/datadog_checks/ignite/data/conf.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ init_config:
## jvm.gc.major_collection_time
## The default value is false to ensure backward compatibility.
#
# new_gc_metrics: false
new_gc_metrics: true

## @param service_check_prefix - string - optional
## Custom service check prefix. e.g. `my_prefix` to get a service check called `my_prefix.can_connect`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ init_config:
## jvm.gc.major_collection_time
## The default value is false to ensure backward compatibility.
#
# new_gc_metrics: false
new_gc_metrics: true

## @param service_check_prefix - string - required
## Service check prefix to use.
Expand Down
2 changes: 1 addition & 1 deletion kafka/datadog_checks/kafka/config_models/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def shared_conf(field, value):


def shared_new_gc_metrics(field, value):
return False
return True


def shared_service(field, value):
Expand Down
2 changes: 1 addition & 1 deletion kafka/datadog_checks/kafka/data/conf.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ init_config:
## jvm.gc.major_collection_time
## The default value is false to ensure backward compatibility.
#
# new_gc_metrics: false
new_gc_metrics: true

## @param service_check_prefix - string - optional
## Custom service check prefix. e.g. `my_prefix` to get a service check called `my_prefix.can_connect`.
Expand Down
6 changes: 3 additions & 3 deletions kafka/tests/test_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import pytest

from datadog_checks.dev.jmx import JVM_E2E_METRICS
from datadog_checks.dev.jmx import JVM_E2E_METRICS_NEW
from datadog_checks.dev.utils import get_metadata_metrics

from .common import KAFKA_E2E_METRICS
Expand All @@ -15,8 +15,8 @@ def test(dd_agent_check):
instance = {}
aggregator = dd_agent_check(instance, rate=True)

for metric in KAFKA_E2E_METRICS + JVM_E2E_METRICS:
for metric in KAFKA_E2E_METRICS + JVM_E2E_METRICS_NEW:
aggregator.assert_metric(metric)

aggregator.assert_all_metrics_covered()
aggregator.assert_metrics_using_metadata(get_metadata_metrics(), exclude=JVM_E2E_METRICS)
aggregator.assert_metrics_using_metadata(get_metadata_metrics(), exclude=JVM_E2E_METRICS_NEW)
2 changes: 1 addition & 1 deletion presto/datadog_checks/presto/data/conf.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ init_config:
## jvm.gc.major_collection_time
## The default value is false to ensure backward compatibility.
#
# new_gc_metrics: false
new_gc_metrics: true

## @param service_check_prefix - string - optional
## Custom service check prefix. e.g. `my_prefix` to get a service check called `my_prefix.can_connect`.
Expand Down
6 changes: 3 additions & 3 deletions presto/tests/test_presto.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Licensed under a 3-clause BSD style license (see LICENSE)
import pytest

from datadog_checks.dev.jmx import JVM_E2E_METRICS
from datadog_checks.dev.jmx import JVM_E2E_METRICS_NEW
from datadog_checks.dev.utils import get_metadata_metrics

from .common import METRICS
Expand All @@ -15,8 +15,8 @@ def test(dd_agent_check):
instance = {}
aggregator = dd_agent_check(instance, rate=True)

for metric in METRICS + JVM_E2E_METRICS:
for metric in METRICS + JVM_E2E_METRICS_NEW:
aggregator.assert_metric(metric)

aggregator.assert_all_metrics_covered()
aggregator.assert_metrics_using_metadata(get_metadata_metrics(), exclude=JVM_E2E_METRICS)
aggregator.assert_metrics_using_metadata(get_metadata_metrics(), exclude=JVM_E2E_METRICS_NEW)
2 changes: 1 addition & 1 deletion solr/datadog_checks/solr/data/conf.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ init_config:
## jvm.gc.major_collection_time
## The default value is false to ensure backward compatibility.
#
# new_gc_metrics: false
new_gc_metrics: true

## @param service_check_prefix - string - optional
## Custom service check prefix. e.g. `my_prefix` to get a service check called `my_prefix.can_connect`.
Expand Down
6 changes: 3 additions & 3 deletions solr/tests/test_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import pytest

from datadog_checks.base.stubs.aggregator import AggregatorStub
from datadog_checks.dev.jmx import JVM_E2E_METRICS
from datadog_checks.dev.jmx import JVM_E2E_METRICS_NEW
from datadog_checks.dev.utils import get_metadata_metrics

from .common import SOLR_METRICS
Expand All @@ -16,9 +16,9 @@ def test_e2e(dd_agent_check):
instance = {}
aggregator = dd_agent_check(instance, rate=True) # type: AggregatorStub

for metric in SOLR_METRICS + JVM_E2E_METRICS:
for metric in SOLR_METRICS + JVM_E2E_METRICS_NEW:
aggregator.assert_metric(metric)

aggregator.assert_all_metrics_covered()

aggregator.assert_metrics_using_metadata(get_metadata_metrics(), exclude=JVM_E2E_METRICS)
aggregator.assert_metrics_using_metadata(get_metadata_metrics(), exclude=JVM_E2E_METRICS_NEW)
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def shared_is_jmx(field, value):


def shared_new_gc_metrics(field, value):
return False
return True


def shared_proxy(field, value):
Expand Down
2 changes: 1 addition & 1 deletion sonarqube/datadog_checks/sonarqube/data/conf.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ init_config:
## jvm.gc.major_collection_time
## The default value is false to ensure backward compatibility.
#
# new_gc_metrics: false
new_gc_metrics: true

## @param service_check_prefix - string - optional
## Custom service check prefix. e.g. `my_prefix` to get a service check called `my_prefix.can_connect`.
Expand Down
4 changes: 2 additions & 2 deletions sonarqube/tests/metrics.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# (C) Datadog, Inc. 2020-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from datadog_checks.dev.jmx import JVM_E2E_METRICS
from datadog_checks.dev.jmx import JVM_E2E_METRICS_NEW

JMX_METRICS = [
'sonarqube.server.async_execution.largest_worker_count',
Expand All @@ -23,7 +23,7 @@
'sonarqube.server.database.pool_max_wait_millis',
'sonarqube.server.database.pool_remove_abandoned_timeout_seconds',
]
JMX_METRICS.extend(JVM_E2E_METRICS)
JMX_METRICS.extend(JVM_E2E_METRICS_NEW)

WEB_METRICS = [
'sonarqube.complexity.cognitive_complexity',
Expand Down
2 changes: 1 addition & 1 deletion tomcat/datadog_checks/tomcat/config_models/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def shared_conf(field, value):


def shared_new_gc_metrics(field, value):
return False
return True


def shared_service(field, value):
Expand Down
2 changes: 1 addition & 1 deletion tomcat/datadog_checks/tomcat/data/conf.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ init_config:
## jvm.gc.major_collection_time
## The default value is false to ensure backward compatibility.
#
# new_gc_metrics: false
new_gc_metrics: true

## @param service_check_prefix - string - optional
## Custom service check prefix. e.g. `my_prefix` to get a service check called `my_prefix.can_connect`.
Expand Down
4 changes: 2 additions & 2 deletions tomcat/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
from datadog_checks.dev import get_here
from datadog_checks.dev.jmx import JVM_E2E_METRICS
from datadog_checks.dev.jmx import JVM_E2E_METRICS_NEW

CHECK_NAME = "tomcat"

Expand All @@ -29,4 +29,4 @@
"tomcat.string_cache.hit_count",
"tomcat.web.cache.hit_count",
"tomcat.web.cache.lookup_count",
] + JVM_E2E_METRICS
] + JVM_E2E_METRICS_NEW
4 changes: 2 additions & 2 deletions tomcat/tests/test_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import pytest

from datadog_checks.dev.jmx import JVM_E2E_METRICS
from datadog_checks.dev.jmx import JVM_E2E_METRICS_NEW
from datadog_checks.dev.utils import get_metadata_metrics

from .common import TOMCAT_E2E_METRICS
Expand Down Expand Up @@ -39,4 +39,4 @@ def test(dd_agent_check):

aggregator.assert_all_metrics_covered()

aggregator.assert_metrics_using_metadata(get_metadata_metrics(), exclude=JVM_E2E_METRICS + COUNTER_METRICS)
aggregator.assert_metrics_using_metadata(get_metadata_metrics(), exclude=JVM_E2E_METRICS_NEW + COUNTER_METRICS)

0 comments on commit 0ef4a3f

Please sign in to comment.