MCPcopy Index your code
hub / github.com/docker/cli / BaseCommandAttributes

Function BaseCommandAttributes

cli/command/telemetry_utils.go:18–22  ·  view source on GitHub ↗

BaseCommandAttributes returns an attribute.Set containing attributes to attach to metrics/traces

(cmd *cobra.Command, streams Streams)

Source from the content-addressed store, hash-verified

16
17// BaseCommandAttributes returns an attribute.Set containing attributes to attach to metrics/traces
18func BaseCommandAttributes(cmd *cobra.Command, streams Streams) []attribute.KeyValue {
19 return append([]attribute.KeyValue{
20 attribute.String("command.name", getCommandName(cmd)),
21 }, stdioAttributes(streams)...)
22}
23
24// InstrumentCobraCommands wraps all cobra commands' RunE funcs to set a command duration metric using otel.
25//

Callers 1

StartInstrumentationMethod · 0.85

Calls 3

getCommandNameFunction · 0.85
stdioAttributesFunction · 0.85
StringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…