-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OTEL: adding flags to cli traces #10974
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #10974 +/- ##
==========================================
- Coverage 58.30% 57.65% -0.65%
==========================================
Files 124 127 +3
Lines 10912 11046 +134
==========================================
+ Hits 6362 6369 +7
- Misses 3922 4044 +122
- Partials 628 633 +5
☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! LGTM, just a pedantic naming style request that's not your fault since I never documented it anywhere 😛
cmd/cmdtrace/cmd_span.go
Outdated
cmdSpan.SetAttributes(attribute.StringSlice("cliArgs", args)) | ||
cmdSpan.SetAttributes(attribute.StringSlice("cliFlags", getFlags(cmd.Flags()))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since span attributes are a single-level map, so far I've been separating logical groups with .
, e.g. cli.args
/ cli.flags
.
(I'm realizing I should add a TRACING.md
to the repo here with some info...serious 🚌 factor right now)
Ah, for your failures:
|
Signed-off-by: rvigus <[email protected]>
Signed-off-by: rvigus <[email protected]>
Signed-off-by: rvigus <[email protected]>
Signed-off-by: rvigus <[email protected]>
48f9952
to
1d2ac5d
Compare
What I did
Adds cli args and flags (e.g.
--timeout
,--dry-run
, etc) as attributes to cli trace data. These attributes are then picked up by the collector and made available to the end user.Related issue
https://docker.atlassian.net/browse/ENV-276