Hi,
The APM agent implements an OpenTelemetry bridge so it maps most of the calls to the otel API to "translate" them into calls to APM.
However, using custom context storage with a wrapper is not supported, as the provided context storage will be replaced by the one in the agent.
Can you try doing the same with OpenTelemetry instrumentation agent ? the APM server endpoint supports the OTLP protocol, so if this works this would be a simple alternative. The otel agent is quite similar here and I know that he span/trace IDs are included in the logs that are captured and sent by the agent (I'm not 100% sure they are injected in the MDC though, so the file-based logs might remain identical).