Http request header capture (opentelemetry)

Hi,

I would like to know if it’s possible to trace the HTTP headers sent to a web service behind the Tyk Gateway, and if so, how to do it. For my proof of concept, I am using Tyk 5.9.1, OpenTelemetry, and Jaeger 2.14.0.

Thank you in advance,

Kind regards,

Pascal

Hi @Pascal,

Thank you for your post.

Yes, it is possible to do this; however, this information is not captured by default so you would need, e.g, a custom plugin to read the headers from the request and record them as span attributes for instance.

Please see relevant documentation:

Hope this helps. Please let us know how you get on.

Best regards,

Hi @Ubong , thanks for the links. I think this help :slight_smile:

If I want to add f.e an HTTP Header into the access_log I have also to do it with the plugin?

Hi @Pascal ,

access_logs is largely unrelated to OpenTelemetry.
When enabled, the Gateway includes individual API request details in its logs, which are written directly to stdout/stderr . This is purely a logging feature and does not affect OpenTelemetry tracing or metrics.

Additionally, access_logs cannot be modified or intercepted by plugins, at this time.