Development
按 W3C Trace Context ABNF 校验 traceparent(版本/16 字节 trace-id/8 字节 parent-id/1 字节 trace-flags,全零与 ff 版本拒绝、大写告警)、tracestate(≤32 个成员、simple 与 tenant@system 键、重复键告警)、baggage(百分号编码值 + 不透明属性);校验 OTLP 导出 Content-Type 与 gRPC grpc-trace-context-bin 的 25 字节二进制上下文往返一致性;并对两个独立 traceparent 做关联 round-trip(trace-id 稳定性 + 随机子 span-id 冲突检查),输出可直接重发的规范化头。
用三种语言从你的代码中调用此工具。
curl -X POST 'https://api.elysiatools.com/zh/api/tools/opentelemetry-w3c-traceparent-tracestate-baggage-and-otlp-protobuf-headers-propagation-validator' \
-H 'Content-Type: application/json' \
-d '{"traceparent":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","tracestate":"congo=t61rcWkgMzE,rojo=00f067aa0ba902b7","baggage":"userId=alice;serverNode=DF%2028;isProduction=false","transport":"grpc","contentType":"application/x-protobuf","grpcTraceContextBin":"S/kvNXezTaajzpKdDg5HNgDwZ6oLqQK3AQ==","secondTraceparent":"00-4bf92f3577b34da6a3ce929d0e0e4736-aabbccddeeff0011-01"}'以 JSON 形式 POST 提交输入参数。文件类型参数需先单独上传。
POST https://api.elysiatools.com/zh/api/tools/opentelemetry-w3c-traceparent-tracestate-baggage-and-otlp-protobuf-headers-propagation-validator| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| traceparent | text | 是 | — |
| tracestate | text | 否 | — |
| baggage | text | 否 | — |
| transport | select | 否 | — |
| contentType | text | 否 | — |
| grpcTraceContextBin | text | 否 | — |
| secondTraceparent | text | 否 | — |
HTML 结果
{
"result": "<div>Processed HTML content</div>",
"error": "Error message (optional)",
"message": "Notification message (optional)",
"metadata": {
"key": "value"
}
}将此工具加入你的 Model Context Protocol 服务,让 AI 智能体可以列出并调用它。
将以下内容加入你的 MCP 客户端配置:
{
"mcpServers": {
"elysiatools-opentelemetry-w3c-traceparent-tracestate-baggage-and-otlp-protobuf-headers-propagation-validator": {
"name": "opentelemetry-w3c-traceparent-tracestate-baggage-and-otlp-protobuf-headers-propagation-validator",
"description": "按 W3C Trace Context ABNF 校验 traceparent(版本/16 字节 trace-id/8 字节 parent-id/1 字节 trace-flags,全零与 ff 版本拒绝、大写告警)、tracestate(≤32 个成员、simple 与 tenant@system 键、重复键告警)、baggage(百分号编码值 + 不透明属性);校验 OTLP 导出 Content-Type 与 gRPC grpc-trace-context-bin 的 25 字节二进制上下文往返一致性;并对两个独立 traceparent 做关联 round-trip(trace-id 稳定性 + 随机子 span-id 冲突检查),输出可直接重发的规范化头。",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=opentelemetry-w3c-traceparent-tracestate-baggage-and-otlp-protobuf-headers-propagation-validator",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}连接到 SSE 端点后,列出已开放的工具:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}通过工具 id 调用,参数由其参数表构建:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "opentelemetry-w3c-traceparent-tracestate-baggage-and-otlp-protobuf-headers-propagation-validator",
"arguments": {
"traceparent": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01",
"tracestate": "congo=t61rcWkgMzE,rojo=00f067aa0ba902b7",
"baggage": "userId=alice;serverNode=DF%2028;isProduction=false",
"transport": "grpc",
"contentType": "application/x-protobuf",
"grpcTraceContextBin": "S/kvNXezTaajzpKdDg5HNgDwZ6oLqQK3AQ==",
"secondTraceparent": "00-4bf92f3577b34da6a3ce929d0e0e4736-aabbccddeeff0011-01"
}
}
}有问题或反馈?请联系 [email protected]