Skip to content

Commit a730a84

Browse files
committed
fix nesting of pod data under kubernetes in system info (#402)
fixes #401 closes #402
1 parent 29f12ce commit a730a84

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* Moved context.url to context.http.url for requests/urllib3 spans (#393, #394)
77
* Added support for using route as transaction name in Django 2.2+ (#86, #396)
88
* Fixed an issue with custom user models in Django using non-string usernames (#397, #398)
9+
* Fixed an issue with sending kubernetes metadata to the API (#401, #402)
910

1011
## v4.1.0
1112
[Check the diff](https://github.com/elastic/apm-agent-python/compare/v4.0.3...v4.1.0)

elasticapm/utils/cgroup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,6 @@ def parse_cgroups(filehandle):
7070
pod_id = kubepods_match.group(1)
7171
if not pod_id:
7272
pod_id = kubepods_match.group(2)
73-
return {"container": {"id": container_id}, "pod": {"uid": pod_id}}
73+
return {"container": {"id": container_id}, "kubernetes": {"pod": {"uid": pod_id}}}
7474
elif container_id_regexp.match(container_id):
7575
return {"container": {"id": container_id}}

tests/utils/cgroup_tests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919
"1:name=systemd:/kubepods/besteffort/pode9b90526-f47d-11e8-b2a5-080027b9f4fb/15aa6e53-b09a-40c7-8558-c6c31e36c88a",
2020
{
2121
"container": {"id": "15aa6e53-b09a-40c7-8558-c6c31e36c88a"},
22-
"pod": {"uid": "e9b90526-f47d-11e8-b2a5-080027b9f4fb"},
22+
"kubernetes": {"pod": {"uid": "e9b90526-f47d-11e8-b2a5-080027b9f4fb"}},
2323
},
2424
),
2525
(
2626
"1:name=systemd:/kubepods.slice/kubepods-burstable.slice/kubepods-burstable-pod90d81341_92de_11e7_8cf2_507b9d4141fa.slice/crio-2227daf62df6694645fee5df53c1f91271546a9560e8600a525690ae252b7f63.scope",
2727
{
2828
"container": {"id": "2227daf62df6694645fee5df53c1f91271546a9560e8600a525690ae252b7f63"},
29-
"pod": {"uid": "90d81341_92de_11e7_8cf2_507b9d4141fa"},
29+
"kubernetes": {"pod": {"uid": "90d81341_92de_11e7_8cf2_507b9d4141fa"}},
3030
},
3131
),
3232
],

0 commit comments

Comments
 (0)