BaseCommandAttributes returns an attribute.Set containing attributes to attach to metrics/traces
(cmd *cobra.Command, streams Streams)
| 16 | |
| 17 | // BaseCommandAttributes returns an attribute.Set containing attributes to attach to metrics/traces |
| 18 | func 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 | // |
no test coverage detected
searching dependent graphs…