teleport/lib/observability
rosstimothy 579a453db2
Allow custom trace exporter for tsh (#19405)
* Allow custom trace exporter for tsh

Trace forwarding via `tsh --trace` only works to date if Auth is
configured with the `tracing_service` enabled. In all other scenarios
the traces are still forwarded to Auth but are silently dropped.
This makes it difficult to capture valuable traces from customers
with latency issues as they are first required to setup a Telemetry
backend and enable tracing in their cluster.

A new `--trace-exporter` flag is added to `tsh` to make it possible
to direct traces from `tsh` to a file or local instance of jaeger
without hacing to modify their Teleport cluster. The url must follow
the same semantics as the config file equivalent.

One important caveat is that **only** the `tsh` spans will be captured.
Any corresponding `teleport` spans are exported acording to the
`tracing_service`. While this only paints half the picture, it is
still a good indicator of where `tsh` may be experiencing latency.

An example usage to send traces to local files:

```bash
tsh --trace --trace-exporter=file:///some/path/traces ssh user@foo
```
2022-12-21 18:40:52 +00:00
..
metrics Update golangci-lint to 1.49.0 (#16507) 2022-09-19 22:38:59 +00:00
tracing Allow custom trace exporter for tsh (#19405) 2022-12-21 18:40:52 +00:00