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

[LOPS-2313] Provide a trace id when calling remote commands #2589

Merged
merged 23 commits into from
Jun 6, 2024

Conversation

alynnferry
Copy link
Contributor

@alynnferry alynnferry commented May 28, 2024

Description:

  • Includes the Trace ID as an environment variable in the SSH command.
  • Displays the Trace ID in terminal for the user.
Screen.Recording.2024-05-29.at.10.48.02.AM.mov

@alynnferry alynnferry self-assigned this May 28, 2024
@alynnferry alynnferry changed the title Provide a trace id when calling remote commands [LOPS-2313] Provide a trace id when calling remote commands May 28, 2024
@alynnferry alynnferry requested review from greg-1-anderson and a team May 28, 2024 20:58
@stovak
Copy link
Member

stovak commented May 28, 2024

LGTM when the tests pass.

@alynnferry alynnferry marked this pull request as ready for review May 28, 2024 21:16
@alynnferry alynnferry requested a review from a team as a code owner May 28, 2024 21:16
Copy link
Member

@greg-1-anderson greg-1-anderson left a comment

Choose a reason for hiding this comment

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

Update to use our TraceId class in the Request class. Also, we should only show the trace id in --debug mode. Users typically do not care about this value; it's for OCE / Plat engineers diagnosing problems.

Copy link
Contributor

@kporras07 kporras07 left a comment

Choose a reason for hiding this comment

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

Only 1 small comment but LGTM :)

src/Commands/Remote/SSHBaseCommand.php Show resolved Hide resolved
src/Helpers/Utility/TraceId.php Outdated Show resolved Hide resolved
Copy link
Member

@greg-1-anderson greg-1-anderson left a comment

Choose a reason for hiding this comment

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

We might want to go back to prepending the TRACE_ID to the beginning of the command line. Let's hold this PR until we decide what's easiest to handle on the back end.


$ssh_data = $this->sendCommandViaSsh($command_line);
// Separate the command line and environment variables
list($command_line, $env_vars) = $this->getCommandLine($command_args, $env_vars);
Copy link
Member

Choose a reason for hiding this comment

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

Don't need to return $env_vars, since they are passed in.

Copy link
Member

Choose a reason for hiding this comment

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

This still isn't resolved, and getCommandLine does not include $env_vars at the beginning of the line

@alynnferry alynnferry merged commit dfad0c0 into 3.x Jun 6, 2024
10 of 11 checks passed
@alynnferry alynnferry deleted the LOPS-2313-trace-id branch June 6, 2024 17:53
@alynnferry alynnferry mentioned this pull request Jun 6, 2024
Sign up for free to 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.

5 participants