Skip to content

Commit 452638f

Browse files
sindrerh2ybelMekk
andcommitted
fix: subcommand flags in metric
Co-authored-by: ybelmekk <[email protected]> Co-authored-by: Carl Hedgren<[email protected]>
1 parent fcbd230 commit 452638f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/metrics/otel.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,9 @@ func recordCommandUsage(ctx context.Context, provider *metric.MeterProvider, fla
6060
for i, f := range flags {
6161
if i == 0 {
6262
attributes[0] = attribute.String("command", f)
63+
} else {
64+
attributes[i] = attribute.String("subcommand", f)
6365
}
64-
attributes[i] = attribute.String("subcommand", f)
6566
}
6667
commandHistogram.Record(ctx, 1, m.WithAttributes(attributes...))
6768
}

0 commit comments

Comments
 (0)