apm-agent-dotnet icon indicating copy to clipboard operation
apm-agent-dotnet copied to clipboard

Additional headers

Open kodigo35 opened this issue 4 years ago • 2 comments

Hello,

i am using apmserver throught api gateway which requires apikey header to be sent.

is there a way to add additionnal headers to requests sent via payloadsender ?

regards

kodigo35 avatar Feb 02 '21 12:02 kodigo35

Hi @kodigo35,

we have an ApiKey config, which adds a header (code here).

But I'm not sure this config would help you. That setting is designed for another use case - at least that's my impression based on your issue description.

is there a way to add additionnal headers to requests sent via payloadsender ?

No, at this point we don't expose anything where you could do this - I think the only way to do this now is to fully replace the payloadsender, but that sounds like an overkill.

gregkalapos avatar Feb 02 '21 12:02 gregkalapos

hi @gregkalapos

Thanks for your answser.

Your example with apikey is good, need the same thing except that the header name is not the same.

In production environment, apmserver is rarely directly reachable by backend applications.

For the moment, i'm dealing with a custom appsetting for adding extra headers.

May be some kind of preSend events to override or subscribe could do the trick

kodigo35 avatar Feb 02 '21 15:02 kodigo35