Skip to content
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

cleanup fluentd sumologic filter plugin #310

Merged
merged 3 commits into from
Nov 26, 2019

Conversation

samjsong
Copy link
Contributor

Description

Cherry picking filter plugin cleanup from #232 since this doesn't change behavior and will help make the coming changes easier

Testing performed
  • ci/build.sh
  • Redeploy fluentd and fluentd-events pods
  • Confirm events, logs, and metrics are coming in

Copy link
Contributor

@rvmiller89 rvmiller89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, one comment

end
sumo_metadata[:host] = sumo_metadata[:host] % k8s_metadata
sumo_metadata[:source] = sumo_metadata[:source] % k8s_metadata
sumo_metadata[:category] = sumo_metadata[:category] % k8s_metadata
sumo_metadata[:category].gsub!("-", @source_category_replace_dash)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this be removed due to L74

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the reason I left it is that sumo_metadata[:category] is modified above, so that if any of k8s_metadata includes a dash we replace it.

I believe this would be consistent with current behavior, but I'm not actually sure this is the behavior we want to enforce. For instance, if pod name is

kube-apiserver-ip-172-20-51-167.us-west-1.compute.internal

then the source category given our default of sourceCategory: "%{namespace}/%{pod_name}" would end up like this:

kubernetes/kube/system/kube/apiserver/ip/172/20/51/167.us/west

(as a side note, I'm not actually sure what happened to -1.compute.internal, will need to look into that)

For this PR I vote for keeping this behavior to be backwards compatible, but @frankreno can you confirm what behavior we want to enforce for source_category_replace_dash, and what the usecase is/was?

…llection into ssong-cleanup-fluentd-sumologic-filter
@samjsong samjsong merged commit 7142bdb into master Nov 26, 2019
@samjsong samjsong deleted the ssong-cleanup-fluentd-sumologic-filter branch November 26, 2019 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants