跳转至

http.frm.otlp

OTLP/HTTP 导出编码面(P7-E;protobuf 经 std/pb)

形态纪律(P5-E 组合层裁定):本模块只做编码(ExportTraceServiceRequest 单 span 形,proto3 零值省略);发送 = 组合层经 http.client(装配层接线, 门面不持 socket)。批量/压缩/gzip 列志向(v1 单 span/请求)。 线形(proto 字段号钉形,opentelemetry/proto/trace/v1): ExportTraceServiceRequest{ resource_spans=1 } ResourceSpans{ scope_spans=2 }(resource 属性 v1 省略) ScopeSpans{ scope=1{ name=1 } spans=2 } Span{ trace_id=1(bytes16) span_id=2(bytes8) parent_span_id=3(bytes8, psid 空串省略) name=4(string) start_time_unix_nano=7(fixed64) end_time_unix_nano=8(fixed64) } scr 布局(调用方提供,容量 ≥ 256 + name.len2): [0..16) tid / [16..24) sid / [24..32) psid / [48..) span → ss → rs 顺序 内嵌(目标区恒在源区之后,自嵌套安全)。 【Ctron 算术纪律】无位运算算符(2026-09-25 在册):hex 经查表,tag = field8+wire,长度 varint 经 std/pb。

pub struct

struct OtelSpan

Field Type
tid Str
sid Str
psid Str
name Str
t0 I64
t1 I64

pub fn

Signature Returns Description
ot_hex_to_lane(dst: &[I64], dcap: I64, off: I64, s: Str) I64 hex 串 → 字节落 lane 指定偏移(返回字节数;非法/越界 -1)
otlp_span_request_f(buf: &[I64], cap: I64, scr: &[I64], scap: I64, tid: Str, sid: Str, psid: Str, name: Str, t0: I64, t1: I64) I64 字段形入口(消费方免建 struct 字面量——Str 成员 struct 字面量在消费方
main 触发「StructLit 非值类型」,2026-09-25 在册,divergences)
otlp_span_request(buf: &[I64], cap: I64, scr: &[I64], scap: I64, tid: Str, sid: Str, psid: Str, name: Str, t0: I64, t1: I64) I64 ExportTraceServiceRequest 全嵌套 → buf(返回长度;-1 越界/坏 id)