motiv-labs / janus

An API Gateway written in Go
https://hellofresh.gitbooks.io/janus
MIT License
2.77k stars 319 forks source link

Add debug trace #407

Closed nenad closed 4 years ago

nenad commented 4 years ago

What does this PR do?

Adds DebugTrace feature which returns X-Debug-Trace response header with the Trace ID.

Edit: I've reworked the PR so that now we match against some arbitrary key, instead of relying on true or 1 set on the request header.

codecov[bot] commented 4 years ago

Codecov Report

Merging #407 into master will increase coverage by 0.21%. The diff coverage is 84.61%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #407      +/-   ##
==========================================
+ Coverage   40.27%   40.48%   +0.21%     
==========================================
  Files          75       76       +1     
  Lines        2642     2655      +13     
==========================================
+ Hits         1064     1075      +11     
- Misses       1516     1517       +1     
- Partials       62       63       +1
Impacted Files Coverage Δ
pkg/config/specification.go 61.81% <100%> (+0.7%) :arrow_up:
pkg/middleware/debug_trace.go 83.33% <83.33%> (ø)

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 199be55...c5dfc80. Read the comment docs.

nenad commented 4 years ago

@vgarvardt and @rafaeljesus I've updated the PR to be more strict on what is considered a valid debug request. I'd appreciate if you could review it once again.

rafaeljesus commented 4 years ago

int-test are failing