Skip to content

Report client tool in user agent - #69606

Open
charlestp wants to merge 2 commits into
charles/integration-cascade-deletefrom
charles/client-kind-user-agent
Open

Report client tool in user agent#69606
charlestp wants to merge 2 commits into
charles/integration-cascade-deletefrom
charles/client-kind-user-agent

Conversation

@charlestp

Copy link
Copy Markdown
Contributor

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

  • - Client kinds are passed through to the event.

@charlestp charlestp added no-changelog Indicates that a PR does not require a changelog entry backport/branch/v18 labels Aug 12, 2026
@charlestp
charlestp force-pushed the charles/client-kind-user-agent branch from bde4a37 to d9b8ae0 Compare August 13, 2026 05:25
@charlestp
charlestp changed the base branch from master to charles/integration-cascade-delete August 13, 2026 05:26

@hugoShaka hugoShaka left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@charlestp

Copy link
Copy Markdown
Contributor Author

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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread constants.go
Comment on lines +247 to +248
// ComponentTerraformProvider is the Teleport Terraform provider.
ComponentTerraformProvider = "terraform-provider"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/branch/v18 no-changelog Indicates that a PR does not require a changelog entry size/sm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants