feat(metrics): add user agent for prebuilt tools (#669)

Append "+prebuilt.<source>" to the user agent for tracking the prebuilt
tools usage. This is set before the server is initialized and the user
agent is set on the client.

Using the period to stay consistent with our other appended metadata
like "binary.linux"
This commit is contained in:
Averi Kitsch
2025-06-06 09:49:25 -07:00
committed by GitHub
parent 5638ef520a
commit 29aa0a70da

View File

@@ -305,6 +305,8 @@ func run(cmd *Command) error {
}
logMsg := fmt.Sprint("Using prebuilt tool configuration for ", cmd.prebuiltConfig)
cmd.logger.InfoContext(ctx, logMsg)
// Append prebuilt.source to Version string for the User Agent
cmd.cfg.Version += "+prebuilt." + cmd.prebuiltConfig
} else {
// Set default value of tools-file flag to tools.yaml
if cmd.tools_file == "" {