-
Notifications
You must be signed in to change notification settings - Fork 2.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
K8S: Adding ignored pod names as config parameter #3520
K8S: Adding ignored pod names as config parameter #3520
Conversation
|
||
ignored_pod_names: | ||
- jaeger-agent | ||
- jaeger-collector |
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.
Since we already have filter
config above, I think adding a more generic exclude
would be better than something dedicated to just ignoring pods. May be something like
exclude:
pods:
- jaeger-agent
- jaeger-collector
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.
Actually I think the following would be even better as it's more future proof. This can allow us to exclude pods by fields other than name in future if we want.
exclude:
pods:
- name: jaeger-agent
- name: jaeger-collector
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.
Sounds good. Made those changes! :)
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.
Accidentally approved :)
93003ce
to
f0c8740
Compare
// Check well known names that should be ignored | ||
for _, rexp := range podNameIgnorePatterns { | ||
// Check if user requested the pod to be ignored through configuration | ||
for _, rexp := range c.Exclude.Regex { |
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.
If we make the changes suggested below, this should read something like the following:
for _, excludedPod := range c.Exclude.Pods {
if excludedPod.Name.MatchString(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.
Thanks for the feedback and help! The requested changes have been made.
3b10700
to
58389fb
Compare
58389fb
to
1d24125
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.
PR looks good to me but CI is failing because of an unrelated failure (probably you need to rebase/merge main to get #3735?). Could you try to fix the issue?
I am going to add the ready-to-merge label since this looks ready and has three approvals |
On error pdata.Metrics may not be initialized so guard against it. Update test to return uninitialized object on error.
Description:
This PR addresses #1077 by adding a new parameter to the K8S configuration allowing users to define names of pods to ignore while tagging. Previously, the names are hardcoded and noted as TODO.
Testing:
make
was used to test the new implementation and to ensure no other pre-existing functionality was broken.New unit tests were added to ensure that the default
ignored_pod_names
are[jaeger-agent, jaeger-collector]
and that users will be able to add additional pod names.