-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[receiver/splunkhec] Add support passing token via context in splunkhecreceiver #37406
base: main
Are you sure you want to change the base?
[receiver/splunkhec] Add support passing token via context in splunkhecreceiver #37406
Conversation
if strings.HasPrefix(accessToken, splunk.HECTokenHeader+" ") { | ||
accessTokenValue := accessToken[len(splunk.HECTokenHeader)+1:] | ||
if tokenContextGate.IsEnabled() { | ||
return context.WithValue(origCtx, splunk.LabelType(splunk.HecTokenLabel), accessTokenValue), nil |
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.
Its unclear why a new label is being introduced here. We want to move towards using X-Sf-token as the label so that when this receiver is used with say the batch processor, it will by default group data associated with the token. The default configuration for the batch processor is in the agent.yaml. Can you please clarify ?
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.
Well, it's my oversight, let me fix it.
Thank you for the making the change. For completeness, we want to do one more step which is an end to end test. pair this receiver with a processor and exporter pair to confirm that the functionality is actually working as intended. Also, please share how you verified the working. thats critical to move forward on this. also while you have a link to the issue this MR is intending to fix, please add a clear description on what you are trying to do |
@asreehari-splunk The general steps for e2e:
Is .chloggen/passing-token-via-context-splunkhec-receiver.yaml enough? |
Description
Link to tracking issue
Fixes #37307
Testing
Documentation