forked from ContinuumLLC/beats
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add linux/rapl metricset (elastic#28238)
* first pass at rapl metricset * finish up rapl code * create docs, cleanup * add config to docs * x-pack update * fix rollover issues, naming * make notice * fix docs * add build tags, fix a few things * create some working tests * add doc.go files * run format, again * please play nice CI
- Loading branch information
1 parent
298d786
commit d2569fd
Showing
23 changed files
with
1,038 additions
and
2 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
//// | ||
This file is generated! See scripts/mage/docs_collector.go | ||
//// | ||
|
||
[[metricbeat-metricset-linux-rapl]] | ||
=== Linux rapl metricset | ||
|
||
beta[] | ||
|
||
include::../../../module/linux/rapl/_meta/docs.asciidoc[] | ||
|
||
|
||
==== Fields | ||
|
||
For a description of each field in the metricset, see the | ||
<<exported-fields-linux,exported fields>> section. | ||
|
||
Here is an example document generated by this metricset: | ||
|
||
[source,json] | ||
---- | ||
include::../../../module/linux/rapl/_meta/data.json[] | ||
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,8 @@ | |
# - conntrack | ||
# - iostat | ||
# - pressure | ||
# - rapl | ||
enabled: true | ||
#hostfs: /hostfs | ||
#rapl.use_msr_safe: false | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"@timestamp": "2017-10-12T08:05:34.853Z", | ||
"event": { | ||
"dataset": "linux.rapl", | ||
"duration": 115000, | ||
"module": "linux" | ||
}, | ||
"linux": { | ||
"rapl": { | ||
"core": 0, | ||
"dram": { | ||
"joules": 38106.59, | ||
"watts": 5.912 | ||
}, | ||
"package": { | ||
"joules": 25764.9984, | ||
"watts": 11.5784 | ||
}, | ||
"pp0": { | ||
"joules": 27353.5644, | ||
"watts": 2.7159 | ||
} | ||
} | ||
}, | ||
"metricset": { | ||
"name": "rapl", | ||
"period": 10000 | ||
}, | ||
"service": { | ||
"type": "linux" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
The RAPL metricset reports power usage in Watts as reported by Intel's RAPL (Running Average Power Limit) API. In practice, RAPL is used for setting power usage limits on a CPU, but it can also be used for monitoring power usage. | ||
|
||
RAPL is available on most Intel CPUs in some form since Sandy Bridge, however, this implementation requires a linux distro that exposes intel MSRs (model-specific registers) via `/dev/cpu/[CPU]/msr`. You can check to see if your linux distro and CPU support RAPL by running | ||
|
||
``` | ||
sudo rdmsr 0x606 | ||
``` | ||
If that command returns a hex value such as `a1003`, RAPL is supported. | ||
|
||
RAPL divides a CPU into four domains, each one corresponding to a component within the hardware itself: `Package`, `DRAM`, `PP0` (usually the collective power usage of the cores), and `PP1` (usually the integrated GPU). Not all packages are available on all CPUs, and the RAPL metricset will report all RAPL domains that it finds. | ||
|
||
|
||
[float] | ||
=== msr-safe usage | ||
|
||
|
||
This metricset also supports https://github.com/LLNL/msr-safe[msr-safe], which allows a user to access an MSR device without root. The `rapl.use_msr_safe` flag in the linux module config will enable usage of the `/dev/cpu/[CPU]/msr_safe` device. | ||
|
||
|
||
For existing msr-safe installs, the following allowlist will open all RAPL MSRs for reading: | ||
|
||
``` | ||
0x00000606 0x0000000000000000 # "SMSR_RAPL_POWER_UNIT" | ||
|
||
0x00000610 0x0000000000000000 # "SMSR_PACKAGE_POWER_LIMIT" | ||
0x00000611 0x0000000000000000 # "SMSR_PACKAGE_ENERGY_STATUS" | ||
0x00000613 0x0000000000000000 # "SMSR_PACKAGE_PERF_STATUS" | ||
0x00000614 0x0000000000000000 # "SMSR_PACKAGE_POWER_INFO" | ||
|
||
0x00000618 0x0000000000000000 # "SMSR_DRAM_POWER_LIMIT" | ||
0x00000619 0x0000000000000000 # "SMSR_DRAM_ENERGY_STATUS" | ||
0x0000061b 0x0000000000000000 # "SMSR_DRAM_PERF_STATUS" | ||
0x0000061c 0x0000000000000000 # "SMSR_DRAM_POWER_INFO" | ||
|
||
0x00000638 0x0000000000000000 # "SMSR_PP0_POWER_LIMIT" | ||
0x00000639 0x0000000000000000 # "SMSR_PP0_ENERGY_STATUS" | ||
0x0000063a 0x0000000000000000 # "SMSR_PP0_POLICY" | ||
0x0000063b 0x0000000000000000 # "SMSR_PP0_PERF_STATUS" | ||
|
||
0x00000640 0x0000000000000000 # "SMSR_PP1_POWER_LIMIT" | ||
0x00000641 0x0000000000000000 # "SMSR_PP1_ENERGY_STATUS" | ||
0x00000642 0x0000000000000000 # "SMSR_PP1_POLICY" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
- name: rapl | ||
type: group | ||
release: beta | ||
description: > | ||
Wattage as reported by Intel RAPL | ||
fields: | ||
- name: core | ||
type: long | ||
description: > | ||
The core where the RAPL request originated from. Only one core is queried per hardware CPU. | ||
- name: dram.watts | ||
type: float | ||
description: > | ||
Power usage in watts on the DRAM RAPL domain | ||
- name: dram.joules | ||
type: float | ||
description: > | ||
Raw power usage counter for the DRAM domain | ||
- name: pp0.watts | ||
type: float | ||
description: > | ||
Power usage in watts on the PP0 RAPL domain | ||
- name: pp0.joules | ||
type: float | ||
description: > | ||
Raw power usage counter for the PP0 domain | ||
- name: pp1.watts | ||
type: float | ||
description: > | ||
Power usage in watts on the PP1 RAPL domain | ||
- name: pp1.joules | ||
type: float | ||
description: > | ||
Raw power usage counter for the PP1 domain | ||
- name: package.watts | ||
type: float | ||
description: > | ||
Power usage in watts on the Package RAPL domain | ||
- name: package.joules | ||
type: float | ||
description: > | ||
Raw power usage counter for the package domain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Licensed to Elasticsearch B.V. under one or more contributor | ||
// license agreements. See the NOTICE file distributed with | ||
// this work for additional information regarding copyright | ||
// ownership. Elasticsearch B.V. licenses this file to you under | ||
// the Apache License, Version 2.0 (the "License"); you may | ||
// not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
|
||
package rapl |
Binary file not shown.
Oops, something went wrong.