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

[FR.] always send caller application name #8557

Open
yjqg6666 opened this issue Dec 24, 2021 · 4 comments · May be fixed by #8570
Open

[FR.] always send caller application name #8557

yjqg6666 opened this issue Dec 24, 2021 · 4 comments · May be fixed by #8570

Comments

@yjqg6666
Copy link
Contributor

yjqg6666 commented Dec 24, 2021

Which module is your feature request related to?
Plugin

Is your feature request related to a problem?
If the call path is A -> B -> C, B calls C in a different thread(without changing code). The C will have a new transaction trace and will never know who called. On the web side, the calling side is always a virtual node user. If we know which app made the call, we could change the application code to use pinpoint-sdk to wrap the existing code.

Describe the solution you'd like
In the http client plugins, insert a caller application name header to request.
Add a config to enable/disable this feature and a configure for header name.

A new PR would be made.
PR #8561 #8570 is made to resolve this issue.

@yjqg6666 yjqg6666 changed the title always send caller application name [FR.] always send caller application name Dec 24, 2021
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Dec 24, 2021
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Dec 24, 2021
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Dec 24, 2021
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Dec 27, 2021
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Dec 27, 2021
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Dec 27, 2021
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Dec 27, 2021
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Dec 27, 2021
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Dec 27, 2021
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Dec 27, 2021
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Dec 27, 2021
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Dec 27, 2021
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Dec 27, 2021
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Dec 27, 2021
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Dec 27, 2021
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Dec 27, 2021
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Dec 27, 2021
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Dec 27, 2021
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Dec 27, 2021
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Dec 27, 2021
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Dec 27, 2021
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Dec 27, 2021
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Dec 28, 2021
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Dec 28, 2021
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Dec 28, 2021
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Dec 30, 2021
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Dec 30, 2021
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Dec 30, 2021
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Dec 30, 2021
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Dec 30, 2021
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Dec 30, 2021
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Dec 30, 2021
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Dec 30, 2021
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Dec 30, 2021
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Dec 30, 2021
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Dec 30, 2021
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Dec 30, 2021
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Dec 30, 2021
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Dec 30, 2021
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Dec 30, 2021
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Dec 30, 2021
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Dec 30, 2021
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Dec 30, 2021
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Dec 30, 2021
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Dec 30, 2021
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Dec 30, 2021
@yjqg6666 yjqg6666 linked a pull request Dec 30, 2021 that will close this issue
8 tasks
@emeroad
Copy link
Member

emeroad commented Jan 4, 2022

It seems that the data you are adding is the same type as Pinpoint-pAppName

public enum Header {
    // ~~
    HTTP_PARENT_APPLICATION_NAME("Pinpoint-pAppName"),
    HTTP_PARENT_APPLICATION_TYPE("Pinpoint-pAppType"),

What's the difference with Pinpoint-pAppName?
Works regardless of sampling?

@yjqg6666
Copy link
Contributor Author

yjqg6666 commented Jan 5, 2022

This header will always be sent regardless of sampling rate and async running in a different thread. The Pinpoint-pAppName header is only sent when the transaction is sampled and is hidden from application (profiler.tomcat/jetty.hidepinpointheader =true) to get.

In most of the use cases, the caller application name is the most valuable, esp. for API statistics (api upgrading/deprecation/ removal). The header name can be configured and the header can be fetched by callee app programmatically.

@emeroad
Copy link
Member

emeroad commented Jan 5, 2022

This header will always be sent regardless of sampling rate and async running in a different thread. The Pinpoint-pAppName header is only sent when the transaction is sampled and is hidden from application (profiler.tomcat/jetty.hidepinpointheader =true) to get.

It is a bug that AsyncContext works in DisableTrace state.

  • This feature has not been implemented yet.

The intended behavior is that AsyncContext should not work in DisableTrace.

In most of the use cases, the caller application name is the most valuable, esp. for API statistics (api upgrading/deprecation/ removal). The header name can be configured and the header can be fetched by callee app programmatically.

How about adding header api to Agent SDK?

Optional<Headers> headers = AgentContext.getHeaders();
if (headers.isPresent()) {
    Header header = headers.getParentApplicationName(); // getHeader("Pinpoint-pAppName"")
    header.getName();
    header.getValue();
}

@yjqg6666
Copy link
Contributor Author

yjqg6666 commented Jan 5, 2022

@emeroad if the transaction is not traced, you could not know who's calling?

yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Jan 5, 2022
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Jan 5, 2022
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Jan 5, 2022
yjqg6666 added a commit to yjqg6666/pinpoint that referenced this issue Jan 5, 2022
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 a pull request may close this issue.

2 participants