-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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(kubernetes_logs source): Set user-agent for k8s apiserver requests. #21905
base: master
Are you sure you want to change the base?
Conversation
b0cc62f
to
735e4c9
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.
Thank you! This looks good to me. I have just one question about the deprecation allows.
Also, please take a look at this. |
Co-authored-by: Pavlos Rontidis <pavlos.rontidis@gmail.com>
…vector into og/kubernetes-user-agent
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 @ganelo !
Head branch was pushed to by a user without write access
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.
@ganelo It looks like the AWS integration tests are failing here. You can run these locally via make test-integration-aws
(requires Docker). I think it is likely due to the bump to aws-config
since we've been trying to bump it separately in #20663 without success (also failing integration tests).
If it is possible to bump aws-config
back down, that might unblock this PR.
Head branch was pushed to by a user without write access
Head branch was pushed to by a user without write access
@jszwedko It looks like all relevant tests are passing now - mind merging? |
Cargo.toml
Outdated
aws-sdk-firehose = { version = "1.3.0", default-features = false, features = ["behavior-version-latest", "rt-tokio"], optional = true } | ||
aws-sdk-kinesis = { version = "1.3.0", default-features = false, features = ["behavior-version-latest", "rt-tokio"], optional = true } | ||
aws-sdk-secretsmanager = { version = "1.3.0", default-features = false, features = ["behavior-version-latest", "rt-tokio"], optional = true } | ||
aws-sdk-sqs = { version = "~1.3.0", default-features = false, features = ["behavior-version-latest", "rt-tokio"], optional = true } |
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.
I'm unsure if we need all of these ~
s rather than just not updating aws-config
when adding the new crates. Did you find them to be required?
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.
Truthfully I was having a hard time running the test locally (was seeing the same result of test failures whether running on tip of master or on this branch) so I may have been a little overzealous here. I'd be happy to try just aws-config if you don't mind triggering the integration test here to check.
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.
👍 the integration tests will run during the merge so we should get feedback then. Unfortunately it isn't possible to trigger them on external PRs otherwise at the moment.
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.
Gotcha. Okay I'll go ahead and revert the extra version pins and echo back.
…s. (#21905) * fix(kubernetes_log source): Set user-agent for k8s apiserver requests. * Update changelog.d/21864_kubernetes_logs_user_agent.fix.md Co-authored-by: Pavlos Rontidis <pavlos.rontidis@gmail.com> * Switch away from deprecated structs * Update 21864_kubernetes_logs_user_agent.fix.md * Try manually updating version via crate update * Specify using tilde in Cargo.toml * Rip out unused aws-runtime dep * Try to limit dep bumps * Revert superfluous import change * Remove superfluous pins --------- Co-authored-by: Orri Ganel <oganel@palantir.com> Co-authored-by: Pavlos Rontidis <pavlos.rontidis@gmail.com>
@jszwedko I added |
That is actually fixed by #22044 . Let me try to merge this again. |
Summary
When querying the k8s api server for pods, the client created by the kubernetes_log source failed to specify a user agent, making it difficult to correctly attribute load on the api server to vector. By bumping the version of the kube and k8s-openapi crates, we get access to sending arbitrary headers with our requests. This PR uses this functionality to set a
user-agent
header to the valuevector/<vector version>
.Change Type
Is this a breaking change?
How did you test this PR?
I built vector from source on this branch and deployed it via a helm chart in a k8s cluster to confirm that queries against the k8s api server were being generated with user agent set as intended. I also confirmed that logs from the kubernetes_log source continue to be processed as expected.
Does this PR include user facing changes?
Checklist
Cargo.lock
), pleaserun
dd-rust-license-tool write
to regenerate the license inventory and commit the changes (if any). More details here.References