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

[#8131] Generate and pass request uuid regardless of sampling rate #8217

Open
wants to merge 24 commits into
base: master
Choose a base branch
from

Conversation

yjqg6666
Copy link
Contributor

@yjqg6666 yjqg6666 commented Sep 9, 2021

Resolve #8131.

Feature

A new header Pinpoint-RequestID is added to pass around request id.

app1 --call--> app2

traced:

app1:

2021-09-09 19:01:23 [INFO] [http-nio-36103-exec-1] logger [ReqId:16a69ca7-aa74-407b-b73d-ec1ba8598970 TxId:7fcc576bf5-zp9gb-new^1631185271343^1 SpanId:1501344449065953024] -- logger msg

app2:

2021-09-09 19:01:21 [INFO] [http-nio-15678-exec-6] logger [ReqId:16a69ca7-aa74-407b-b73d-ec1ba8598970 TxId:7fcc576bf5-zp9gb-new^1631185271343^1 SpanId:-5936260539822966618] -- Request received.

2021-09-10_14-40

not traced:

app1:

2021-09-09 19:02:26 [INFO] [http-nio-36103-exec-5] logger [ReqId:86bb42ef-265f-41dc-b209-18a898ad229b TxId: SpanId:] -- logger msg

app2:

2021-09-09 19:02:26 [INFO] [http-nio-15678-exec-10] logger [ReqId:86bb42ef-265f-41dc-b209-18a898ad229b TxId: SpanId:] -- Request received.

This feature is disabled by default. It can be enabled by agent configuration "profiler.requestId.enable=true" and add %X{PreqId} to your logger pattern.

If you enabled this feature and set "profiler.http.response.requestId.enable=true" (disabled by default) in agent configuration, a "X-Request-Id" header will be added to response, and the response header name can also be configured by "profiler.http.response.requestId.headerName".

If you set "profiler.http.response.traceId.enable=true" (disabled by default) in agent configuration, a "X-Trace-Id" header will be added to response, and the response header name can also be configured by "profiler.http.response.traceId.headerName".

Tasks

  • request uuid header reader/writer.
  • http client call header writer.
  • add logger MDC (%X{PreqId}).
  • show request uuid in call tree of web ui if traced.
  • response request uuid as a header (configurable, disabled by default).
  • response trace id as a header (configurable, disabled by default).
  • kafka support(passing uuid, disabled by default, configured by profiler.kafka.requestId.enable)

@yjqg6666 yjqg6666 changed the title Generate and pass request uuid regardless of sampling rate Generate and pass request uuid regardless of sampling rate(WIP) Sep 9, 2021
@codecov
Copy link

codecov bot commented Sep 9, 2021

Codecov Report

Merging #8217 (533ccc5) into master (77e606c) will decrease coverage by 0.00%.
The diff coverage is 28.16%.

❗ Current head 533ccc5 differs from pull request most recent head 3445c41. Consider uploading reports for the commit 3445c41 to get more accurate results

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #8217      +/-   ##
============================================
- Coverage     39.80%   39.79%   -0.01%     
+ Complexity    11478    11377     -101     
============================================
  Files          3364     3335      -29     
  Lines         89754    89265     -489     
  Branches       9950     9920      -30     
============================================
- Hits          35723    35526     -197     
+ Misses        50979    50681     -298     
- Partials       3052     3058       +6     
Impacted Files Coverage Δ
...trap/plugin/request/DefaultRequestTraceWriter.java 0.00% <0.00%> (ø)
...otstrap/plugin/request/ServletRequestListener.java 0.00% <0.00%> (ø)
...strap/plugin/response/ServletResponseListener.java 0.00% <0.00%> (ø)
...lugin/response/ServletResponseListenerBuilder.java 0.00% <0.00%> (ø)
...interceptor/client/ClientCallStartInterceptor.java 0.00% <0.00%> (ø)
...ceptor/HttpMethodBaseExecuteMethodInterceptor.java 0.00% <0.00%> (ø)
...ientExchangeHandlerImplStartMethodInterceptor.java 0.00% <0.00%> (ø)
...r/HttpRequestExecutorExecuteMethodInterceptor.java 0.00% <0.00%> (ø)
...netty/interceptor/http/HttpEncoderInterceptor.java 0.00% <0.00%> (ø)
...synchttpclient/interceptor/ExecuteInterceptor.java 0.00% <0.00%> (ø)
... and 352 more

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 77e606c...3445c41. Read the comment docs.

@yjqg6666 yjqg6666 force-pushed the request-uuid branch 3 times, most recently from 57a7a33 to f978214 Compare September 10, 2021 05:54
@yjqg6666 yjqg6666 changed the title Generate and pass request uuid regardless of sampling rate(WIP) Generate and pass request uuid regardless of sampling rate Sep 10, 2021
@yjqg6666 yjqg6666 changed the title Generate and pass request uuid regardless of sampling rate [#8131] Generate and pass request uuid regardless of sampling rate Sep 13, 2021
@yjqg6666 yjqg6666 force-pushed the request-uuid branch 2 times, most recently from c3c245b to 03d4899 Compare September 18, 2021 08:21
@yjqg6666
Copy link
Contributor Author

Rebased on master.

@yjqg6666 yjqg6666 changed the title [#8131] Generate and pass request uuid regardless of sampling rate [#8131] Generate and pass request uuid regardless of sampling rate (WIP) Sep 24, 2021
@emeroad emeroad added this to the 2.4.0 milestone Sep 24, 2021
@yjqg6666 yjqg6666 changed the title [#8131] Generate and pass request uuid regardless of sampling rate (WIP) [#8131] Generate and pass request uuid regardless of sampling rate Sep 24, 2021
@yjqg6666
Copy link
Contributor Author

yjqg6666 commented Sep 26, 2021

Resolve conflicts.

@yjqg6666
Copy link
Contributor Author

Resolve conflicts.

@yjqg6666
Copy link
Contributor Author

yjqg6666 commented Mar 9, 2022

Rebase on the current master & fix conflicts.

@chkch
Copy link

chkch commented May 30, 2023

This feature is cool and valuable. I would like to know if there is a clear schedule

@yjqg6666
Copy link
Contributor Author

I will squash the commits and rebase the commits on the current master.

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.

[FR] generate and pass request uuid regardless of sampling rate.
3 participants