opentelemetry-semantic-conventions

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

OpenTelemetry Semantic Conventions

OpenTelemetry语义规范

Use this skill when you need released semantic convention guidance for naming, attributes, or compliance checks.
If the broader task is manual instrumentation design or review, pair this with
opentelemetry-manual-instrumentation
.
当您需要已发布的命名、属性或合规性检查相关语义规范指导时,可使用本Skill。
如果更广泛的任务是手动工具设计或评审,请将其与
opentelemetry-manual-instrumentation
配合使用。

Workflow

工作流程

  1. Start with released semantic conventions, not model memory.
  • do not load the full semantic convention spec into context
  • use the bundled lookup script to query only the needed released group or attribute
  1. Choose the closest released group before inventing custom keys.
  • identify the boundary type such as
    http
    ,
    db
    ,
    messaging
    ,
    rpc
    ,
    network
    ,
    gen-ai
    , or
    mcp
  • pick one primary group first, then add related groups only when they add needed context
  • see
    references/semconv-selection.md
  1. Query only the released guidance you need.
  • list groups:
    ./scripts/query-otel-semantic-conventions.sh --groups
  • inspect one group:
    ./scripts/query-otel-semantic-conventions.sh http
  • inspect one kind:
    ./scripts/query-otel-semantic-conventions.sh http spans
  • inspect one exact attribute or entry:
    ./scripts/query-otel-semantic-conventions.sh http http.request.method
  • see
    references/otel-semantic-conventions.md
  1. Apply the released naming and attribute rules directly.
  • use required and recommended attributes before optional ones
  • derive semconv-governed span names directly from the released naming rule
  • do not prepend or append protocol labels, hostnames, product names, business hints, or other custom prose to semconv-governed span names
  • if the released naming rule does not provide a low-cardinality target, use the simpler fallback allowed by that convention
  • if no released key exists, use a stable custom namespace and keep values bounded
  1. Return the result with exact source context.
  • include the group name, released version, and source URL from the script output
  • call out any concrete compatibility limitation if the implementation cannot fully match the released guidance
  1. 从已发布的语义规范开始,而非模型记忆。
  • 不要将完整的语义规范规范加载到上下文中
  • 使用捆绑的查询脚本仅查询所需的已发布组或属性
  1. 在创建自定义键之前,选择最接近的已发布组。
  • 确定边界类型,例如
    http
    db
    messaging
    rpc
    network
    gen-ai
    mcp
  • 首先选择一个主组,仅当相关组能提供所需上下文时才添加它们
  • 请参阅
    references/semconv-selection.md
  1. 仅查询您需要的已发布指导内容。
  • 列出所有组:
    ./scripts/query-otel-semantic-conventions.sh --groups
  • 查看单个组:
    ./scripts/query-otel-semantic-conventions.sh http
  • 查看单个类型:
    ./scripts/query-otel-semantic-conventions.sh http spans
  • 查看单个具体属性或条目:
    ./scripts/query-otel-semantic-conventions.sh http http.request.method
  • 请参阅
    references/otel-semantic-conventions.md
  1. 直接应用已发布的命名和属性规则。
  • 优先使用必填和推荐属性,而非可选属性
  • 直接从已发布的命名规则生成受semconv管控的Span名称
  • 不要在受semconv管控的Span名称前或后添加协议标签、主机名、产品名称、业务提示或其他自定义文字
  • 如果已发布的命名规则未提供低基数目标,请使用该规范允许的更简单回退方案
  • 如果不存在已发布的键,请使用稳定的自定义命名空间并限制值的范围
  1. 返回包含准确源上下文的结果。
  • 包含脚本输出中的组名称、已发布版本和源URL
  • 如果实现无法完全匹配已发布的指导内容,请明确指出具体的兼容性限制