Gin instrumentation: support reading Client IP from custom headers, and make sure proxy is trusted#6095
Conversation
Could you split that into another PR, to make things easier to review? |
Done |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6095 +/- ##
=====================================
Coverage 75.7% 75.8%
=====================================
Files 207 207
Lines 19403 19469 +66
=====================================
+ Hits 14695 14758 +63
- Misses 4273 4275 +2
- Partials 435 436 +1
🚀 New features to boost your workflow:
|
dmathieu
left a comment
There was a problem hiding this comment.
This will need a changelog entry.
|
@dmathieu is this PR ready to be merged? |
|
PRs need two approvals. |
@dmathieu is there a way I get a review/approval from another person? |
|
Ping @open-telemetry/go-approvers for review. Note that this instrumentation has no owner, and is therefore in the process of being deprecated/removed unless someone steps up to own it (which also explains the lack of reviews). |
|
Looks like this instrumentation may have an owner now. If I fix the merge conflicts, can this PR be merged now? |
|
Hey @ItalyPaleAle, can you please resolve the conflicts |
… sure proxy is trusted) With Gin, it's possible to configure the server to read the Client IP from custom headers; examples include `X-Real-Ip` or `CF-Connecting-IP`. This PR makes it possible to set as span attribute the same IP that Gin reads. Additionally, it makes sure that headers such as "X-Forwarded-For" are used only if Gin is configured to trust the upstream server PS: Also fixed unit tests, where there were assertions inside handlers, which are executed in separate goroutines
666002a to
5739da4
Compare
|
@akats7 sorry for the delay, as the amount of merge conflicts that had accumulated meant I had to recreate the PR from scratch. Should be good for your review now! |
|
Could I get a review on this please? Also, is there a way to ensure PRs like this don't keep accumulating conflicts in the changelog? |
With Gin, it's possible to configure the server to read the Client IP from custom headers; examples include
X-Real-IporCF-Connecting-IP. This PR makes it possible to set as span attribute the same IP that Gin reads.Additionally, it makes sure that headers such as "X-Forwarded-For" are used only if Gin is configured to trust the upstream server