Skip to content

Add cmd-exec-id to user agent - #1808

Merged
shreyas-goenka merged 9 commits into
mainfrom
cmd-uuid
Nov 1, 2024
Merged

Add cmd-exec-id to user agent#1808
shreyas-goenka merged 9 commits into
mainfrom
cmd-uuid

Conversation

@shreyas-goenka

@shreyas-goenkashreyas-goenka commented Oct 4, 2024

Copy link
Copy Markdown
Contributor

Changes

This PR adds the cmd-exec-id field to the user agent. This allows us to correlate multiple HTTP requests made from the CLI.

Why Not Use HTTP traceparent?

We considered using the traceparent header in HTTP as an alternative, but it's not a good fit for our use case. Here's why:

  1. Purpose of traceparent: It's designed to trace a single HTTP request across a distributed system as it moves through subsystems and proxies.
  2. Our requirement: We need to trace multiple HTTP requests made during a single command execution in the CLI.

For more details about how traceparent itself works and how it's used in the Go SDK, see databricks/databricks-sdk-go#914.

Tests

Unit test

@pietern

Copy link
Copy Markdown
Contributor

With an alternative in the works, shall we skip this?

@shreyas-goenka

Copy link
Copy Markdown
ContributorAuthor

@pietern I have not yet looked into Traceparent. I'll followup on this and close it once I verify it would work.

@shreyas-goenka

shreyas-goenka commented Oct 30, 2024

Copy link
Copy Markdown
ContributorAuthor

@shreyas-goenka
shreyas-goenka marked this pull request as ready for review October 30, 2024 15:14
Comment threadcmd/root/user_agent_command.go
Comment threadcmd/root/user_agent_upstream_test.go Outdated
@shreyas-goenkashreyas-goenka changed the title Add trace id to user agent to correlate API calls for the same command executionAdd cmd-exec-id to user agent to correlate API calls from the same command executionOct 31, 2024
Comment threadcmd/root/root.go
Comment threadcmd/root/user_agent_command_exec_id.go Outdated
Comment threadcmd/root/user_agent_command_exec_id.go Outdated
@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

Test Details: go/deco-tests/11613171225

@pieternpietern changed the title Add cmd-exec-id to user agent to correlate API calls from the same command executionAdd cmd-exec-id to user agentNov 1, 2024

@pieternpietern 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.

The change LGTM. Please update the PR summary. If you want to keep the discussion about traceparent around, it should move to its own section. Now it reads as if this PR has any bearing on traceparent, but it doesn't.

@shreyas-goenka
shreyas-goenka added this pull request to the merge queueNov 1, 2024
Merged via the queue into main with commit f3bf33dNov 1, 2024
@shreyas-goenka
shreyas-goenka deleted the cmd-uuid branch November 1, 2024 14:15
andrewnester added a commit that referenced this pull request Nov 6, 2024
CLI:
* Clean host URL in the `auth login` command ([#1879](#1879)).
Bundles:
* Fix bundle run when run interactively ([#1880](#1880)).
* Fix relative path resolution for dashboards on Windows ([#1881](#1881)).
Internal:
* Address goreleaser deprecation warning ([#1872](#1872)).
* Update actions/github-script to v7 ([#1873](#1873)).
* Use Go 1.23 ([#1871](#1871)).
* [Internal] Always write message for manual integration test trigger ([#1874](#1874)).
* Add `cmd-exec-id` to user agent ([#1808](#1808)).
* Added E2E test to run Python wheels on interactive cluster created in bundle ([#1864](#1864)).
Dependency updates:
* Bump github.com/hashicorp/terraform-json from 0.22.1 to 0.23.0 ([#1877](#1877)).
github-merge-queueBot pushed a commit that referenced this pull request Nov 6, 2024
CLI:
* Clean host URL in the `auth login` command
([#1879](#1879)).
Bundles:
* Fix bundle run when run interactively
([#1880](#1880)).
* Fix relative path resolution for dashboards on Windows
([#1881](#1881)).
Internal:
* Address goreleaser deprecation warning
([#1872](#1872)).
* Update actions/github-script to v7
([#1873](#1873)).
* Use Go 1.23 ([#1871](#1871)).
* [Internal] Always write message for manual integration test trigger
([#1874](#1874)).
* Add `cmd-exec-id` to user agent
([#1808](#1808)).
* Added E2E test to run Python wheels on interactive cluster created in
bundle ([#1864](#1864)).
Dependency updates:
* Bump github.com/hashicorp/terraform-json from 0.22.1 to 0.23.0
([#1877](#1877)).
denik pushed a commit that referenced this pull request May 20, 2026
## Changes
This PR adds the `cmd-exec-id` field to the user agent. This allows us
to correlate multiple HTTP requests made from the CLI.
### Why Not Use HTTP traceparent?
We considered using the traceparent header in HTTP as an alternative,
but it's not a good fit for our use case. Here's why:
1. Purpose of traceparent: It's designed to trace a single HTTP request
across a distributed system as it moves through subsystems and proxies.
2. Our requirement: We need to trace multiple HTTP requests made during
a single command execution in the CLI.
For more details about how traceparent itself works and how it's used in
the Go SDK, see
databricks/databricks-sdk-go#914.
## Tests
Unit test
denik pushed a commit that referenced this pull request May 20, 2026
CLI:
* Clean host URL in the `auth login` command
([#1879](#1879)).
Bundles:
* Fix bundle run when run interactively
([#1880](#1880)).
* Fix relative path resolution for dashboards on Windows
([#1881](#1881)).
Internal:
* Address goreleaser deprecation warning
([#1872](#1872)).
* Update actions/github-script to v7
([#1873](#1873)).
* Use Go 1.23 ([#1871](#1871)).
* [Internal] Always write message for manual integration test trigger
([#1874](#1874)).
* Add `cmd-exec-id` to user agent
([#1808](#1808)).
* Added E2E test to run Python wheels on interactive cluster created in
bundle ([#1864](#1864)).
Dependency updates:
* Bump github.com/hashicorp/terraform-json from 0.22.1 to 0.23.0
([#1877](#1877)).
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@shreyas-goenka@pietern@eng-dev-ecosystem-bot