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

kubernetes_log source: Specify a user agent when making requests to the k8s api server #21864

Open
ganelo opened this issue Nov 21, 2024 · 5 comments
Labels
source: kubernetes_logs Anything `kubernetes_logs` source related type: feature A value-adding code addition that introduce new functionality.

Comments

@ganelo
Copy link

ganelo commented Nov 21, 2024

Looking at logs generated by k8s-audit-webhook, I can see that when vector requests the set of pods from the k8s api server, it is not specifying a user agent. This makes it difficult to attribute load on the api server to the correct client (namely, vector).

@jszwedko jszwedko added source: kubernetes_logs Anything `kubernetes_logs` source related type: feature A value-adding code addition that introduce new functionality. labels Nov 21, 2024
@pront pront changed the title The kubernetes_log source does not specify a user agent when making requests of the k8s api server kubernetes_log source: Specify a user agent when making requests to the k8s api server Nov 21, 2024
@ganelo
Copy link
Author

ganelo commented Nov 21, 2024

I have a branch on which I've put together a proposed fix; I'm working through the contributions documentation to bring it up to snuff, but if you want a sneak peak you can find it here: master...ganelo:vector:og/kubernetes-user-agent

@jszwedko
Copy link
Member

I have a branch on which I've put together a proposed fix; I'm working through the contributions documentation to bring it up to snuff, but if you want a sneak peak you can find it here: master...ganelo:vector:og/kubernetes-user-agent

Awesome, this seems to be on the right track!

@pront
Copy link
Member

pront commented Nov 22, 2024

Thanks @ganelo, I was about to comment that this request seems reasonable and we can add this header. Don't hesitate to open a PR!

@ganelo
Copy link
Author

ganelo commented Nov 22, 2024

Apologies for the delay, I realized that my testing had been exclusively focused on verifying that the header was coming through, but in practice the changes on my branch resulted in the kubernetes logs not being picked up, suggesting some fundamental issue with the approach. I'm going to be trying to get to the bottom of this next week, but odds are it will bleed into the following week given that next week is Thanksgiving.

@ganelo
Copy link
Author

ganelo commented Nov 27, 2024

Found/fixed the issue (minor oversight - wasn't actually handing the InitDone events to the store).

PR here: #21905

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
source: kubernetes_logs Anything `kubernetes_logs` source related type: feature A value-adding code addition that introduce new functionality.
Projects
None yet
Development

No branches or pull requests

3 participants