artefactual-sdps / enduro

A tool to support ingest and automation in digital preservation workflows
https://enduro.readthedocs.io/
Apache License 2.0
4 stars 3 forks source link

Enable tracing in http.Client #896

Closed sevein closed 8 months ago

sevein commented 8 months ago

Register a propagator with OpenTelemetry to enable propagation of trace context over the wire [^1]. Update HTTP clients with otelhttp.Transport to wrap outbound requests with a span and enrich it with metrics.

This change enable us to relate spans occuring beyond an individual service, e.g. the activity "move-to-permanent-storage" executed by enduro-a3m-worker uses a HTTP client to request to the Storage Service the long-term storage of the AIP. With this commit we'll start seeing the HTTP POST operation performed by the client but also the rest of the details happening on the server side, i.e. the API handler, SQL queries, workflow, activities, etc.

image

[^1]: See the Trace Context spec (W3C Recommendation) for more details. It defines HTTP headers and a value format to standardize how context information is propagated over the wire.

codecov[bot] commented 8 months ago

Codecov Report

Attention: Patch coverage is 0% with 20 lines in your changes are missing coverage. Please review.

Project coverage is 47.24%. Comparing base (f075824) to head (2829c42). Report is 9 commits behind head on main.

:exclamation: Current head 2829c42 differs from pull request most recent head 8e081c0. Consider uploading reports for the commit 8e081c0 to get more accurate results

Files Patch % Lines
cmd/enduro-am-worker/main.go 0.00% 7 Missing :warning:
cmd/enduro-a3m-worker/main.go 0.00% 6 Missing :warning:
main.go 0.00% 6 Missing :warning:
internal/telemetry/traces.go 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #896 +/- ## ========================================== + Coverage 47.11% 47.24% +0.13% ========================================== Files 96 95 -1 Lines 5383 5224 -159 ========================================== - Hits 2536 2468 -68 + Misses 2611 2522 -89 + Partials 236 234 -2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.