SuperAPI AI 工具集

nemo-relay-export-openinference

部署与运维

查看项目

更新于 10-16 02:34

技能介绍

用途:当目标后端期望 OpenInference 语义约定时使用本技能,例如 Arize Phoenix 或其他支持 OpenInference 的 OTLP 后端,用于配置并导出 OpenInference Traces。

主要能力:构建绑定专用的 OpenInferenceConfig,设置 endpoint、transport、服务元数据与 headers,构造并注册 subscriber,运行带插桩的作用域工作,完成后注销、flush 并关闭。支持配置 transport、endpoint、service_name,可选 namespace 与 version,以及 instrumentation scope、headers、resource 属性与 timeout。

语义要点:scope、tool、LLM 的开始输入变为 input.value,结束输出变为 output.value;LLM usage 元数据在提供方返回 usage 时映射 token 计数;LLM span 的 input.value 来自请求内容而非请求头;scope 类型映射为 OpenInference span 类型;孤立 mark 事件仍会导出为零时长 span。

用法:建议先使用 http_binary transport 与 OTLP/HTTP traces endpoint;仅当存在活跃 Tokio 运行时才用 grpc。在应用代码中使用显式配置字段设置 endpoint、headers、resource 属性与服务标识。可通过检查构造日志、collector 流量以及追踪后端中同一 root_uuid 的 span 来验证导出。

排查方向:后端无 span、预期语义属性缺失、scope 类型错误或无活跃 scope、所选绑定或目标对应的 OTLP transport 不正确。

限制:资料未提供具体依赖版本、安装命令与代码示例。相关技能包括 nemo-relay-setup-observability、nemo-relay-export-otel、nemo-relay-typed-wrappers-codecs。