Skip to content

Commit c379ad0

Browse files
authored
Extend json-specs tests with cgroup-parsing (#686)
1 parent ec2c8dd commit c379ad0

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

specs/agents/metadata.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ On Linux, the container ID and some of the Kubernetes metadata can be extracted
110110

111111
If the Kubernetes pod name is not the hostname, it can be overridden by the `KUBERNETES_POD_NAME` environment variable, using the [Downward API](https://kubernetes.io/docs/tasks/inject-data-application/environment-variable-expose-pod-information/). In a similar manner, you can inform the agent of the node name and namespace, using the environment variables `KUBERNETES_NODE_NAME` and `KUBERNETES_NAMESPACE`.
112112

113+
*Note:* [cgroup_parsing.json](../../tests/agents/json-specs/cgroup_parsing.json) provides test cases for parsing cgroup lines.
114+
113115
### Process metadata
114116

115117
Process level metadata relates to the process running the service being monitored:
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"testUnderscores": {
3+
"groupLine": "1:name=systemd:/kubepods.slice/kubepods-burstable.slice/kubepods-burstable-pod90d81341_92de_11e7_8cf2_507b9d4141fa.slice/crio-2227daf62df6694645fee5df53c1f91271546a9560e8600a525690ae252b7f63.scope",
4+
"containerId": "2227daf62df6694645fee5df53c1f91271546a9560e8600a525690ae252b7f63",
5+
"podId": "90d81341-92de-11e7-8cf2-507b9d4141fa"
6+
},
7+
"testOpenshiftForm": {
8+
"groupLine": "9:freezer:/kubepods.slice/kubepods-pod22949dce_fd8b_11ea_8ede_98f2b32c645c.slice/docker-b15a5bdedd2e7645c3be271364324321b908314e4c77857bbfd32a041148c07f.scope",
9+
"containerId": "b15a5bdedd2e7645c3be271364324321b908314e4c77857bbfd32a041148c07f",
10+
"podId": "22949dce-fd8b-11ea-8ede-98f2b32c645c"
11+
},
12+
"testUbuntuCGroup": {
13+
"groupLine": "1:name=systemd:/user.slice/user-1000.slice/user@1000.service/apps.slice/apps-org.gnome.Terminal.slice/vte-spawn-75bc72bd-6642-4cf5-b62c-0674e11bfc84.scope",
14+
"containerId": null,
15+
"podId": null
16+
},
17+
"testAwsEcsCGroup": {
18+
"groupLine": "1:name=systemd:/ecs/03752a671e744971a862edcee6195646/03752a671e744971a862edcee6195646-4015103728",
19+
"containerId": "03752a671e744971a862edcee6195646-4015103728",
20+
"podId": null
21+
}
22+
}

0 commit comments

Comments
 (0)