cli icon indicating copy to clipboard operation
cli copied to clipboard

Add OTEL support (carry 4556)

Open thaJeztah opened this issue 2 years ago • 7 comments

  • carry / rebase of / closes https://github.com/docker/cli/pull/4556
  • [x] depends on https://github.com/docker/cli/pull/4700

This is broken into 2 commits:

  • Plumb contexts through commands
  • Add otel tracing as a persistent pre-run to all CLI commands.

- What I did

- How I did it

- How to verify it

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

thaJeztah avatar Dec 06 '23 09:12 thaJeztah

I'll move the first commit (punching-through contexts) to a separate PR

thaJeztah avatar Dec 06 '23 14:12 thaJeztah

Codecov Report

Merging #4698 (d0da194) into master (efb9206) will decrease coverage by 61.32%. Report is 44 commits behind head on master. The diff coverage is n/a.

:exclamation: Current head d0da194 differs from pull request most recent head 827bead. Consider uploading reports for the commit 827bead to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #4698       +/-   ##
==========================================
- Coverage   61.31%       0   -61.32%     
==========================================
  Files         287       0      -287     
  Lines       20065       0    -20065     
==========================================
- Hits        12303       0    -12303     
+ Misses       6869       0     -6869     
+ Partials      893       0      -893     

codecov-commenter avatar Dec 12 '23 21:12 codecov-commenter

Thanks to @milas ❤️ I pushed a commit that swaps BuildKit detect with the OTEL SDK 🎉

thaJeztah avatar Jan 04 '24 21:01 thaJeztah

I'll cleanup / squash commits a bit after review; just pushing the changes here first

thaJeztah avatar Jan 04 '24 21:01 thaJeztah

Screenshot 2024-01-04 at 5 22 20 PM

Using my branch off your PR 🎉

(also notice I snuck in some new attributes for the CLI version metadata 👀)

Start a Jaeger instance:

docker run --rm --name jaeger \
  -p 16686:16686 \
  -p 4317:4317 \
  -p 4318:4318 \
  jaegertracing/all-in-one:1.52

(adapted from https://www.jaegertracing.io/docs/latest/getting-started/#all-in-one)

Open web UI @ http://localhost:16686/

make -f docker.Makefile build
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318 ./build/docker --debug version

milas avatar Jan 04 '24 22:01 milas

Thanks all! I pushed a couple of commits (to be squashed if ok)

I'll be calling it a day for now, but if someone wants to push to this branch; feel free to.

Pushing additional commits should be fine; we can cleanup / squash later (I didn't bother cleaning up commits yet while we're moving this still)

thaJeztah avatar Jan 04 '24 22:01 thaJeztah

HA!

#19 53.89 === FAIL: cmd/docker TestClientDebugEnabled (0.00s)
#19 53.89 panic: cannot create context from nil parent [recovered]
#19 53.89 	panic: cannot create context from nil parent

thaJeztah avatar Jan 04 '24 22:01 thaJeztah