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

Add a ‘Headers’ field in HTTPClientSettings #1552

Merged
merged 6 commits into from
Aug 14, 2020

Conversation

huyan0
Copy link
Member

@huyan0 huyan0 commented Aug 14, 2020

Description: This PR adds a ‘Headers’ field in the HTTPClientSettings struct. When ToClient() is invoked, a client interceptor that adds headers to each request is created. It is used as the Transport field of the client returned by ToClient().

Link to tracking Issue: #1551

Testing: A unit test is added. It validates that headers in HTTPClientSettings is included in the request received by a HTTP server.

cc: @alolita @huyan0 @bogdandrutu

@codecov
Copy link

codecov bot commented Aug 14, 2020

Codecov Report

Merging #1552 into master will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1552      +/-   ##
==========================================
+ Coverage   91.44%   91.46%   +0.01%     
==========================================
  Files         250      250              
  Lines       17307    17318      +11     
==========================================
+ Hits        15827    15840      +13     
+ Misses       1066     1065       -1     
+ Partials      414      413       -1     
Impacted Files Coverage Δ
config/confighttp/confighttp.go 100.00% <100.00%> (ø)
exporter/prometheusremotewriteexporter/exporter.go 100.00% <100.00%> (ø)
exporter/prometheusremotewriteexporter/factory.go 95.55% <100.00%> (ø)
translator/internaldata/resource_to_oc.go 85.41% <0.00%> (ø)
receiver/otlpreceiver/otlp.go 94.44% <0.00%> (+2.77%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 632dcf0...1e93f5f. Read the comment docs.

@bogdandrutu
Copy link
Member

@huyan0 I like that you cc-ed you :)

config/confighttp/confighttp.go Outdated Show resolved Hide resolved
Collector automation moved this from In progress to Reviewer approved Aug 14, 2020
fix TestAllHTTPClientSettings
@bogdandrutu bogdandrutu merged commit 6603e5b into open-telemetry:master Aug 14, 2020
Collector automation moved this from Reviewer approved to Done Aug 14, 2020
MovieStoreGuy pushed a commit to atlassian-forks/opentelemetry-collector that referenced this pull request Nov 11, 2021
* Update license-check to ignore all vendor dirs

* Remove vendor path exclude from license-check find
Troels51 pushed a commit to Troels51/opentelemetry-collector that referenced this pull request Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Collector
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants