Skip to content

Commit

Permalink
Support kube_state_metrics v2.0.0 (#27552)
Browse files Browse the repository at this point in the history
* Support kube_pod_container_resource_requests and kube_pod_container_resource_limits
* Add kube_node_status_capacity and kube_node_status_allocatable support
* Add tests for ksm v2 for all state data streams
  • Loading branch information
MichaelKatsoulis authored Aug 26, 2021
1 parent 5937778 commit 1596d64
Show file tree
Hide file tree
Showing 37 changed files with 3,882 additions and 39 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Add state_job metricset to Kubernetes module{pull}26479[26479]
- Bump AWS SDK version to v0.24.0 for WebIdentity authentication flow {issue}19393[19393] {pull}27126[27126]
- Add Linux pressure metricset {pull}27355[27355]
- Add support for kube-state-metrics v2.0.0 {pull}27552[27552]

*Packetbeat*

Expand Down
6 changes: 5 additions & 1 deletion metricbeat/helper/prometheus/metric.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,11 @@ type opFilterMap struct {
func (o opFilterMap) Process(field string, value interface{}, labels common.MapStr) (string, interface{}, common.MapStr) {
for k, v := range o.filterMap {
if labels[o.label] == k {
return fmt.Sprintf("%v.%v", field, v), value, labels
if field == "" {
return v, value, labels
} else {
return fmt.Sprintf("%v.%v", field, v), value, labels
}
}
}
return "", nil, nil
Expand Down
1,569 changes: 1,569 additions & 0 deletions metricbeat/module/kubernetes/_meta/test/ksm.v2.0.0

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"MetricSetFields": {
"cpu": {
"request": {
"cores": 0.15
"cores": 0.15,
"nanocores": 150000000
}
},
"id": "docker://e9560bbace13ca19de4b3771023198e8568f6b5ed6af3a949f10a5b8137b5be9",
Expand Down Expand Up @@ -70,7 +71,8 @@
"MetricSetFields": {
"cpu": {
"request": {
"cores": 0.25
"cores": 0.25,
"nanocores": 250000000
}
},
"id": "docker://e9568dfef1dd249cabac4bf09e6bf4a239fe738ae20eba072b6516676fce4bf6",
Expand Down Expand Up @@ -153,7 +155,8 @@
"MetricSetFields": {
"cpu": {
"request": {
"cores": 0.2
"cores": 0.2,
"nanocores": 200000000
}
},
"id": "docker://4beb9aab887ca162c9cb3534c4826156636241052cd548153eaa2a170b6d102f",
Expand Down Expand Up @@ -197,10 +200,12 @@
"MetricSetFields": {
"cpu": {
"limit": {
"cores": 0.1
"cores": 0.1,
"nanocores": 100000000
},
"request": {
"cores": 0.1
"cores": 0.1,
"nanocores": 100000000
}
},
"id": "docker://948c4ebd8ca4fdf352e7fbf7f5c5d381af7e615ced435dc42fde0c1d25851320",
Expand Down Expand Up @@ -252,7 +257,8 @@
"MetricSetFields": {
"cpu": {
"request": {
"cores": 0.1
"cores": 0.1,
"nanocores": 100000000
}
},
"id": "docker://eadcbd54ba914dff6475ae64805887967cfb973aeb9b07364c94372658a71d11",
Expand Down Expand Up @@ -296,7 +302,8 @@
"MetricSetFields": {
"cpu": {
"request": {
"cores": 0.1
"cores": 0.1,
"nanocores": 100000000
}
},
"id": "docker://1958e71d048065d38ce83dafda567c5fa9d0c1278cd7292d55b9f1d80b0a67f9",
Expand Down Expand Up @@ -387,7 +394,8 @@
"MetricSetFields": {
"cpu": {
"request": {
"cores": 0.005
"cores": 0.005,
"nanocores": 5000000
}
},
"id": "docker://ab382dbe8f8265f88ee9fec7de142f778da4a5fd9fe0334e3bdb6fe851124c08",
Expand Down Expand Up @@ -436,10 +444,12 @@
"MetricSetFields": {
"cpu": {
"limit": {
"cores": 0.101
"cores": 0.101,
"nanocores": 101000000
},
"request": {
"cores": 0.101
"cores": 0.101,
"nanocores": 101000000
}
},
"id": "docker://88951e0178ea5131fa3e2d7cafacb3a7e63700795dd6fa0d40ed2e4ac1f52f9c",
Expand Down Expand Up @@ -530,7 +540,8 @@
"MetricSetFields": {
"cpu": {
"request": {
"cores": 0.01
"cores": 0.01,
"nanocores": 10000000
}
},
"id": "docker://aad0addd205dc72dc7abc8f9d02a1b429a2f2e1df3acc60431ca6b79746c093b",
Expand Down Expand Up @@ -598,4 +609,4 @@
"Period": 0,
"DisableTimeSeries": false
}
]
]
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"MetricSetFields": {
"cpu": {
"request": {
"cores": 0.005
"cores": 0.005,
"nanocores": 5000000
}
},
"id": "docker://f13c53a3ed0f3626b33b3c588d6913257320f65714eff28f25ead8f7663dc93b",
Expand Down Expand Up @@ -70,7 +71,8 @@
"MetricSetFields": {
"cpu": {
"request": {
"cores": 0.1
"cores": 0.1,
"nanocores": 100000000
}
},
"id": "docker://0ea0cef8a79c7643474a736e5da14c254d9411d87167028fa07c96d09748c83a",
Expand Down Expand Up @@ -153,7 +155,8 @@
"MetricSetFields": {
"cpu": {
"request": {
"cores": 0.2
"cores": 0.2,
"nanocores": 200000000
}
},
"id": "docker://465ebffafd7fc238a2fa2e764255efcbff88d5513f4c68f57d70932985428d12",
Expand Down Expand Up @@ -237,7 +240,8 @@
"MetricSetFields": {
"cpu": {
"request": {
"cores": 0.1
"cores": 0.1,
"nanocores": 100000000
}
},
"id": "docker://f8fe5be1dbb1931d702c89235c79965730cbcced7b0ced9895f6c54c1ae8e5c3",
Expand Down Expand Up @@ -367,7 +371,8 @@
"MetricSetFields": {
"cpu": {
"request": {
"cores": 0.1
"cores": 0.1,
"nanocores": 100000000
}
},
"id": "docker://15ada7864628d1c8007c01420e5887a501590d3bc9c25628a4770172ad615112",
Expand Down Expand Up @@ -458,7 +463,8 @@
"MetricSetFields": {
"cpu": {
"request": {
"cores": 0.25
"cores": 0.25,
"nanocores": 250000000
}
},
"id": "docker://cdaefb4df2f2add498f884fdc717a6ca8d2681c1636934747de600e6427e0c0d",
Expand Down Expand Up @@ -558,4 +564,4 @@
"Period": 0,
"DisableTimeSeries": false
}
]
]
Loading

0 comments on commit 1596d64

Please sign in to comment.