Skip to content

Commit

Permalink
feat: Add status and age columns for pods
Browse files Browse the repository at this point in the history
  • Loading branch information
tiithansen committed Jun 15, 2024
1 parent 0d6a087 commit 59816d9
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/common/seriesHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ export function getSeriesValue(asyncData: any, name: string, pred: (value: any)
return val ? val[`Value #${name}`] : 0
}

export function getSeriesLabelValue(asyncData: any, name: string, labelName: string, pred: (value: any) => boolean) {
const val = getSeries(asyncData, name, pred)
return val ? val[labelName] : []
}

export function getAllSeries(asyncData: any, name: string, pred: (value: any) => boolean) {
if (asyncData && asyncData.get(name)) {
return asyncData.get(name).filter(pred)
Expand Down
15 changes: 15 additions & 0 deletions src/metrics/metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,21 @@ export const Metrics = {
uid: 'uid',
}
},
kubePodStatusPhase: {
name: 'kube_pod_status_phase',
labels:{
namespace: 'namespace',
pod: 'pod',
phase: 'phase',
}
},
kubePodCreated: {
name: 'kube_pod_created',
labels:{
namespace: 'namespace',
pod: 'pod',
}
},
kubePodContainerInfo: {
name: 'kube_pod_container_info',
labels:{
Expand Down
27 changes: 26 additions & 1 deletion src/pages/Workloads/tabs/Pods/Pods.tsx

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 45 additions & 0 deletions src/pages/Workloads/tabs/Pods/Queries.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/pages/Workloads/tabs/Pods/types.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 59816d9

Please sign in to comment.