Report client tool in user agent - #69606
Conversation
bde4a37 to
d9b8ae0
Compare
There was a problem hiding this comment.
I don't think embeddedtbot is the right place for such a change.
The purpose of this library is to run tbot and obtain credentials. The caller might or might not ask for a client as well. If the caller wants to obtain a client with specific settings (user agent, ...) it should pass the client options to embedded tbot.
One good example is the TF provider which runs embedded tbot but also needs to set the user agent manually. This is symptomatic of a feature not added in the correct library. How you obtain a client should not change the client properties.
Please consider making client dial option a functional argument and have the caller pass the options it wants instead of trying to guess the correct user agent from a bot kind.
|
Makes sense. In the scope of these discovery config events, we don't need the kube operator client identified anyway, so I just removed it. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b6ca2bfcf9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // ComponentTerraformProvider is the Teleport Terraform provider. | ||
| ComponentTerraformProvider = "terraform-provider" |
There was a problem hiding this comment.
Tag embedded operator clients with their bot kind
When the Kubernetes operator runs, integrations/operator/main.go:75,149-186 selects KindKubernetesOperator and gives the client returned by EmbeddedBot.StartAndWaitForClient to every reconciler, but integrations/lib/embeddedtbot/bot.go:214-220 still builds that client without a component user agent and this patch defines only the Terraform component. Consequently operator-originated resource changes remain attributed to the generic gRPC client instead of the Kubernetes operator, irreversibly corrupting the client-tool usage data this change is intended to collect. Define the operator component and select the user agent from b.cfg.Kind when building embedded-bot clients.
Useful? React with 👍 / 👎.
Make web and bot clients report their tool in the request user agent. This will allow us to track what tools are used to configure discovery in usage events.
Manual Test Plan
Test Environment
Cloud staging tenant running local build
Test Cases