otel: capture whether process was invoked from a terminal

This commit adds a "terminal" attribute to `BaseMetricAttributes`
that allows us to discern whether an invocation was from an interactive
terminal or not.

Signed-off-by: Laura Brehm <laurabrehm@hey.com>
This commit is contained in:
Laura Brehm
2024-04-02 11:05:20 +01:00
parent 155dc5e4e4
commit ee1b2836af
4 changed files with 119 additions and 14 deletions

View File

@ -304,7 +304,7 @@ func runDocker(ctx context.Context, dockerCli *command.DockerCli) error {
mp := dockerCli.MeterProvider(ctx)
defer mp.Shutdown(ctx)
otel.SetMeterProvider(mp)
command.InstrumentCobraCommands(cmd, mp)
dockerCli.InstrumentCobraCommands(cmd, mp)
var envs []string
args, os.Args, envs, err = processAliases(dockerCli, cmd, args, os.Args)