-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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 cgroup cpu/mem/disk usage metrics #16472
Add cgroup cpu/mem/disk usage metrics #16472
Conversation
processing/src/main/java/org/apache/druid/java/util/metrics/CgroupCpuMonitor.java
Outdated
Show resolved
Hide resolved
processing/src/main/java/org/apache/druid/java/util/metrics/cgroups/CgroupUtil.java
Outdated
Show resolved
Hide resolved
processing/src/main/java/org/apache/druid/java/util/metrics/cgroups/CgroupUtil.java
Outdated
Show resolved
Hide resolved
processing/src/main/java/org/apache/druid/java/util/metrics/cgroups/CgroupUtil.java
Outdated
Show resolved
Hide resolved
processing/src/main/java/org/apache/druid/java/util/metrics/cgroups/Cpu.java
Outdated
Show resolved
Hide resolved
Added a few comments but overall, the change looks good to me. Were you able to validate that you were getting the right values for these? One way would be to test your assumptions in Docker and see if your numbers match with what Docker sees. |
Yeah tested in docker to see the formats match. But for cpu usage percentage, where do you want me to confirm from ? |
The Docker desktop UI displays CPU usage for a container, but I'm not 100% sure if even Docker does it right. But if it does, it'll give you additional confidence. |
I have tested with Datadog, even though the %s aren't exactly matching up, the spikes are matching. So I think it is safe to assume working fine. |
47cca7f
to
ba6fea9
Compare
processing/src/test/java/org/apache/druid/java/util/metrics/CgroupDiskMonitorTest.java
Fixed
Show fixed
Hide fixed
processing/src/test/java/org/apache/druid/java/util/metrics/cgroups/DiskTest.java
Fixed
Show fixed
Hide fixed
processing/src/main/java/org/apache/druid/java/util/metrics/CgroupCpuMonitor.java
Fixed
Show fixed
Hide fixed
processing/src/main/java/org/apache/druid/java/util/metrics/CgroupCpuMonitor.java
Fixed
Show fixed
Hide fixed
processing/src/main/java/org/apache/druid/java/util/metrics/CgroupCpuMonitor.java
Fixed
Show fixed
Hide fixed
processing/src/main/java/org/apache/druid/java/util/metrics/CgroupCpuMonitor.java
Fixed
Show fixed
Hide fixed
|
||
public CgroupCpuMonitor(CgroupDiscoverer cgroupDiscoverer, final Map<String, String[]> dimensions, String feed) | ||
{ | ||
super(feed); | ||
this.cgroupDiscoverer = cgroupDiscoverer; | ||
this.dimensions = dimensions; | ||
try { | ||
Process p = new ProcessBuilder("getconf", "CLK_TCK").start(); |
Check warning
Code scanning / CodeQL
Executing a command with a relative path Medium
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @adithyachakilam !
Description
This PRs expands the existing metrics reported by the Cgroup monitors. Specifically adds the usage for cpu, memory and disk.
Release note
Introduces new usage metrics for cpu and memory cgroups
Key changed/added classes in this PR
CgroupCpuMonitor.java
CgroupMemoryMonitor.java
CgroupDiskMonitor.java
This PR has: