feat(core): incorporate gateway metadata to traces (#39703)