Skip to content

fixbug 修复io.opentelemetry.api.incubator.propagation.CaseInsensitiveMap#6524

Closed
junwense wants to merge 15 commits intoopen-telemetry:mainfrom
junwense:main
Closed

fixbug 修复io.opentelemetry.api.incubator.propagation.CaseInsensitiveMap#6524
junwense wants to merge 15 commits intoopen-telemetry:mainfrom
junwense:main

Conversation

@junwense
Copy link
Copy Markdown
Contributor

我于测试io.opentelemetry.examples.http 的io.opentelemetry.example.http.HttpServer 发现此问题,会导致客户端发送到服务端的trace断裂,因为通过http传输,header里面的大小写会变化,所以服务端需要根据此map把key转换成小写获取traceparent的信息,但是通过构造函数构造此map,会导致此方法里的key不是全部小写。

fix map Constructor bug
@junwense junwense requested a review from a team June 14, 2024 10:34
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented Jun 14, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@heyams
Copy link
Copy Markdown
Contributor

heyams commented Jun 14, 2024

我于测试io.opentelemetry.examples.http 的io.opentelemetry.example.http.HttpServer 发现此问题,会导致客户端发送到服务端的trace断裂,因为通过http传输,header里面的大小写会变化,所以服务端需要根据此map把key转换成小写获取traceparent的信息,但是通过构造函数构造此map,会导致此方法里的key不是全部小写。

Copilot translated this from Chinese to English:

"I discovered this issue while testing the HttpServer in io.opentelemetry.examples.http from io.opentelemetry.example.http. It causes the trace sent from the client to the server to break. Because the case of the headers changes when transmitted via HTTP, the server needs to convert the key in this map to lowercase to retrieve the traceparent information. However, constructing this map through the constructor causes the keys in this method to not be all lowercase."

@heyams
Copy link
Copy Markdown
Contributor

heyams commented Jun 14, 2024

@junwense build failure was caused by formatting. Please run ./gradlew spotlessApply.

@jkwatson
Copy link
Copy Markdown
Contributor

@junwense two things:

  1. You'll need to sign the CLA before we can accept the code
  2. Please add a unit test for this case.

junwense added 3 commits June 17, 2024 16:40
fix map Constructor bug with tests
fix map Constructor bug with tests
modify tests method name
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.62%. Comparing base (fe8a7f4) to head (e90df86).
Report is 22 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #6524      +/-   ##
============================================
- Coverage     90.63%   90.62%   -0.02%     
- Complexity     6228     6261      +33     
============================================
  Files           679      689      +10     
  Lines         18661    18704      +43     
  Branches       1842     1844       +2     
============================================
+ Hits          16914    16950      +36     
- Misses         1189     1198       +9     
+ Partials        558      556       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

junwense and others added 2 commits June 27, 2024 09:48
Modify CaseInsensitiveMap.getKeyLowerCase method modifiers
Modify CaseInsensitiveMap.TestCases
Add dependency guava-annotations
junwense added 2 commits July 1, 2024 17:00
Modify CaseInsensitiveMap TestCase
Modify CaseInsensitiveMap TestCase
junwense added 2 commits July 3, 2024 17:20
Modify CaseInsensitiveMap TestCase
Modify CaseInsensitiveMap TestCase
@jkwatson
Copy link
Copy Markdown
Contributor

closing, replaced by #6569. @junwense I apologize for messing up your PR, and I have opened up #6569 as the replacement.

@jkwatson jkwatson closed this Jul 11, 2024
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.

3 participants