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

Add additional node metrics to monitor cpu throttling #8290

Merged
merged 8 commits into from
Jan 14, 2021

Conversation

onurdialpad
Copy link
Contributor

What does this PR do?

These metrics help people to monitor cpu throttling in the cluster

Motivation

We use Datadog for monitoring/alerting our Elasticsearch cluster which is managed by Elastic. It runs on GCP and we need to see how much the cgroup which Elasticsearch exists in uses cpu and whether cpu throttling has been increasing or not. These metrics provide that capability to everyone who needs similar stuff.

Additional Notes

No

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • PR title must be written as a CHANGELOG entry (see why)
  • Files changes must correspond to the primary purpose of the PR as described in the title (small unrelated changes should have their own PR)
  • PR must have changelog/ and integration/ labels attached

@onurdialpad onurdialpad requested a review from a team as a code owner January 5, 2021 17:55
Copy link
Contributor

@yzhan289 yzhan289 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Small nits.

elastic/datadog_checks/elastic/__about__.py Outdated Show resolved Hide resolved
requirements-agent-release.txt Outdated Show resolved Hide resolved
Comment on lines +508 to +516
'elasticsearch.cgroup.cpu.stat.number_of_elapsed_periods': (
'gauge',
'os.cgroup.cpu.stat.number_of_elapsed_periods',
),
'elasticsearch.cgroup.cpu.stat.number_of_times_throttled': (
'gauge',
'os.cgroup.cpu.stat.number_of_times_throttled',
),
'elasticsearch.process.cpu.percent': ('gauge', 'process.cpu.percent'),
Copy link
Contributor

Choose a reason for hiding this comment

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

With these three new metrics, please also add them to https://github.com/DataDog/integrations-core/blob/master/elastic/metadata.csv

Copy link
Member

@mgarabed mgarabed left a comment

Choose a reason for hiding this comment

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

Thanks for the submission, one more nit!

Comment on lines 259 to 261
elasticsearch.cgroup.cpu.stat.number_of_elapsed_periods,gauge,integer, The number of reporting periods that have elapsed
elasticsearch.cgroup.cpu.stat.number_of_times_throttled,gauge,integer, The number of times all tasks in the same cgroup as the Elasticsearch process have been throttled
elasticsearch.process.cpu.percent,gauge,integer, CPU usage in percent, or -1 if not known at the time the stats are computed
Copy link
Member

Choose a reason for hiding this comment

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

The CI reported an error with these lines, this should fix it:

Suggested change
elasticsearch.cgroup.cpu.stat.number_of_elapsed_periods,gauge,integer, The number of reporting periods that have elapsed
elasticsearch.cgroup.cpu.stat.number_of_times_throttled,gauge,integer, The number of times all tasks in the same cgroup as the Elasticsearch process have been throttled
elasticsearch.process.cpu.percent,gauge,integer, CPU usage in percent, or -1 if not known at the time the stats are computed
elasticsearch.cgroup.cpu.stat.number_of_elapsed_periods,gauge,,integer,,The number of reporting periods that have elapsed,0,elasticsearch,cgroup cpu stat
elasticsearch.cgroup.cpu.stat.number_of_times_throttled,gauge,,integer,,The number of times all tasks in the same cgroup as the Elasticsearch process have been throttled,0,elasticsearch,cpu stat throttled
elasticsearch.process.cpu.percent,gauge,,integer,,CPU usage in percent, or -1 if not known at the time the stats are computed,0,elasticsearch,process cpu percent

Copy link
Contributor Author

@onurdialpad onurdialpad Jan 6, 2021

Choose a reason for hiding this comment

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

CI reported a similar error by saying "integer is an invalid unit_name." Is it ok to add "integer" into VALID_UNIT_NAMES in metadata.py ?

Co-authored-by: Mike Garabedian <mike@mercuryrising.net>
Copy link
Member

@mgarabed mgarabed left a comment

Choose a reason for hiding this comment

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

Correct, integer is an invalid unit type, updated my suggestion and also corrected an extra comma.

elastic/metadata.csv Outdated Show resolved Hide resolved
Co-authored-by: Mike Garabedian <mike@mercuryrising.net>
@mgarabed mgarabed merged commit 4157704 into DataDog:master Jan 14, 2021
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.

None yet

3 participants