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] improvements + integrations should use wheel if available #1183

Merged
merged 20 commits into from
Apr 18, 2018
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ env:
- PIP_CACHE=$HOME/.cache/pip
- SDK_TESTING=true
- BUNDLE_PATH=$TRAVIS_BUILD_DIR/vendor/cache
- DD_AGENT_BRANCH=master
- DD_AGENT_BRANCH=jaime/pdhwheel
Copy link
Member Author

Choose a reason for hiding this comment

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

Must be switched back to master after DataDog/dd-agent#3691 is merged.

- EXTRAS_BRANCH=master
- JMXFETCH_URL="https://dd-jmxfetch.s3.amazonaws.com"
- REQ_LOCALS="$TRAVIS_BUILD_DIR,$HOME/dd-agent,$HOME/integrations-extras"
Expand Down
4 changes: 4 additions & 0 deletions active_directory/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@
* [DOCUMENTATION] Fix broken link to sample configuration file
* [FIX] Moved conf.yaml to root of folder to ensure it is consistent and shipped with the wheel
* [FIX] Remove non-existent counters
* [SANITY] Clean-up import for `PDHBaseCheck` from `datadog-checks-base` wheel. [#1183][]

1.0.0 / 2017-12-15
==================

### Changes

* [FEATURE] adds Active Directory integration.

<!--- The following link definition list is generated by PimpMyChangelog --->
[#1183]: https://github.com/DataDog/integrations-core/issues/1183
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Licensed under Simplified BSD License (see LICENSE)

# datadog
from datadog_checks.checks.win.winpdh_base import PDHBaseCheck
from datadog_checks.checks.win import PDHBaseCheck

DEFAULT_COUNTERS = [
# counterset, instance of counter, counter name, metric name
Expand Down Expand Up @@ -36,21 +36,21 @@
["NTDS", None, "DRA Outbound Values (DNs only)/sec", "active_directory.dra.outbound.values.dns_persec", "gauge"], # noqa: E501
["NTDS", None, "DRA Outbound Values Total/sec", "active_directory.dra.outbound.values.total_persec", "gauge"], # noqa: E501

#["NTDS", None, "DRA Remaining Replication Updates", "active_directory.dra.replication.remaining_updates", "gauge"], # noqa: E501
# ["NTDS", None, "DRA Remaining Replication Updates", "active_directory.dra.replication.remaining_updates", "gauge"], # noqa: E501
["NTDS", None, "DRA Pending Replication Synchronizations", "active_directory.dra.replication.pending_synchronizations", "gauge"], # noqa: E501
["NTDS", None, "DRA Sync Requests Made", "active_directory.dra.sync_requests_made", "gauge"], # noqa: E501

#["NTDS", None, "DS Security Descriptor Suboperations/sec", "active_directory.ds.security_descriptor.subops_persec", "gauge"], # noqa: E501
#["NTDS", None, "DS Security Descriptor Propagation Events", "active_directory.ds.security_descriptor.propagation_events", "gauge"], # noqa: E501
# ["NTDS", None, "DS Security Descriptor Suboperations/sec", "active_directory.ds.security_descriptor.subops_persec", "gauge"], # noqa: E501
# ["NTDS", None, "DS Security Descriptor Propagation Events", "active_directory.ds.security_descriptor.propagation_events", "gauge"], # noqa: E501
["NTDS", None, "DS Threads in Use", "active_directory.ds.threads_in_use", "gauge"], # noqa: E501

["NTDS", None, "LDAP Client Sessions", "active_directory.ldap.client_sessions", "gauge"], # noqa: E501
["NTDS", None, "LDAP Bind Time", "active_directory.ldap.bind_time", "gauge"], # noqa: E501
["NTDS", None, "LDAP Successful Binds/sec", "active_directory.ldap.successful_binds_persec", "gauge"], # noqa: E501
["NTDS", None, "LDAP Searches/sec", "active_directory.ldap.searches_persec", "gauge"], # noqa: E501

#["NTDS", None, "Kerberos Authentications/sec", "active_directory.kerberos.auths_persec", "gauge"], # noqa: E501
#["NTDS", None, "NTLM Authentications/sec", "active_directory.ntlm.auths_persec", "gauge"], # noqa: E501
# ["NTDS", None, "Kerberos Authentications/sec", "active_directory.kerberos.auths_persec", "gauge"], # noqa: E501
# ["NTDS", None, "NTLM Authentications/sec", "active_directory.ntlm.auths_persec", "gauge"], # noqa: E501
]


Expand Down
7 changes: 6 additions & 1 deletion active_directory/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
# integration pip requirements
#
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile --generate-hashes --output-file requirements.txt requirements.in
#
3 changes: 2 additions & 1 deletion active_directory/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ envlist =
flake8

[testenv]
platform = win32
platform = win32|linux2|darwin

[testenv:active_directory]
platform = win32
deps =
../datadog_checks_base
../datadog-checks-tests-helper
Expand Down
20 changes: 1 addition & 19 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ environment:
NOSE_FILTER: not unix and not fixme and not winfixme
PYWIN_PATH: C:\projects\integrations-core\.cache\pywin32-py2.7.exe
SKIP_LINT: true
DD_AGENT_BRANCH: master
DD_AGENT_BRANCH: jaime/pdhwheel
Copy link
Member Author

Choose a reason for hiding this comment

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

Must be switched back to master after DataDog/dd-agent#3691 is merged.

SDK_TESTING: true
PYTHON: C:\Python27-x64
PYTHON_VERSION: 2.7.13
Expand Down Expand Up @@ -53,30 +53,12 @@ install:
- ps: (& "$env:PYTHON/Scripts/pip.exe" install -r requirements.txt)
- ps: (& "$env:PYTHON/Scripts/pip.exe" install .)
- cd ..
- cd iis
- ps: (& "$env:PYTHON/Scripts/pip.exe" install .)
- cd ..
- cd windows_service
- ps: (& "$env:PYTHON/Scripts/pip.exe" install .)
- cd ..
- cd wmi_check
- ps: (& "$env:PYTHON/Scripts/pip.exe" install .)
- cd ..
- cd pdh_check
- ps: (& "$env:PYTHON/Scripts/pip.exe" install .)
- cd ..
- cd aspdotnet
- ps: (& "$env:PYTHON/Scripts/pip.exe" install .)
- cd ..
- cd active_directory
- ps: (& "$env:PYTHON/Scripts/pip.exe" install .)
- cd ..
- cd dotnetclr
- ps: (& "$env:PYTHON/Scripts/pip.exe" install .)
- cd ..
- cd exchange_server
- ps: (& "$env:PYTHON/Scripts/pip.exe" install .)
- cd ..
build: off
test_script:
- bundle exec rake ci:run[default]
Expand Down
9 changes: 8 additions & 1 deletion aspdotnet/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG - Aspdotnet

0.1.2 / Unreleased
==================
### Changes

* [SANITY] Clean-up import for `PDHBaseCheck` from `datadog-checks-base` wheel. [#1183][]

0.1.1 / 2018-03-07
==================
### Changes
Expand All @@ -14,4 +20,5 @@
* [FEATURE] adds aspdotnet integration.

<!--- The following link definition list is generated by PimpMyChangelog --->
[#1185]: https://github.com/DataDog/integrations-core/issues/1185
[#1183]: https://github.com/DataDog/integrations-core/issues/1183
[#1185]: https://github.com/DataDog/integrations-core/issues/1185
2 changes: 1 addition & 1 deletion aspdotnet/datadog_checks/aspdotnet/__about__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)

__version__ = '0.2.0'
__version__ = '0.1.2'
7 changes: 5 additions & 2 deletions aspdotnet/datadog_checks/aspdotnet/aspdotnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
# Licensed under Simplified BSD License (see LICENSE)

# datadog
from datadog_checks.checks.win.winpdh_base import PDHBaseCheck
try:
from datadog_checks.checks.win import PDHBaseCheck
except ImportError:
class PDHBaseCheck:
pass

EVENT_TYPE = SOURCE_TYPE_NAME = 'aspdotnet'


DEFAULT_COUNTERS = [
# counterset, instance of counter, counter name, metric name
# This set is from the Microsoft recommended counters to monitor exchange:
Expand Down
3 changes: 2 additions & 1 deletion aspdotnet/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ envlist =
flake8

[testenv]
platform = win32
platform = win32|linux2|darwin

[testenv:aspdotnet]
platform = win32
deps =
../datadog_checks_base
../datadog-checks-tests-helper
Expand Down
16 changes: 12 additions & 4 deletions datadog_checks_base/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
# CHANGELOG - datadog_checks

## 1.2.2 / Unreleased
1.2.2 / Unreleased
==================

* [BUG] Prometheus requests can use an insecure option
* [BUG] Correctly handle missing counters/strings in PDH checks when possible
* [BUG] Fix Prometheus Scrapper logger
* [SANITY] Clean-up export for `PDHBaseCheck` + export `WinPDHCounter`. [#1183][]

## 1.2.1 / 2018-03-23
1.2.1 / 2018-03-23
==================

* [BUG] Correctly handle internationalized versions of Windows in the PDH library.
* [FEATURE] Keep track of Service Checks in the Aggregator stub.

## 1.1.0 / 2018-03-23
1.1.0 / 2018-03-23
==================

* [FEATURE] Add a generic prometheus check base class & rework prometheus check using a mixin

## 1.0.0 / 2017-03-22
1.0.0 / 2017-03-22
==================

* [FEATURE] adds `datadog_checks`

<!--- The following link definition list is generated by PimpMyChangelog --->
[#1183]: https://github.com/DataDog/integrations-core/issues/1183
4 changes: 4 additions & 0 deletions datadog_checks_base/datadog_checks/checks/win/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@
try:
# Agent5 compatibility layer
from checks.libs.win.pdhbasecheck import PDHBaseCheck
from checks.libs.win.winpdh import WinPDHCounter
except ImportError:
from .winpdh_base import PDHBaseCheck
from .winpdh import WinPDHCounter


__all__ = [
'PDHBaseCheck',
'WinPDHCounter',
]
1 change: 1 addition & 0 deletions datadog_checks_base/datadog_checks/checks/win/winpdh.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
DATA_TYPE_DOUBLE = win32pdh.PDH_FMT_DOUBLE
DATA_POINT_INTERVAL = 0.10
SINGLE_INSTANCE_KEY = "__single_instance"

class WinPDHCounter(object):
# store the dictionary of pdh counter names
pdh_counter_dict = defaultdict(list)
Expand Down
7 changes: 5 additions & 2 deletions dotnetclr/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,23 @@

1.0.0 / Unreleased
==================
### Changes

* [Update] Adds wheel support and integrated unit tests
* [SANITY] Clean-up import for `PDHBaseCheck` from `datadog-checks-base` wheel. [#1183][]

0.1.1 / 2018-03-07
==================
### Changes
* [Fix] Fixed tag initialization & reporting. See [#1185][].

* [FIX] Fixed tag initialization & reporting. See [#1185][].

0.1.0 / 2018-01-10
==================

### Changes

* [FEATURE] adds dotnetclr integration.

<!--- The following link definition list is generated by PimpMyChangelog --->
[#1183]: https://github.com/DataDog/integrations-core/issues/1183
[#1185]: https://github.com/DataDog/integrations-core/issues/1185
2 changes: 1 addition & 1 deletion dotnetclr/datadog_checks/dotnetclr/dotnetclr.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Licensed under Simplified BSD License (see LICENSE)

# datadog
from datadog_checks.checks.win.winpdh_base import PDHBaseCheck
from datadog_checks.checks.win import PDHBaseCheck

EVENT_TYPE = SOURCE_TYPE_NAME = 'dotnetclr'

Expand Down
9 changes: 6 additions & 3 deletions exchange_server/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
# CHANGELOG - wmi_check
# CHANGELOG - exchange_server

1.1.0 / Unreleased
==================

### Changes

* [Update] Migrate to new wheels packaging and test framework
* [SANITY] Clean-up import for `PDHBaseCheck` from `datadog-checks-base` wheel. [#1183][]


1.0.0 / 2017-03-22
==================

### Changes

* [FEATURE] adds wmi_check integration.

<!--- The following link definition list is generated by PimpMyChangelog --->
[#1183]: https://github.com/DataDog/integrations-core/issues/1183
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Licensed under Simplified BSD License (see LICENSE)

# datadog
from datadog_checks.checks.win.winpdh_base import PDHBaseCheck
from datadog_checks.checks.win import PDHBaseCheck

DEFAULT_COUNTERS = [
# counterset, instance of counter, counter name, metric name
Expand Down
6 changes: 4 additions & 2 deletions iis/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
==================
### Changes

* [Update] Updates to new wheel packaging and test infrastructure
* [UPDATE] Updates to new wheel packaging and test infrastructure
* [SANITY] Clean-up import for `PDHBaseCheck` from `datadog-checks-base` wheel. [#1183][]

2.0.2 / 2018-03-07
==================
Expand Down Expand Up @@ -45,4 +46,5 @@ Please update your dashboards and monitors accordingly.

<!--- The following link definition list is generated by PimpMyChangelog --->
[#927]: https://github.com/DataDog/integrations-core/issues/927
[#1185]: https://github.com/DataDog/integrations-core/issues/1185
[#1183]: https://github.com/DataDog/integrations-core/issues/1183
[#1185]: https://github.com/DataDog/integrations-core/issues/1185
3 changes: 1 addition & 2 deletions iis/datadog_checks/iis/iis.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

# project
from datadog_checks.checks import AgentCheck
from datadog_checks.checks.win.winpdh_base import PDHBaseCheck

from datadog_checks.checks.win import PDHBaseCheck
from datadog_checks.utils.containers import hash_mutable

DEFAULT_COUNTERS = [
Expand Down
6 changes: 3 additions & 3 deletions pdh_check/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@

1.2.0 / Unreleased
==================

### Changes

* [Update] Update to new wheels packaging and unit test framework
* [BUGFIX] Added resilience to failed import of `WinPDHCounter`. [#1183][]
* [SANITY] Use `WinPDHCounter` shipped with `datadog-checks-base` wheel. [#1183][]

1.1.0 / 2018-01-10
==================

### Changes

* [BUGFIX] Fix tag key-value separator. [#927][]

1.0.0 / 2017-10-10
==================

### Changes

* [FEATURE] adds pdh_check integration.

<!--- The following link definition list is generated by PimpMyChangelog --->
[#927]: https://github.com/DataDog/integrations-core/issues/927
[#1183]: https://github.com/DataDog/integrations-core/issues/1183
8 changes: 5 additions & 3 deletions pdh_check/datadog_checks/pdh_check/pdh_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)

# project
from datadog_checks.utils.containers import hash_mutable
# datadog
from datadog_checks.checks.win.winpdh import WinPDHCounter
from datadog_checks.checks.win import WinPDHCounter
from datadog_checks.checks import AgentCheck

from datadog_checks.utils.containers import hash_mutable


class PDHCheck(AgentCheck):
"""
Expand Down Expand Up @@ -40,6 +40,8 @@ def __init__(self, name, init_config, agentConfig, instances=None):
for inst_name, dd_name, mtype in metrics:
m = getattr(self, mtype.lower())
obj = WinPDHCounter(counterset, inst_name, self.log)
if not obj:
continue
entry = [inst_name, dd_name, m, obj]
self.log.debug("entry: %s" % str(entry))
self._metrics[key].append(entry)
Expand Down
4 changes: 1 addition & 3 deletions pdh_check/manifest.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
{
"maintainer": "[email protected]",
"manifest_version": "0.1.1",
"max_agent_version": "6.0.0",
"manifest_version": "1.0.0",
"min_agent_version": "5.21.0",
"name": "pdh_check",
"short_description": "Collect and graph any Windows PDH metrics.",
"support": "core",
"supported_os": [
"windows"
],
"version": "1.2.0",
"guid": "D09B3410-00A0-4789-ABD7-7740C3FE211F",
"public_title": "Datadog-Pdh Check Integration",
"categories":["os & system"],
Expand Down
Loading