mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-10-28 06:29:04 +01:00
container: collect Hyper-V isolated containers from CRI stats (#2568)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
200f248eba
commit
fedca642a1
@@ -121,6 +121,16 @@ func (c *Client) ListPodSandboxes(ctx context.Context) ([]PodSandbox, error) {
|
||||
return decodeListPodSandboxResponse(resp)
|
||||
}
|
||||
|
||||
// ListContainerStats returns the stats of all containers.
|
||||
func (c *Client) ListContainerStats(ctx context.Context) ([]ContainerStats, error) {
|
||||
resp, err := c.call(ctx, "ListContainerStats", nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return decodeListContainerStatsResponse(resp)
|
||||
}
|
||||
|
||||
// call performs a unary gRPC call and returns the response message.
|
||||
func (c *Client) call(ctx context.Context, method string, msg []byte) ([]byte, error) {
|
||||
// A gRPC message is prefixed by a compression flag and its length.
|
||||
|
||||
Reference in New Issue
Block a user