pinpoint icon indicating copy to clipboard operation
pinpoint copied to clipboard

Can I add some user information to the http headers?

Open aalinyu opened this issue 2 years ago • 5 comments

Hi, I want to add an extra header in the http header to get the HTTP request, for example, HttpGet.setHeader (PINPOINT_TX_ID, "TomcatA ^ TIME ^ 1") HttpGet.setHeader (PINPOINT_SPAN_ID, "20") HttpGet.setHeader (PINPOINT_PARENT_SPAN_ID, "10") HttpGet.setHeader (PINPOINT_REQUEST_TAG, "0") // This is what I added

Will I be able to add it? If so, how can I get it? thank you very much

When we user app grayscale publishing , the custom http header is very usefull for app request routing.

aalinyu avatar Aug 17 '22 07:08 aalinyu

@emeroad @jaehong-kim @yjqg6666

aalinyu avatar Aug 17 '22 07:08 aalinyu

@aalinyu You may reference PR ~~#8167~~ #8217 which would introduce huge changes, it's quite similar. And you need maintain your own version of pinpoint? Add your own header via AOP SDK ?

yjqg6666 avatar Aug 17 '22 07:08 yjqg6666

@yjqg6666 When I need the app instance add the custom header, I want my own header add by pinpoint Agent automatic. My own header can pass through the pinpoint transmission system in the whole link, like the txid. How can I add the header ?

My pinpoint version is 2.1.0

aalinyu avatar Aug 17 '22 08:08 aalinyu

I referenced a wrong PR, you may reference request uuid feature #8217 (esp. files tab).

yjqg6666 avatar Aug 17 '22 09:08 yjqg6666

@yjqg6666 I have another question? how to get my custom header in business App, there is on SDK for the java app to get the custom header.

aalinyu avatar Aug 22 '22 09:08 aalinyu