-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix pod metric filtering for containerd #2283
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2283 +/- ##
==========================================
+ Coverage 85.83% 86.92% +1.08%
==========================================
Files 189 8 -181
Lines 12646 841 -11805
Branches 1325 130 -1195
==========================================
- Hits 10855 731 -10124
+ Misses 1408 78 -1330
+ Partials 383 32 -351 |
@@ -125,6 +125,10 @@ def _is_pod_metric(labels): | |||
if 'container_name' in labels: | |||
if labels['container_name'] == 'POD': | |||
return True | |||
# Some runtimes does not report container_name="POD" | |||
if 'pod_name' in labels: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the metric to be a pod-level one, don't you also need container_name=""? (because all container metrics also have a pod_name label)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, just fixed it
021fab9
to
0626735
Compare
@@ -125,6 +125,9 @@ def _is_pod_metric(labels): | |||
if 'container_name' in labels: | |||
if labels['container_name'] == 'POD': | |||
return True | |||
# containerd does not report container_name="POD" | |||
elif labels['container_name'] == '' and 'pod_name' in labels and labels['pod_name']: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or elif labels['container_name'] == '' and labels.get('pod_name', False):
?
0626735
to
8bba137
Compare
8bba137
to
3ee32b9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
What does this PR do?
Seems that
container_name
is empty for pod metrics withcontainerd
runtime causing them to be filtered out.Motivation
Have pod metrics (like network) correctly submitted for
containerd
Review checklist
no-changelog
label attachedAdditional Notes
See containerd/cri#922