Skip to content

refactor(config): rename cpu.meters to cpu.preferredMeters#2471

Open
nikimanoledaki wants to merge 1 commit into
sustainable-computing-io:mainfrom
nikimanoledaki:nm/rename-cpu-preferred-meters
Open

refactor(config): rename cpu.meters to cpu.preferredMeters#2471
nikimanoledaki wants to merge 1 commit into
sustainable-computing-io:mainfrom
nikimanoledaki:nm/rename-cpu-preferred-meters

Conversation

@nikimanoledaki
Copy link
Copy Markdown
Collaborator

@nikimanoledaki nikimanoledaki commented May 12, 2026

Follow up to #2468. Addresses some of the feedback on #2467.

Why

cpu.meters: ["rapl", "hwmon"] doesn't show clearly that it is an ordered preference with a priority & fallback mechanism.

However this is not exactly a fallbackChain since CreateCPUMeter selects once at startup. There is no runtime failover.

Opting for preferredMeters since it matches the kube-apiserver preferredAddressTypes pattern of having an ordered preference list with the first viable option being selected.

What

Rename config field cpu.meters to cpu.preferredMeters and update all references.

Addresses feedback on sustainable-computing-io#2467: a bare "meters" list doesn't convey the
ordered preference semantics. `fallbackChain` (suggested in the thread)
would mislead since `CreateCPUMeter` selects once at startup with no
runtime failover.

`preferredMeters` matches the kube-apiserver `preferredAddressTypes`
pattern: ordered preference list, first viable wins.

Renames the YAML key, struct field, validation error message, the two
deprecation warnings, and every sample config. No alias needed:
`cpu.meters` is not present in any tagged release.

Signed-off-by: nikimanoledaki <niki.manoledaki@grafana.com>
@github-actions github-actions Bot added the refactor Code refactoring without changing functionality label May 12, 2026
@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Config changes detected in this PR
Please make sure that the config changes are updated in the following places as part of this PR:

  • compose/default/kepler/etc/kepler/config.yaml

@codecov
Copy link
Copy Markdown

codecov Bot commented May 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.97%. Comparing base (55f6f4d) to head (0dfdbdc).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2471   +/-   ##
=======================================
  Coverage   91.97%   91.97%           
=======================================
  Files          56       56           
  Lines        5945     5945           
=======================================
  Hits         5468     5468           
  Misses        340      340           
  Partials      137      137           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link
Copy Markdown
Contributor

📊 Profiling reports are ready to be viewed

⚠️ Variability in pprof CPU and Memory profiles
When comparing pprof profiles of Kepler versions, expect variability in CPU and memory. Focus only on significant, consistent differences.

💻 CPU Comparison with base Kepler
File: kepler
Build ID: bd48c6e023659c6dff6af7cb3713f4c312b7b861
Type: cpu
Time: 2026-05-12 16:38:26 UTC
Duration: 120s, Total samples = 3.93s ( 3.27%)
Active filters:
   show=github.com/sustainable-computing-io
Showing nodes accounting for 0.07s, 1.78% of 3.93s total
      flat  flat%   sum%        cum   cum%
         0     0%     0%      0.07s  1.78%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).refreshSnapshot
         0     0%     0%      0.07s  1.78%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).synchronizedPowerRefresh
         0     0%     0%      0.07s  1.78%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).synchronizedPowerRefresh.func1
         0     0%     0%      0.06s  1.53%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).calculatePower
         0     0%     0%      0.06s  1.53%  github.com/sustainable-computing-io/kepler/internal/resource.(*resourceInformer).Refresh
         0     0%     0%      0.06s  1.53%  github.com/sustainable-computing-io/kepler/internal/resource.(*resourceInformer).refreshProcesses
         0     0%     0%     -0.05s  1.27%  github.com/sustainable-computing-io/kepler/internal/exporter/prometheus/collector.(*gpuInfoCollector).Collect
     0.05s  1.27%  1.27%      0.05s  1.27%  github.com/sustainable-computing-io/kepler/internal/resource.(*procFSReader).AllProcs
    -0.04s  1.02%  0.25%     -0.04s  1.02%  github.com/sustainable-computing-io/kepler/internal/exporter/prometheus/collector.(*PowerCollector).collectProcessMetrics
         0     0%  0.25%      0.04s  1.02%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).scheduleNextCollection.func1
         0     0%  0.25%      0.04s  1.02%  github.com/sustainable-computing-io/kepler/internal/resource.(*resourceInformer).Refresh.func3
     0.01s  0.25%  0.51%      0.04s  1.02%  github.com/sustainable-computing-io/kepler/internal/resource.(*resourceInformer).refreshNode
         0     0%  0.51%      0.03s  0.76%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).ensureFreshData
     0.03s  0.76%  1.27%      0.03s  0.76%  github.com/sustainable-computing-io/kepler/internal/resource.(*procFSReader).CPUUsageRatio
         0     0%  1.27%      0.02s  0.51%  github.com/sustainable-computing-io/kepler/internal/exporter/prometheus/collector.(*PowerCollector).Collect
     0.02s  0.51%  1.78%      0.02s  0.51%  github.com/sustainable-computing-io/kepler/internal/exporter/prometheus/collector.(*realProcFS).CPUInfo
    -0.03s  0.76%  1.02%     -0.02s  0.51%  github.com/sustainable-computing-io/kepler/internal/monitor.(*Process).Clone (inline)
         0     0%  1.02%     -0.02s  0.51%  github.com/sustainable-computing-io/kepler/internal/monitor.(*Snapshot).Clone
     0.02s  0.51%  1.53%      0.02s  0.51%  github.com/sustainable-computing-io/kepler/internal/resource.(*procWrapper).Comm
         0     0%  1.53%      0.01s  0.25%  github.com/sustainable-computing-io/kepler/internal/exporter/prometheus/collector.(*PlatformCollector).Collect
    -0.01s  0.25%  1.27%      0.01s  0.25%  github.com/sustainable-computing-io/kepler/internal/exporter/prometheus/collector.(*cpuInfoCollector).Collect
         0     0%  1.27%      0.01s  0.25%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).Snapshot
    -0.01s  0.25%  1.02%     -0.01s  0.25%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).calculateNodePower
         0     0%  1.02%      0.01s  0.25%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).calculateProcessPower
     0.01s  0.25%  1.27%      0.01s  0.25%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).signalNewData
     0.01s  0.25%  1.53%      0.01s  0.25%  github.com/sustainable-computing-io/kepler/internal/monitor.(*TerminatedResourceTracker[go.shape.*uint8]).Add
         0     0%  1.53%      0.01s  0.25%  github.com/sustainable-computing-io/kepler/internal/platform/redfish.(*PowerReader).ReadAll
     0.01s  0.25%  1.78%      0.01s  0.25%  github.com/sustainable-computing-io/kepler/internal/platform/redfish.(*PowerReader).readPowerSubsystem
         0     0%  1.78%      0.01s  0.25%  github.com/sustainable-computing-io/kepler/internal/platform/redfish.(*Service).Power
    -0.01s  0.25%  1.53%     -0.01s  0.25%  github.com/sustainable-computing-io/kepler/internal/resource.(*procWrapper).CPUTime
         0     0%  1.53%      0.01s  0.25%  github.com/sustainable-computing-io/kepler/internal/resource.(*resourceInformer).updateProcessCache
         0     0%  1.53%      0.01s  0.25%  github.com/sustainable-computing-io/kepler/internal/resource.newProcess
         0     0%  1.53%      0.01s  0.25%  github.com/sustainable-computing-io/kepler/internal/resource.populateProcessFields
     0.01s  0.25%  1.78%      0.01s  0.25%  maps.Copy[go.shape.map[github.com/sustainable-computing-io/kepler/internal/device.EnergyZone]github.com/sustainable-computing-io/kepler/internal/monitor.Usage,go.shape.map[github.com/sustainable-computing-io/kepler/internal/device.EnergyZone]github.com/sustainable-computing-io/kepler/internal/monitor.Usage,go.shape.interface { Energy ; Index int; MaxEnergy github.com/sustainable-computing-io/kepler/internal/device.Energy; Name string; Path string; Power  },go.shape.struct { EnergyTotal github.com/sustainable-computing-io/kepler/internal/device.Energy; Power github.com/sustainable-computing-io/kepler/internal/device.Power }] (inline)
💾 Memory Comparison with base Kepler (Inuse)
File: kepler
Build ID: bd48c6e023659c6dff6af7cb3713f4c312b7b861
Type: inuse_space
Time: 2026-05-12 16:40:26 UTC
Duration: 120.02s, Total samples = 9112.98kB 
Active filters:
   show=github.com/sustainable-computing-io
Showing nodes accounting for -528.17kB, 5.80% of 9112.98kB total
Dropped 6 nodes (cum <= 45.56kB)
      flat  flat%   sum%        cum   cum%
         0     0%     0%  1024.28kB 11.24%  github.com/sustainable-computing-io/kepler/internal/exporter/prometheus/collector.(*PowerCollector).Collect
         0     0%     0%  -528.17kB  5.80%  github.com/sustainable-computing-io/kepler/internal/resource.computeTypeInfoFromProc.func2
 -528.17kB  5.80%  5.80%  -528.17kB  5.80%  github.com/sustainable-computing-io/kepler/internal/resource.vmInfoFromCmdLine
         0     0%  5.80%  -528.17kB  5.80%  github.com/sustainable-computing-io/kepler/internal/resource.vmInfoFromProc
         0     0%  5.80%   512.22kB  5.62%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).Snapshot
         0     0%  5.80%   512.22kB  5.62%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).ensureFreshData
         0     0%  5.80%  -512.14kB  5.62%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).scheduleNextCollection.func1
         0     0%  5.80%  -512.06kB  5.62%  github.com/sustainable-computing-io/kepler/internal/exporter/prometheus/collector.(*gpuInfoCollector).Collect
💾 Memory Comparison with base Kepler (Alloc)
File: kepler
Build ID: bd48c6e023659c6dff6af7cb3713f4c312b7b861
Type: alloc_space
Time: 2026-05-12 16:40:26 UTC
Duration: 120.02s, Total samples = 176.77MB 
Active filters:
   show=github.com/sustainable-computing-io
Showing nodes accounting for -2.98MB, 1.69% of 176.77MB total
Dropped 5 nodes (cum <= 0.88MB)
      flat  flat%   sum%        cum   cum%
         0     0%     0%    -7.99MB  4.52%  github.com/sustainable-computing-io/kepler/internal/exporter/prometheus/collector.(*gpuInfoCollector).Collect
         0     0%     0%     7.54MB  4.27%  github.com/sustainable-computing-io/kepler/internal/exporter/prometheus/collector.(*PowerCollector).Collect
      -4MB  2.26%  2.26%       -4MB  2.26%  github.com/sustainable-computing-io/kepler/internal/monitor.newProcess (inline)
   -3.50MB  1.98%  4.24%    -3.50MB  1.98%  github.com/sustainable-computing-io/kepler/internal/exporter/prometheus/collector.(*PowerCollector).collectProcessMetrics
    0.51MB  0.29%  3.95%    -2.99MB  1.69%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).calculateProcessPower
         0     0%  3.95%     2.55MB  1.44%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).Snapshot
   -2.53MB  1.43%  5.38%    -2.53MB  1.43%  github.com/sustainable-computing-io/kepler/internal/resource.(*procFSReader).CPUUsageRatio
         0     0%  5.38%    -2.53MB  1.43%  github.com/sustainable-computing-io/kepler/internal/resource.(*resourceInformer).Refresh.func3
         0     0%  5.38%    -2.53MB  1.43%  github.com/sustainable-computing-io/kepler/internal/resource.(*resourceInformer).refreshNode
         0     0%  5.38%     2.06MB  1.17%  github.com/sustainable-computing-io/kepler/internal/resource.(*resourceInformer).Refresh
    0.51MB  0.29%  5.09%     2.06MB  1.17%  github.com/sustainable-computing-io/kepler/internal/resource.(*resourceInformer).refreshProcesses
         0     0%  5.09%     2.04MB  1.15%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).ensureFreshData
    2.05MB  1.16%  3.93%     1.55MB  0.88%  github.com/sustainable-computing-io/kepler/internal/resource.(*procFSReader).AllProcs
       1MB  0.57%  3.37%     1.50MB  0.85%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).calculateNodePower
         0     0%  3.37%    -1.46MB  0.83%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).scheduleNextCollection.func1
    0.50MB  0.28%  3.08%     1.45MB  0.82%  github.com/sustainable-computing-io/kepler/internal/exporter/prometheus/collector.(*cpuInfoCollector).Collect
      -1MB  0.57%  3.65%       -1MB  0.57%  maps.Copy[go.shape.map[github.com/sustainable-computing-io/kepler/internal/device.EnergyZone]github.com/sustainable-computing-io/kepler/internal/monitor.Usage,go.shape.map[github.com/sustainable-computing-io/kepler/internal/device.EnergyZone]github.com/sustainable-computing-io/kepler/internal/monitor.Usage,go.shape.interface { Energy ; Index int; MaxEnergy github.com/sustainable-computing-io/kepler/internal/device.Energy; Name string; Path string; Power  },go.shape.struct { EnergyTotal github.com/sustainable-computing-io/kepler/internal/device.Energy; Power github.com/sustainable-computing-io/kepler/internal/device.Power }] (inline)
    0.95MB  0.54%  3.11%     0.95MB  0.54%  github.com/sustainable-computing-io/kepler/internal/exporter/prometheus/collector.(*realProcFS).CPUInfo
         0     0%  3.11%     0.58MB  0.33%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).calculatePower
         0     0%  3.11%     0.58MB  0.33%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).refreshSnapshot
         0     0%  3.11%     0.58MB  0.33%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).synchronizedPowerRefresh
         0     0%  3.11%     0.58MB  0.33%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).synchronizedPowerRefresh.func1
    0.51MB  0.29%  2.82%     0.51MB  0.29%  github.com/sustainable-computing-io/kepler/internal/monitor.(*Snapshot).Clone
         0     0%  2.82%     0.50MB  0.28%  github.com/sustainable-computing-io/kepler/internal/device.(*AggregatedZone).Energy
    0.50MB  0.28%  2.54%     0.50MB  0.28%  github.com/sustainable-computing-io/kepler/internal/device.sysfsRaplZone.Energy
   -0.50MB  0.28%  2.82%    -0.50MB  0.28%  github.com/sustainable-computing-io/kepler/internal/resource.(*procWrapper).Cgroups
    0.50MB  0.28%  2.54%     0.50MB  0.28%  github.com/sustainable-computing-io/kepler/internal/resource.containerInfoFromCgroupPaths
    0.50MB  0.28%  2.25%     0.50MB  0.28%  github.com/sustainable-computing-io/kepler/internal/exporter/prometheus/collector.(*PowerCollector).collectContainerMetrics
   -0.50MB  0.28%  2.54%    -0.50MB  0.28%  github.com/sustainable-computing-io/kepler/internal/resource.WrapProc (inline)
    1.50MB  0.85%  1.69%     0.50MB  0.28%  github.com/sustainable-computing-io/kepler/internal/monitor.(*Process).Clone (inline)

⬇️ Download the Profiling artifacts from the Actions Summary page

📦 Artifact name: profile-artifacts-2471

🔧 Or use GitHub CLI to download artifacts:

gh run download 25748305257 -n profile-artifacts-2471

Copy link
Copy Markdown
Collaborator

@sunya-ch sunya-ch left a comment

Choose a reason for hiding this comment

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

lgtm

@vprashar2929
Copy link
Copy Markdown
Collaborator

@nikimanoledaki Can you also address this? #2471 (comment) 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Code refactoring without changing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants