Skip to content
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

otelhttp: add WithClientTrace to connect with otelhttptrace #875

Merged
merged 3 commits into from
Jan 11, 2022

Conversation

tonistiigi
Copy link
Contributor

I couldn't quite figure out how otelhttp and otelhttptrace are supposed to be used together. From they being in separate packages I assume maintainers don't want them to depend on each other.

This adds a new option so caller can initialize Transport with otelhttp.NewTransport(base, otelhttp.WithClientTrace(otelhttptrace.NewClientTrace)) (or any other httptrace implementation) so that otelhttp spans will have otelhttptrace spans as children.

Depends on #873

@thaJeztah
Copy link

@tonistiigi #873 was merged; guess this needs to be rebased and moved out of draft

@thaJeztah
Copy link

#874 was merged as well; this ready to be moved out of draft?

@codecov
Copy link

codecov bot commented Dec 1, 2021

Codecov Report

Merging #875 (9a56be1) into main (f0fe848) will increase coverage by 0.0%.
The diff coverage is 100.0%.

Impacted file tree graph

@@          Coverage Diff          @@
##            main    #875   +/-   ##
=====================================
  Coverage   69.3%   69.3%           
=====================================
  Files        127     127           
  Lines       5424    5432    +8     
=====================================
+ Hits        3760    3768    +8     
  Misses      1521    1521           
  Partials     143     143           
Impacted Files Coverage Δ
instrumentation/net/http/otelhttp/config.go 80.6% <100.0%> (+1.3%) ⬆️
instrumentation/net/http/otelhttp/transport.go 89.6% <100.0%> (+0.5%) ⬆️

Transport can be created with `otelhttp.NewTransport(base, otelhttp.WithClientTrace(otelhttptrace.NewClientTrace))`
for additional httptrace tracing.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
@thaJeztah
Copy link

@pellared @MadVikingGod @Aneurysm9 ptal; this is the remaining one for us to get rid of our fork ❤️

@crazy-max
Copy link

Friendly ping, is it ok to merge this one? Thx!

@thaJeztah
Copy link

Looks like it may need another rebase

@Aneurysm9
Copy link
Member

This still requires another approval. @open-telemetry/go-approvers can anyone else weigh in on this?

@evantorrie
Copy link
Contributor

LGTM 👍

@Aneurysm9 Aneurysm9 merged commit 7e31ebe into open-telemetry:main Jan 11, 2022
@thaJeztah
Copy link

Thank you!

@MrAlias MrAlias mentioned this pull request Feb 11, 2022
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.

None yet

6 participants