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

Add tsh kubectl support for tracer exporter #26708

Merged
merged 4 commits into from May 24, 2023
Merged

Conversation

tigrato
Copy link
Contributor

@tigrato tigrato commented May 22, 2023

This PR adds support for --trace exporter when running tsh kubectl.
It allows any user to automatically export traces from tsh.

Usage: tsh --trace --trace-exporter=dir kubectl get pods

@tigrato tigrato force-pushed the tigrato/tsh-kubectl-tracing branch from 51d310c to 1d9ba30 Compare May 23, 2023 09:59
@tigrato tigrato marked this pull request as ready for review May 23, 2023 09:59
@github-actions github-actions bot added size/sm tsh tsh - Teleport's command line tool for logging into nodes running Teleport. labels May 23, 2023
This PR adds support for `--trace` exporter when running `tsh kubectl`.
It allows any user to automatically export traces from `tsh`.
@tigrato tigrato force-pushed the tigrato/tsh-kubectl-tracing branch from 1d9ba30 to 301b601 Compare May 23, 2023 11:01
shutdownCtx, cancel := context.WithTimeout(cf.Context, 1*time.Second)
defer cancel()
err := provider.Shutdown(shutdownCtx)
if err != nil && !strings.Contains(err.Error(), context.DeadlineExceeded.Error()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we use errors.Is here instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

tool/tsh/kubectl.go Outdated Show resolved Hide resolved
tool/tsh/kubectl.go Outdated Show resolved Hide resolved
tool/tsh/kubectl.go Show resolved Hide resolved
tigrato and others added 3 commits May 23, 2023 18:21
Co-authored-by: Alan Parra <alan.parra@goteleport.com>
Co-authored-by: Alan Parra <alan.parra@goteleport.com>
@tigrato tigrato added this pull request to the merge queue May 24, 2023
@tigrato tigrato removed this pull request from the merge queue due to a manual request May 24, 2023
@tigrato tigrato added this pull request to the merge queue May 24, 2023
Merged via the queue into master with commit 4f545f1 May 24, 2023
19 checks passed
@tigrato tigrato deleted the tigrato/tsh-kubectl-tracing branch May 24, 2023 08:40
@greedy52
Copy link
Contributor

@tigrato may I backport this to v13? I want to backport my other PR but seems to depend on this. This PR doesn't seem to be "risky" either.

@public-teleport-github-review-bot

@tigrato See the table below for backport results.

Branch Result
branch/v13 Create PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/branch/v13 size/sm tsh tsh - Teleport's command line tool for logging into nodes running Teleport.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants