APM http context transferred to gRPC context

Kibana version:
7.5.1

Elasticsearch version:
7.5.1

APM Server version:
7.5.1

APM Agent language and version:
any

Is there anything special in your setup?
Working empty Elastic cluster in kubernetes/containers. In setup/testing phase.

Description of the problem including expected versus actual behavior. Please include screenshots (if relevant):

So basically what I'm hoping to get some feedback on is if anyone has transferred the context from http over to grpc (specifically in golang in my case, but i'd be interested in seeing any language).

I had gone through the work of setting up my developers services to transmit to the APM server and had it all working a couple months ago, and then they switched to gRPC communication on the backend. I see there are gRPC libraries for APM agents, but the original request still comes in from a website frontend, and gets converted at our API gateway.

Has anyone done the work of extracting the context from an HTTP request and inserting it into a gRPC context? If so it would save me the time. If not, maybe I'll make a pass at it (I'm a C# dev at heart, not golang, now doing 'devops', but I can maybe squish something together).

Thanks!

I see there are gRPC libraries for APM agents, but the original request still comes in from a website frontend, and gets converted at our API gateway.

Has anyone done the work of extracting the context from an HTTP request and inserting it into a gRPC context?

Our agents will look for gRPC metadata with the keys "traceparent", "elastic-apm-traceparent" (for legacy/backwards compatibility), and "tracestate"; possibly others in the future. The metadata keys are the same as the HTTP header names our agents use. The metadata/header value formats are also exactly the same. So, all you would need to do is ensure the API Gateway translates those HTTP headers to gRPC metadata.

How you do that is going to be very specific to the API Gateway. For example, if you're using grpc-gateway, see "Mapping from HTTP request headers to gRPC client metadata" at https://grpc-ecosystem.github.io/grpc-gateway/docs/customizingyourgateway.html

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