Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDH to be able to use new agent signature #5936

Merged
merged 12 commits into from
Mar 23, 2020
Merged

Conversation

hithwen
Copy link
Contributor

@hithwen hithwen commented Mar 2, 2020

Also remove multi instance support. All key based dictionaries have been converted into single lists.
Dictionaries have been left as dictionaries and _make_counters preserves the unused key attribute to prevent breaking IIS check.

Failing integrations Clickhouse, HTTP and TLS are failing on master too

Note: A Bug has been introduced in this PR and the fix is here: #6162

@codecov
Copy link

codecov bot commented Mar 2, 2020

Codecov Report

Merging #5936 into master will increase coverage by 0.75%.
The diff coverage is n/a.

Impacted Files Coverage Δ
datadog_checks_base/tests/test_pdhbasecheck.py 36.25% <0.00%> (-61.25%) ⬇️
datadog_checks_base/tests/test_winpdh.py 40.81% <0.00%> (-51.03%) ⬇️
datadog_checks_base/tests/test_wmisampler.py 51.21% <0.00%> (-43.91%) ⬇️
disk/tests/common.py 63.63% <0.00%> (-36.37%) ⬇️
disk/tests/conftest.py 85.71% <0.00%> (-11.43%) ⬇️
disk/tests/test_filter.py 96.45% <0.00%> (-3.55%) ⬇️
fluentd/datadog_checks/fluentd/fluentd.py 88.88% <0.00%> (-2.42%) ⬇️
disk/datadog_checks/disk/disk.py 83.88% <0.00%> (-2.07%) ⬇️
fluentd/tests/test_metadata.py 100.00% <0.00%> (ø)
fluentd/tests/test_integration.py 100.00% <0.00%> (ø)
... and 303 more

Copy link
Contributor

@ofek ofek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hithwen
Copy link
Contributor Author

hithwen commented Mar 16, 2020

You'll need to pre-process the args like https://github.com/DataDog/integrations-core/pull/4469/files#diff-09e2f9e4c13710e993b2ce26901f9065

Shouldn't AgentCheck be in charge of that?

@hithwen
Copy link
Contributor Author

hithwen commented Mar 18, 2020

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@hithwen hithwen requested a review from ofek March 19, 2020 11:41
Copy link
Contributor

@ofek ofek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

asp is failing

Copy link
Contributor

@ofek ofek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to extract things before super() like:

args = list(args)
default_instances = kwargs.pop('default_instances', None) or {}
default_namespace = kwargs.pop('default_namespace', None)
legacy_kwargs_in_args = args[4:]
del args[4:]
if len(legacy_kwargs_in_args) > 0:
default_instances = legacy_kwargs_in_args[0] or {}
if len(legacy_kwargs_in_args) > 1:
default_namespace = legacy_kwargs_in_args[1]
super(OpenMetricsBaseCheck, self).__init__(*args, **kwargs)

@hithwen
Copy link
Contributor Author

hithwen commented Mar 19, 2020

Need to extract things before super() like:

args = list(args)
default_instances = kwargs.pop('default_instances', None) or {}
default_namespace = kwargs.pop('default_namespace', None)
legacy_kwargs_in_args = args[4:]
del args[4:]
if len(legacy_kwargs_in_args) > 0:
default_instances = legacy_kwargs_in_args[0] or {}
if len(legacy_kwargs_in_args) > 1:
default_namespace = legacy_kwargs_in_args[1]
super(OpenMetricsBaseCheck, self).__init__(*args, **kwargs)

Does it make a difference to do it before or after?

@hithwen hithwen force-pushed the julia/AI-547-agentConfig-pdh branch from 58ff425 to 69fd749 Compare March 20, 2020 09:31
@hithwen hithwen merged commit 3446f64 into master Mar 23, 2020
@hithwen hithwen deleted the julia/AI-547-agentConfig-pdh branch March 23, 2020 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants