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 http_forwarder skeleton #979

Merged
merged 3 commits into from
Sep 11, 2020

Conversation

asuresh4
Copy link
Member

Description: Add skeleton for http_forwarder extension that forwards HTTP requests to a specified target.

Testing: Tests added.

Documentation: README added.

@asuresh4 asuresh4 requested a review from a team as a code owner September 10, 2020 17:42
@project-bot project-bot bot added this to In progress in Collector Sep 10, 2020
@codecov
Copy link

codecov bot commented Sep 10, 2020

Codecov Report

Merging #979 into master will increase coverage by 0.01%.
The diff coverage is 73.91%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #979      +/-   ##
==========================================
+ Coverage   88.77%   88.78%   +0.01%     
==========================================
  Files         247      249       +2     
  Lines       13272    13295      +23     
==========================================
+ Hits        11782    11804      +22     
- Misses       1135     1139       +4     
+ Partials      355      352       -3     
Flag Coverage Δ
#integration 74.88% <ø> (ø)
#unit 88.00% <73.91%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
extension/httpforwarder/extension.go 0.00% <0.00%> (ø)
extension/httpforwarder/factory.go 89.47% <89.47%> (ø)
exporter/signalfxexporter/dimensions/requests.go 93.10% <0.00%> (+8.62%) ⬆️

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 86b2ef1...8ed785d. Read the comment docs.

@asuresh4
Copy link
Member Author

PTAL @jrcamp @bogdandrutu

extension/httpforwarder/config.go Outdated Show resolved Hide resolved
extension/httpforwarder/extension.go Outdated Show resolved Hide resolved
extension/httpforwarder/factory.go Outdated Show resolved Hide resolved
extension/httpforwarder/README.md Outdated Show resolved Hide resolved
extension/httpforwarder/README.md Outdated Show resolved Hide resolved
Collector automation moved this from In progress to Reviewer approved Sep 11, 2020
@bogdandrutu bogdandrutu merged commit 7dc53b4 into open-telemetry:master Sep 11, 2020
Collector automation moved this from Reviewer approved to Done Sep 11, 2020
@asuresh4 asuresh4 deleted the http-forwarder-extension branch January 19, 2021 17:02
dyladan referenced this pull request in dynatrace-oss-contrib/opentelemetry-collector-contrib Jan 29, 2021
Note: All of the cudos go to @dneray for the logic/testing/effort in open-telemetry/opentelemetry-collector#981

This pr is based off of it with the following modifications

- The config looks like
```
- key : <key to use for applying the rule too>
  pattern: <the regex pattern with named submatchers>
  action: extract
```
I think that the original PR is going in the right way for what we can the internal logic to be but as the issue #979 and #1170 indicate we need to take a step back and redesign the attributes processor (or make it clear of its limitations).  This pr unblocks the required functionality. 

**Link to tracking Issue:** #979 

**Link to follow up issue:** #1170 

**Testing:** Added tests for extracting.

**Documentation:** Updated processor readme.
ljmsc referenced this pull request in ljmsc/opentelemetry-collector-contrib Feb 21, 2022
http.ResponseWriters may implement additional interfaces
(http.CloseNotifier, http.Flusher, http.Hijacker, http.Pusher,
io.ReaderFrom) that get lost when the ResponseWriter is wrapped in
another object. This change uses the httpsnoop package to wrap the
ResponseWriter so that the resulting object implements any of the
optional interfaces that the original ResponseWriter implements as
well as using the replacement ResponseWriter methods that gather
information for tracing.
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

2 participants