Skip to content

Filter out headers not required for W3C tracing in service invocation.#642

Merged
artursouza merged 2 commits into
dapr:masterfrom
artursouza:filter_http_header
Oct 12, 2021
Merged

Filter out headers not required for W3C tracing in service invocation.#642
artursouza merged 2 commits into
dapr:masterfrom
artursouza:filter_http_header

Conversation

@artursouza

@artursouza artursouza commented Oct 11, 2021

Copy link
Copy Markdown
Contributor

Description

Filter out headers not required for W3C tracing in service invocation.

Issue reference

We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.

Please reference the issue this PR will close: #638

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

@artursouza artursouza requested review from a team as code owners October 11, 2021 23:20
@codecov

codecov Bot commented Oct 11, 2021

Copy link
Copy Markdown

Codecov Report

Merging #642 (18319c2) into master (ed43ba2) will increase coverage by 0.08%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #642      +/-   ##
============================================
+ Coverage     77.16%   77.25%   +0.08%     
- Complexity      942      946       +4     
============================================
  Files            88       88              
  Lines          3009     3012       +3     
  Branches        334      334              
============================================
+ Hits           2322     2327       +5     
+ Misses          525      523       -2     
  Partials        162      162              
Impacted Files Coverage Δ
sdk/src/main/java/io/dapr/client/DaprHttp.java 92.24% <100.00%> (+1.09%) ⬆️
.../src/main/java/io/dapr/client/DaprClientProxy.java 75.86% <0.00%> (+1.72%) ⬆️

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 ed43ba2...18319c2. Read the comment docs.

@halspang halspang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filtering changes themselves seem fine, I just want to know the implications of this change. Are we forbidding all future headers? Or is this just for tracing's sake? The issue seems to imply it's just to avoid large headers?

}

@Test
public void invokeServiceWithContext() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this test actually check that the header is filtered out? I'm not sure if the mockInterceptor rule will only be matched if it has just those headers.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. It only matches if the headers match too. I tested by removing the fix and the test fails.

@artursouza

Copy link
Copy Markdown
Contributor Author

Great point. The intent for this is to handle W3C headers and nothing else. If we want to extend the use, we can by expanding the list.

@artursouza

Copy link
Copy Markdown
Contributor Author

So, adding everything to the header is a bug, causing the large header issue too.

@halspang

Copy link
Copy Markdown
Contributor

Great point. The intent for this is to handle W3C headers and nothing else. If we want to extend the use, we can by expanding the list.

Makes sense! Thanks for the clarification.

@artursouza artursouza merged commit 8404b77 into dapr:master Oct 12, 2021
fackee pushed a commit to fackee/java-sdk that referenced this pull request Mar 28, 2022
)

Signed-off-by: zjx244729 <zjx244729@alibaba-inc.com>
fackee pushed a commit to fackee/java-sdk that referenced this pull request Mar 28, 2022
)

Signed-off-by: zjx244729 <zjx244729@alibaba-inc.com>
fackee pushed a commit to fackee/java-sdk that referenced this pull request Mar 28, 2022
)

Signed-off-by: zjx244729 <zjx244729@alibaba-inc.com>
fackee pushed a commit to fackee/java-sdk that referenced this pull request Mar 28, 2022
)

Signed-off-by: zjx244729 <zjx244729@alibaba-inc.com>
fackee pushed a commit to fackee/java-sdk that referenced this pull request Mar 28, 2022
)

Signed-off-by: zjx244729 <zjx244729@alibaba-inc.com>
fackee pushed a commit to fackee/java-sdk that referenced this pull request Mar 28, 2022
)

Signed-off-by: zjx244729 <zjx244729@alibaba-inc.com>
fackee pushed a commit to fackee/java-sdk that referenced this pull request Mar 28, 2022
)

Signed-off-by: zjx244729 <zjx244729@alibaba-inc.com>
fackee pushed a commit to fackee/java-sdk that referenced this pull request Mar 28, 2022
)

Signed-off-by: zjx244729 <zjx244729@alibaba-inc.com>
fackee pushed a commit to fackee/java-sdk that referenced this pull request Mar 28, 2022
)

Signed-off-by: zjx244729 <zjx244729@alibaba-inc.com>
fackee pushed a commit to fackee/java-sdk that referenced this pull request Mar 28, 2022
)

Signed-off-by: zjx244729 <zjx244729@alibaba-inc.com>
fackee pushed a commit to fackee/java-sdk that referenced this pull request Mar 28, 2022
)

Signed-off-by: zjx244729 <zjx244729@alibaba-inc.com>
fackee pushed a commit to fackee/java-sdk that referenced this pull request Mar 28, 2022
)

Signed-off-by: zjx244729 <zjx244729@alibaba-inc.com>
fackee pushed a commit to fackee/java-sdk that referenced this pull request Mar 28, 2022
)

Signed-off-by: zjx244729 <zjx244729@alibaba-inc.com>
fackee pushed a commit to fackee/java-sdk that referenced this pull request Mar 28, 2022
)

Signed-off-by: zjx244729 <zjx244729@alibaba-inc.com>
artursouza added a commit to pkedy/java-sdk that referenced this pull request Jun 22, 2022
)

Signed-off-by: Artur Souza <artursouza.ms@outlook.com>
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.

Spring security context added as additional http header to http request via service invocation

2 participants