How can I access headers or custom headers in APM?


I created some custom headers and trying toget value from value. But it returns me an empty value:

context.request.headers.correlationId : "9e27f9d3-b105-470d-9efb-4cede63ae3d6"

Kibana version: 6.8.1

Elasticsearch version: 6.8.1

APM Server version: apm-server-6.8.1

APM Agent language and version: C# ,6.8.1

Browser version: chrome last

Hi @Yusuf_Karatoprak

I remember we started discussing this previously :slight_smile:

Could you tell me what you would like to achieve?

We automatically place the correlation id into an HTTP header, and the name of this header is elastic-apm-traceparent. By default this should make tracing across services work out of the box.

Now, if you use something where this does not work, because it’s an unsupported technology, then we have an API for that.

Unfortunately that’s all I can say now, but let’s follow up if your question is not answered. If I get more context hopefully I’ll be able to give a more useful answer.

Hi @GregKalapos , yes I read your response for my question. Your apm solution is awesome. I want to tell to you my issue with sample. First sample is working second is not working Why? : "00b684caebec44812a0776ebb5ededa1" (working)
context.request.headers.correlationid : "701f904f-dc04-484e-a2e9-2483c3d586bf" (notworking)

@Yusuf_Karatoprak, how does this work?


Is this some custom property you created? I assume this reads HTTP headers, right? If so, what is the name of the header that this reads? If it's correlationid (as I'd assume that it matches the name of the property) then that is the reason why it does not work - our correlation id is stored in the HTTP header with name elastic-apm-traceparent (but keep in mind this will change in the future).

Unfortunately, it doesn't work . "context.request.headers.correlationid"

What I meant is: what does context.request.headers.correlationid do? Is it a C# property as described above?

I get that it does not work as you intended it to work, I just try to figure out how is it implemented.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.