Skip to content

Commit 8695f2d

Browse files
author
Sunil Thaha
authored
Merge pull request #2142 from vprashar2929/chore-pod-m
docs: include pod level metrics
2 parents be79c1d + 17aa884 commit 8695f2d

File tree

3 files changed

+49
-1
lines changed

3 files changed

+49
-1
lines changed

.github/workflows/pr-checks.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,22 @@ jobs:
7878
shell: bash
7979
run: make vet && git diff --exit-code
8080

81+
docs:
82+
runs-on: ubuntu-latest
83+
steps:
84+
- name: checkout source
85+
uses: actions/checkout@v4
86+
87+
- name: setup go
88+
uses: actions/[email protected]
89+
with:
90+
go-version-file: go.mod
91+
cache: false
92+
93+
- name: make gen-metrics-docs
94+
shell: bash
95+
run: make gen-metrics-docs && git diff --exit-code
96+
8197
test-and-codecov:
8298
needs: check-changes
8399
if: needs.check-changes.outputs.changes == 'true'

docs/metrics/metrics.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,30 @@ These metrics provide energy and power information for virtual machines.
171171
- `hypervisor`
172172
- `zone`
173173

174+
### Pod Metrics
175+
176+
These metrics provide energy and power information for pods.
177+
178+
#### kepler_pod_cpu_joules_total
179+
180+
- **Type**: COUNTER
181+
- **Description**: Energy consumption of cpu at pod level in joules
182+
- **Labels**:
183+
- `pod_id`
184+
- `pod_name`
185+
- `pod_namespace`
186+
- `zone`
187+
188+
#### kepler_pod_cpu_watts
189+
190+
- **Type**: GAUGE
191+
- **Description**: Power consumption of cpu at pod level in watts
192+
- **Labels**:
193+
- `pod_id`
194+
- `pod_name`
195+
- `pod_namespace`
196+
- `zone`
197+
174198
### Other Metrics
175199

176200
Additional metrics provided by Kepler.
@@ -188,4 +212,4 @@ Additional metrics provided by Kepler.
188212

189213
---
190214

191-
This documentation was automatically generated by the gen-metric-docs tool. Generated on 2025-06-08
215+
This documentation was automatically generated by the gen-metric-docs tool. Generated on 2025-06-11

hack/gen-metric-docs/main.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ func generateMarkdown(metrics []MetricInfo) string {
135135
containerMetrics := []MetricInfo{}
136136
processMetrics := []MetricInfo{}
137137
vmMetrics := []MetricInfo{}
138+
podMetrics := []MetricInfo{}
138139
otherMetrics := []MetricInfo{}
139140

140141
for _, metric := range metrics {
@@ -147,6 +148,8 @@ func generateMarkdown(metrics []MetricInfo) string {
147148
processMetrics = append(processMetrics, metric)
148149
case strings.HasPrefix(metric.Name, "kepler_vm_"):
149150
vmMetrics = append(vmMetrics, metric)
151+
case strings.HasPrefix(metric.Name, "kepler_pod_"):
152+
podMetrics = append(podMetrics, metric)
150153
default:
151154
otherMetrics = append(otherMetrics, metric)
152155
}
@@ -172,6 +175,11 @@ func generateMarkdown(metrics []MetricInfo) string {
172175
md.WriteString("These metrics provide energy and power information for virtual machines.\n\n")
173176
writeMetricsSection(&md, vmMetrics)
174177
}
178+
if len(podMetrics) > 0 {
179+
md.WriteString("### Pod Metrics\n\n")
180+
md.WriteString("These metrics provide energy and power information for pods.\n\n")
181+
writeMetricsSection(&md, podMetrics)
182+
}
175183
if len(otherMetrics) > 0 {
176184
md.WriteString("### Other Metrics\n\n")
177185
md.WriteString("Additional metrics provided by Kepler.\n\n")

0 commit comments

Comments
 (0)