Commit d2e41e0
authored
[CONTINT-4898] Add container metric support for any CRI compliant runtime (#43317)
### What does this PR do?
Adds container metric support for any CRI compliant runtime provided as a `cri_socket_path`.
### Motivation
Despite allowing custom `cri_socket_path` values, we actually only allow `containerd` or `crio`. We want to support metric collection for any runtime if it is CRI compliant.
### Describe how you validated your changes
1. Stand up an environment running a nonstandard runtime (for example, pouch)
```bash
$ kubectl get nodes -o wide
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
pouch-qa Ready control-plane 5d2h v1.25.16 192.168.64.50 <none> Ubuntu 24.04.3 LTS 6.8.0-87-generic pouch://1.3.1-ba854f2d
```
2. Deploy an agent built off of this feature branch and specify the custom socket
```yaml
datadog:
...
criSocketPath: /var/run/pouchcri.sock
agents:
...
volumes:
- name: pouchcri-sock
hostPath:
path: /var/run/pouchcri.sock # path on the node
type: Socket
volumeMounts:
- name: pouchcri-sock
mountPath: /var/run/pouchcri.sock
readOnly: true
```
3. Exec onto the agent and validate that the `nonstandard-cri-runtime` feature was detected by executing `agent status`
```bash
$ agent status
...
=============
Autodiscovery
=============
Enabled Features
================
cri
kube_orchestratorexplorer
kubernetes
nonstandard-cri-runtime
...
```
4. Validate that container metrics work in the UI:
<img width="1125" height="478" alt="Screenshot 2025-11-24 at 3 42 10 PM" src="https://github.com/user-attachments/assets/d6ec023b-3f67-4c32-8c81-8ca34945802f" />
<img width="1310" height="423" alt="Screenshot 2025-11-24 at 3 40 51 PM" src="https://github.com/user-attachments/assets/79a40cc5-e9ee-45e9-b498-7e062a682d0a" />
### Additional Notes
Co-authored-by: justin.lesko <[email protected]>1 parent facbf5f commit d2e41e0
File tree
6 files changed
+42
-2
lines changed- pkg
- config/env
- util/containers/metrics
- cri
- kubelet
- provider
- releasenotes/notes
6 files changed
+42
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
40 | 43 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
| |||
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
68 | | - | |
| 69 | + | |
| 70 | + | |
69 | 71 | | |
70 | 72 | | |
71 | 73 | | |
| |||
144 | 146 | | |
145 | 147 | | |
146 | 148 | | |
| 149 | + | |
| 150 | + | |
147 | 151 | | |
148 | 152 | | |
149 | 153 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
| 62 | + | |
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| 92 | + | |
92 | 93 | | |
93 | 94 | | |
94 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
| 35 | + | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
| |||
58 | 61 | | |
59 | 62 | | |
60 | 63 | | |
| 64 | + | |
61 | 65 | | |
62 | 66 | | |
63 | 67 | | |
| |||
67 | 71 | | |
68 | 72 | | |
69 | 73 | | |
| 74 | + | |
70 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
71 | 79 | | |
72 | 80 | | |
73 | 81 | | |
| |||
148 | 156 | | |
149 | 157 | | |
150 | 158 | | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
151 | 170 | | |
152 | 171 | | |
153 | 172 | | |
| |||
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
0 commit comments