Skip to content

trace: refactor root command span reporting#10719

Merged
ndeloof merged 1 commit intodocker:v2from
milas:otel-cmd-errors
Jun 20, 2023
Merged

trace: refactor root command span reporting#10719
ndeloof merged 1 commit intodocker:v2from
milas:otel-cmd-errors

Conversation

@milas
Copy link
Copy Markdown
Contributor

@milas milas commented Jun 15, 2023

What I did

  • Move all the initialization code out of main.go
  • Ensure spans are reported when there's an error with the command
  • Attach the Compose version & active Docker context to the resource instead of the span
  • Name the root CLI span cli/<cmd> for clarity and grab the full subcommand path (e.g. alpha-viz instead of just viz)

Related issue
Fixing all the bugs I introduced: 😅

(not mandatory) A picture of a cute animal, if possible in relation to what you did
a tiny turtle or tortoise eating a strawberry that is bigger than it

@milas milas added the area/cli label Jun 15, 2023
@milas milas requested a review from a team June 15, 2023 17:18
@milas milas self-assigned this Jun 15, 2023
@milas milas requested review from StefanScherer, glours, laurazard, ndeloof, nicksieger and ulyssessouza and removed request for a team June 15, 2023 17:18
@milas milas force-pushed the otel-cmd-errors branch from cb530df to f0bbd73 Compare June 15, 2023 17:19
* Move all the initialization code out of `main.go`
* Ensure spans are reported when there's an error with the
  command
* Attach the Compose version & active Docker context to the
  resource instead of the span
* Name the root CLI span `cli/<cmd>` for clarity and grab
  the full subcommand path (e.g. `alpha-viz` instead of just
  `viz`)

Signed-off-by: Milas Bowman <[email protected]>
@milas milas force-pushed the otel-cmd-errors branch from f0bbd73 to 0dcc9d3 Compare June 15, 2023 17:22
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 15, 2023

Codecov Report

Patch coverage: 61.76% and project coverage change: +0.11 🎉

Comparison is base (2efea2e) 58.89% compared to head (0dcc9d3) 59.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##               v2   #10719      +/-   ##
==========================================
+ Coverage   58.89%   59.00%   +0.11%     
==========================================
  Files         112      113       +1     
  Lines        9735     9767      +32     
==========================================
+ Hits         5733     5763      +30     
- Misses       3413     3416       +3     
+ Partials      589      588       -1     
Impacted Files Coverage Δ
internal/tracing/docker_context.go 23.43% <0.00%> (-1.16%) ⬇️
internal/tracing/mux.go 0.00% <0.00%> (ø)
internal/tracing/tracing.go 14.66% <0.00%> (-0.41%) ⬇️
cmd/cmdtrace/cmd_span.go 66.66% <66.66%> (ø)
cmd/main.go 75.00% <100.00%> (+7.75%) ⬆️

... and 6 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ndeloof ndeloof merged commit e1f8603 into docker:v2 Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants