Development
OpenTelemetry 语义约定 v1.20 → v1.27 属性迁移工具
跨 OpenTelemetry 语义约定版本重写 span/log 属性名:http.method → http.request.method、http.status_code → http.response.status_code、http.url → url.full、db.system → db.system.name、messaging.destination → messaging.destination.name 等 25+ 条—支持粘贴 JS/TS/Python/Go/Java/.NET 源码、collector YAML 或 Grafana 仪表盘 JSON,附 OTel Collector 重命名映射、移除/手工拆分警告、逐属性差异统计与未映射属性报告。
html· HTML 结果打开工具
快速开始
用三种语言从你的代码中调用此工具。
cURL
curl -X POST 'https://api.elysiatools.com/zh/api/tools/otel-semantic-convention-migration-tool' \
-H 'Content-Type: application/json' \
-d '{"sourceCode":"const { SpanStatusCode } = require('\''@opentelemetry/api'\'');\nfunction record(span, req, res) {\n span.setAttribute('\''http.method'\'', req.method);\n span.setAttribute('\''http.status_code'\'', res.statusCode);\n span.setAttribute('\''http.url'\'', req.originalUrl);\n span.setAttribute('\''net.peer.name'\'', req.hostname);\n span.setAttribute('\''db.system'\'', '\''postgresql'\'');\n span.setAttribute('\''db.statement'\'', '\''SELECT * FROM users'\'');\n span.setAttribute('\''messaging.destination'\'', '\''orders-queue'\'');\n}","fromVersion":"v1.20.0","toVersion":"v1.27.0","generateCollectorConfig":true,"updateDashboards":true}'