alibaba / alibaba/Sentinel

(系统自适应保护)基于load的保护为什么没有support container?

Open
#2,165 2 comments 0 reactions 0 assignees View on GitHub
area/metrics help wanted
Dominant language
Java
Stars
23.1k
Forks
8.1k
PR merge metrics
No merged PRs in 30d

Description

SystemStatusListener.java

我们看到cpu usage是support container的,为什么system load average没有support container呢?
多谢!!!

BTW, Google Cadvisor里面可以拿到container的system load average信息: container_cpu_load_average_10s (https://github.com/google/cadvisor/blob/master/docs/storage/prometheus.md)

```
@Override
public void run() {
try {
OperatingSystemMXBean osBean = ManagementFactory.getPlatformMXBean(OperatingSystemMXBean.class);
currentLoad = osBean.getSystemLoadAverage();

/*
* Java Doc copied from {@link OperatingSystemMXBean#getSystemCpuLoad()}:

* Returns the "recent cpu usage" for the whole system. This value is a double in the [0.0,1.0] interval.
* A value of 0.0 means that all CPUs were idle during the recent period of time observed, while a value
* of 1.0 means that all CPUs were actively running 100% of the time during the recent period being
* observed. All values between 0.0 and 1.0 are possible depending of the activities going on in the
* system. If the system recent cpu usage is not available, the method returns a negative value.
*/
double systemCpuUsage = osBean.getSystemCpuLoad();

// calculate process cpu usage to support application running in container environment
RuntimeMXBean runtimeBean = ManagementFactory.getPlatformMXBean(RuntimeMXBean.class);

```

Contributor guide

Open the contributing guide

Research direction

Start with SystemStatusListener.java and inspect how OperatingSystemMXBean#getSystemLoadAverage() is used alongside getSystemCpuLoad() and the runtime bean. Compare the current container-aware CPU handling with cAdvisor's container_cpu_load_average_10s metric. Done means the issue's container system-load support is addressed and its behavior is verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
observability
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.