> Source: https://www.ymotongpoo.com/works/otel-specs-ja/semconv/messaging/rocketmq/


# RocketMQに関するセマンティック規約

**ステータス**: [Development][DocumentStatus]

[Apache RocketMQ](https://rocketmq.apache.org/)に関するセマンティック規約は、[メッセージングに関するセマンティック規約](/works/otel-specs-ja/semconv/messaging/)を拡張し、その一部を上書きします。

> [!IMPORTANT]
>
> [この文書のv1.24.0](https://github.com/open-telemetry/semantic-conventions/blob/v1.24.0/docs/messaging/messaging-spans.md)
> 以前のバージョンを使っている既存のメッセージング計装は、次に従うべきです。
>
> * メッセージングセマンティック規約が安定版として宣言されるまで、デフォルトで発行するメッセージング規約のバージョンを変更してはなりません（SHOULD NOT）。
>   規約には、属性、メトリクス名、スパン名、スパン種別、計測単位などが含まれますが、これらに限定されません。
> * 既存のメジャーバージョンにおいて、カテゴリー別の値をカンマ区切りで列挙するリストとして環境変数 `OTEL_SEMCONV_STABILITY_OPT_IN` を導入すべきです（SHOULD）
>   （例: http、databases、messaging）。値の一覧は次のとおりです。
>   * `messaging` - 新しい安定版のメッセージング規約を発行し、それまで計装が発行していた古い実験的なメッセージング規約の発行を停止します。
>   * `messaging/dup` - 古い規約と安定版の規約の両方を発行し、円滑な移行を可能にします。
>   * これらの値がいずれも指定されていない場合のデフォルトの動作は、その計装がそれまで発行していた古い実験的なメッセージング規約のバージョンをそのまま発行し続けることです。
>   * 注記: 両方の値が指定されている場合、`messaging/dup` は `messaging` よりも優先されます。
> * 両方の規約セットを発行し始めてから少なくとも6か月間は、既存のメジャーバージョンを（少なくともセキュリティパッチの適用という形で）維持すべきです（SHOULD）。
> * 次のメジャーバージョンでは、この環境変数を削除すべきです（SHOULD）。
> * `messaging/dup` がリストに含まれる場合、スパン名、スパン種別、および類似の「単一の」値を持つ概念については、新しい安定版の値を発行すべきです（SHOULD）。

## Apache RocketMQスパン

### "Send"スパン（プロデューサー）

<!-- semconv span.messaging.rocketmq.send.producer -->
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/snippet.md.j2 -->
<!-- prettier-ignore-start -->

**Status:** ![Development](https://img.shields.io/badge/-development-blue)

Apache RocketMQに1つ以上のメッセージを送信するプロデューサーを表します。

別個の"Create"スパンが存在せず、"Send"スパンのコンテキストがメッセージの作成コンテキストとしてメッセージに注入される場合に、このスパンを使用します。詳細は
[Producer spans](/works/otel-specs-ja/semconv/messaging/messaging-spans/#producer-spans)を参照してください。

**Span kind** は `PRODUCER` にすべきです（SHOULD）。

**Span status** は[エラーの記録](/works/otel-specs-ja/semconv/general/recording-errors/)の文書に従うべきです（SHOULD）。

**Attributes:**

| Key | Stability | [Requirement Level](/works/otel-specs-ja/semconv/general/attribute-requirement-level/) | Value Type | Description | Example Values |
| --- | --- | --- | --- | --- | --- |
| [`messaging.operation.name`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | メッセージング操作のシステム固有の名前。 | `send`; `publish` |
| [`messaging.rocketmq.namespace`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | RocketMQリソースの名前空間。異なる名前空間のリソースは個別に扱われます。 | `myNamespace` |
| [`messaging.system`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | クライアント計装によって識別されるメッセージングシステム。[1] | `rocketmq` |
| [`error.type`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/error/) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Conditionally Required` メッセージング操作が失敗した場合に限る。 | string | 操作が終了したエラーのクラスを記述します。[2] | `TOPIC_NOT_EXIST`; `SERVICE_NOT_AVAILABLE`; `SYSTEM_BUSY` |
| [`messaging.batch.message_count`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [3] | int | バッチ操作の範囲内で送信、受信、または処理されたメッセージの数。[4] | `0`; `1`; `2` |
| [`messaging.destination.name`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [5] | string | メッセージの宛先名。[6] | `MyTopic` |
| [`messaging.destination.template`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [7] | string | メッセージの宛先名の低カーディナリティな表現。[8] | `/customers/{customerId}` |
| [`messaging.operation.type`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` 該当する場合。 | string | メッセージング操作の種類を識別する文字列。[9] | `send` |
| [`messaging.rocketmq.message.delay_time_level`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [10] | int | 遅延メッセージの遅延時間レベル。メッセージの遅延時間を決定します。 | `3` |
| [`messaging.rocketmq.message.delivery_timestamp`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [11] | int | 遅延メッセージがコンシューマーに配送されることが期待されるタイムスタンプ（ミリ秒）。 | `1665987217045` |
| [`messaging.rocketmq.message.group`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` メッセージ種別がFIFOの場合。 | string | FIFOメッセージにとって必須。同じメッセージグループに属するメッセージは、同じコンシューマーグループ内で常に1つずつ順番に処理されます。 | `myMessageGroup` |
| [`messaging.client.id`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | メッセージを消費または生成するクライアントの一意な識別子。 | `client-5`; `myhost@8742@s8083jm` |
| [`messaging.destination.partition.id`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` 該当する場合。 | string | メッセージが送信または受信されるパーティションの識別子。`messaging.destination.name` の中で一意。 | `1` |
| [`messaging.message.conversation_id`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | メッセージが属する会話を識別する会話ID。文字列として表現される。「correlation ID」と呼ばれることもある。 | `MyConversationId` |
| [`messaging.message.id`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` スパンが単一のメッセージに対する操作を記述する場合。 | string | メッセージングシステムがメッセージの識別子として使用する値。文字列として表現される。 | `452a7c7c7c7048c2f887f61572b18fc2` |
| [`messaging.rocketmq.message.keys`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string[] | メッセージのキー。メッセージIDとは別にメッセージを識別する手段。 | `["keyA", "keyB"]` |
| [`messaging.rocketmq.message.tag`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | トピックとは別のメッセージの二次分類子。 | `tagA` |
| [`messaging.rocketmq.message.type`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | メッセージの種別。 | `normal`; `fifo`; `delay` |
| [`network.peer.address`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/network/) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Recommended` このメッセージングシステムに該当する場合。 | string | 操作が実行されたメッセージング中継ノードのピアアドレス。[12] | `10.1.2.80`; `/tmp/my.sock` |
| [`network.peer.port`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/network/) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Recommended` `network.peer.address` が設定されている場合に限る。 | int | 操作が実行されたメッセージング中継ノードのピアポート。 | `65123` |
| [`server.address`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/server/) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Recommended` | string | 利用可能であればリバースDNSルックアップなしのサーバードメイン名。それ以外の場合はIPアドレスまたはUNIXドメインソケット名。[13] | `example.com`; `10.1.2.80`; `/tmp/my.sock` |
| [`server.port`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/server/) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Recommended` | int | サーバーのポート番号。[14] | `80`; `8080`; `443` |
| [`messaging.message.body.size`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Opt-In` | int | メッセージ本文のバイト数。単一メッセージの操作を記述するスパンにのみ適用可能。[15] | `1439` |
| [`messaging.message.envelope.size`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Opt-In` | int | メッセージ本文とメタデータのバイト数。[16] | `2738` |

**[1] `messaging.system`:** `"rocketmq"` に設定しなければなりません（MUST）。

**[2] `error.type`:** `error.type` は予測可能であるべきであり（SHOULD）、低カーディナリティであるべきです（SHOULD）。

`error.type` に型（例えば例外の型）を設定する場合、そのアーティファクト内でその型を識別する正規のクラス名を使用すべきです（SHOULD）。

記録されたエラー型が、失敗の分類にとって意味を持たないラッパーである場合、計装は代わりに内部のエラーの型を使用してもかまいません（MAY）。
例えばGoでは、`%w` を使って `fmt.Errorf` で作成されたエラーは、ラッパー型が失敗の分類に役立たない場合、ラップを解除してもかまいません（MAY）。

計装は、報告するエラーの一覧を文書化すべきです（SHOULD）。

1つの計装ライブラリ内での `error.type` のカーディナリティは低くあるべきですが（SHOULD）、複数の計装ライブラリやアプリケーションからのデータを集約するテレメトリーの利用者は、追加のフィルターが適用されないクエリ時には `error.type` が高カーディナリティになることを想定しておくべきです。

操作が正常に完了した場合、計装は `error.type` を設定するべきではありません（SHOULD NOT）。

特定のドメインが独自のエラー識別子の集合を定義している場合（HTTPやRPCのステータスコードなど）、次のようにすることが推奨されます（RECOMMENDED）。

- ドメイン固有の属性を使用する
- そのドメイン固有の集合内で定義されているかどうかにかかわらず、すべてのエラーを捉えるように `error.type` を設定する

**[3] `messaging.batch.message_count`:** スパンがメッセージのバッチに対する操作を記述する場合。

**[4] `messaging.batch.message_count`:** 計装は、単一のメッセージを扱うスパンに `messaging.batch.message_count` を設定するべきではありません（SHOULD NOT）。メッセージングクライアントライブラリが同じ操作についてバッチAPIと単一メッセージAPIの両方をサポートする場合、計装はバッチAPIには `messaging.batch.message_count` を使用すべきであり（SHOULD）、単一メッセージAPIには使用するべきではありません（SHOULD NOT）。

**[5] `messaging.destination.name`:** スパンが単一のメッセージに対する操作を記述する場合、またはその値がバッチ内のすべてのメッセージに当てはまる場合。

**[6] `messaging.destination.name`:** ブローカー内の特定のキュー、トピック、その他のエンティティを一意に識別すべきです（SHOULD）。ブローカーにそのような概念がない場合は、ブローカー自体を一意に識別すべきです（SHOULD）。

**[7] `messaging.destination.template`:** 利用可能な場合。宛先名の低カーディナリティが保証されない限り、計装は `messaging.destination.name` をテンプレートとして使用してはなりません（MUST NOT）。

**[8] `messaging.destination.template`:** 宛先名は、テンプレートから構築されることがあります。例えば、ユーザー名や製品IDを含む宛先名などです。この場合の宛先名自体は高カーディナリティですが、その基となるテンプレートは低カーディナリティであり、グルーピングや集計に効果的に利用できます。

**[9] `messaging.operation.type`:** `send` に設定すべきです（SHOULD）。

**[10] `messaging.rocketmq.message.delay_time_level`:** メッセージ種別が遅延であり、配送タイムスタンプが指定されていない場合。

**[11] `messaging.rocketmq.message.delivery_timestamp`:** メッセージ種別が遅延であり、遅延時間レベルが指定されていない場合。

**[12] `network.peer.address`:** 個々のメッセージングシステムに関するセマンティック規約は、`network.peer.*` 属性が適用可能かどうかを文書化すべきです（SHOULD）。
アプリケーションが個々の中継ノードと直接やり取りする場合、ネットワークピアアドレスとポートが重要になります。
メッセージング操作に（再試行などによる）複数のネットワーク呼び出しが含まれる場合、最後に接続したノードのアドレスを使用すべきです（SHOULD）。

**[13] `server.address`:** 利用可能であればリバースDNSルックアップなしのブローカーのサーバードメイン名。それ以外の場合はIPアドレスまたはUNIXドメインソケット名。

**[14] `server.port`:** クライアント側から観測し、かつ中継者を経由して通信している場合、`server.port` は、利用可能であれば、（プロキシなどの）中継者の背後にあるサーバーポートを表すべきです（SHOULD）。

**[15] `messaging.message.body.size`:** これは、圧縮後または圧縮前のいずれのボディサイズも指すことができます。両方のサイズが分かっている場合は、圧縮前のサイズを使用すべきです。

**[16] `messaging.message.envelope.size`:** これは、圧縮後または圧縮前のいずれのサイズも指すことができます。両方のサイズが分かっている場合は、圧縮前のサイズを使用すべきです。

次の属性は、サンプリング判断に重要となりうるため、（いずれかが提供される場合）**スパン作成時点**で提供すべきです（SHOULD）。

* [`messaging.destination.name`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/)
* [`messaging.destination.partition.id`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/)
* [`messaging.destination.template`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/)
* [`messaging.operation.name`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/)
* [`messaging.operation.type`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/)
* [`messaging.system`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/)
* [`server.address`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/server/)
* [`server.port`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/server/)

---

`error.type` には、次のよく知られた値の一覧があります。いずれかが該当する場合はその値を使用しなければならず（MUST）、それ以外の場合は独自の値を使ってもかまいません（MAY）。

| Value | Description | Stability |
| --- | --- | --- |
| `_OTHER` | 計装がカスタム値を定義していない場合に使用されるフォールバックのエラー値。 | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |

---

`messaging.operation.type` には、次のよく知られた値の一覧があります。いずれかが該当する場合はその値を使用しなければならず（MUST）、それ以外の場合は独自の値を使ってもかまいません（MAY）。

| Value | Description | Stability |
| --- | --- | --- |
| `create` | メッセージが作成されます。"Create"スパンは常に単一のメッセージを指し、バッチ送信シナリオにおいてメッセージに一意な作成コンテキストを提供するために使用されます。 | ![Development](https://img.shields.io/badge/-development-blue) |
| `process` | 1つ以上のメッセージがコンシューマーによって処理されます。 | ![Development](https://img.shields.io/badge/-development-blue) |
| `receive` | 1つ以上のメッセージがコンシューマーによって要求されます。この操作はpullベースのシナリオを指し、コンシューマーがメッセージングSDKのメソッドを明示的に呼び出してメッセージを受信します。 | ![Development](https://img.shields.io/badge/-development-blue) |
| `send` | 1つ以上のメッセージが中継者への送信のために提供されます。単一のメッセージが送信される場合、"Send"スパンのコンテキストを作成コンテキストとして使用できるため、"Create"スパンを作成する必要はありません。 | ![Development](https://img.shields.io/badge/-development-blue) |
| `settle` | 1つ以上のメッセージが決着（settle）されます。 | ![Development](https://img.shields.io/badge/-development-blue) |

---

`messaging.rocketmq.message.type` には、次のよく知られた値の一覧があります。いずれかが該当する場合はその値を使用しなければならず（MUST）、それ以外の場合は独自の値を使ってもかまいません（MAY）。

| Value | Description | Stability |
| --- | --- | --- |
| `delay` | 遅延メッセージ | ![Development](https://img.shields.io/badge/-development-blue) |
| `fifo` | FIFOメッセージ | ![Development](https://img.shields.io/badge/-development-blue) |
| `normal` | 通常メッセージ | ![Development](https://img.shields.io/badge/-development-blue) |
| `transaction` | トランザクションメッセージ | ![Development](https://img.shields.io/badge/-development-blue) |

---

`messaging.system` には、次のよく知られた値の一覧があります。いずれかが該当する場合はその値を使用しなければならず（MUST）、それ以外の場合は独自の値を使ってもかまいません（MAY）。

| Value | Description | Stability |
| --- | --- | --- |
| `activemq` | Apache ActiveMQ | ![Development](https://img.shields.io/badge/-development-blue) |
| `aws.sns` | Amazon Simple Notification Service（SNS） | ![Development](https://img.shields.io/badge/-development-blue) |
| `aws_sqs` | Amazon Simple Queue Service（SQS） | ![Development](https://img.shields.io/badge/-development-blue) |
| `eventgrid` | Azure Event Grid | ![Development](https://img.shields.io/badge/-development-blue) |
| `eventhubs` | Azure Event Hubs | ![Development](https://img.shields.io/badge/-development-blue) |
| `gcp_pubsub` | Google Cloud Pub/Sub | ![Development](https://img.shields.io/badge/-development-blue) |
| `jms` | Java Message Service | ![Development](https://img.shields.io/badge/-development-blue) |
| `kafka` | Apache Kafka | ![Development](https://img.shields.io/badge/-development-blue) |
| `pulsar` | Apache Pulsar | ![Development](https://img.shields.io/badge/-development-blue) |
| `rabbitmq` | RabbitMQ | ![Development](https://img.shields.io/badge/-development-blue) |
| `rocketmq` | Apache RocketMQ | ![Development](https://img.shields.io/badge/-development-blue) |
| `servicebus` | Azure Service Bus | ![Development](https://img.shields.io/badge/-development-blue) |

<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
<!-- endsemconv -->

### "Receive"スパン

<!-- semconv span.messaging.rocketmq.receive.client -->
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/snippet.md.j2 -->
<!-- prettier-ignore-start -->

**Status:** ![Development](https://img.shields.io/badge/-development-blue)

Apache RocketMQから1つ以上のメッセージを受信するコンシューマー（pullベース）を表します。

"Receive"スパンは、コンシューマーがメッセージングSDKのメソッドを明示的に呼び出してメッセージを受信するpullベースのシナリオについて作成されます。詳細は
[Consumer spans](/works/otel-specs-ja/semconv/messaging/messaging-spans/#consumer-spans)を参照してください。

**Span kind** は `CLIENT` にすべきです（SHOULD）。

**Span status** は[エラーの記録](/works/otel-specs-ja/semconv/general/recording-errors/)の文書に従うべきです（SHOULD）。

**Attributes:**

| Key | Stability | [Requirement Level](/works/otel-specs-ja/semconv/general/attribute-requirement-level/) | Value Type | Description | Example Values |
| --- | --- | --- | --- | --- | --- |
| [`messaging.consumer.group.name`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | RocketMQの[コンシューマーグループ名](https://rocketmq.apache.org/docs/domainModel/08consumergroup/)。 | `my-group`; `indexer` |
| [`messaging.operation.name`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | メッセージング操作のシステム固有の名前。 | `receive`; `poll` |
| [`messaging.rocketmq.namespace`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | RocketMQリソースの名前空間。異なる名前空間のリソースは個別に扱われます。 | `myNamespace` |
| [`messaging.system`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | クライアント計装によって識別されるメッセージングシステム。[1] | `rocketmq` |
| [`error.type`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/error/) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Conditionally Required` メッセージング操作が失敗した場合に限る。 | string | 操作が終了したエラーのクラスを記述します。[2] | `TOPIC_NOT_EXIST`; `SERVICE_NOT_AVAILABLE`; `SYSTEM_BUSY` |
| [`messaging.batch.message_count`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [3] | int | バッチ操作の範囲内で送信、受信、または処理されたメッセージの数。[4] | `0`; `1`; `2` |
| [`messaging.destination.name`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [5] | string | メッセージの宛先名。[6] | `MyTopic` |
| [`messaging.destination.template`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [7] | string | メッセージの宛先名の低カーディナリティな表現。[8] | `/customers/{customerId}` |
| [`messaging.operation.type`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` 該当する場合。 | string | メッセージング操作の種類を識別する文字列。[9] | `receive` |
| [`messaging.rocketmq.message.group`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` メッセージ種別がFIFOの場合。 | string | FIFOメッセージにとって必須。同じメッセージグループに属するメッセージは、同じコンシューマーグループ内で常に1つずつ順番に処理されます。 | `myMessageGroup` |
| [`messaging.client.id`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | メッセージを消費または生成するクライアントの一意な識別子。 | `client-5`; `myhost@8742@s8083jm` |
| [`messaging.destination.partition.id`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` 該当する場合。 | string | メッセージが送信または受信されるパーティションの識別子。`messaging.destination.name` の中で一意。 | `1` |
| [`messaging.message.conversation_id`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | メッセージが属する会話を識別する会話ID。文字列として表現される。「correlation ID」と呼ばれることもある。 | `MyConversationId` |
| [`messaging.message.id`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` スパンが単一のメッセージに対する操作を記述する場合。 | string | メッセージングシステムがメッセージの識別子として使用する値。文字列として表現される。 | `452a7c7c7c7048c2f887f61572b18fc2` |
| [`messaging.rocketmq.consumption_model`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | メッセージ消費のモデル。コンシューマースパンにのみ適用されます。 | `clustering`; `broadcasting` |
| [`messaging.rocketmq.message.keys`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string[] | メッセージのキー。メッセージIDとは別にメッセージを識別する手段。 | `["keyA", "keyB"]` |
| [`messaging.rocketmq.message.tag`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | トピックとは別のメッセージの二次分類子。 | `tagA` |
| [`messaging.rocketmq.message.type`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | メッセージの種別。 | `normal`; `fifo`; `delay` |
| [`network.peer.address`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/network/) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Recommended` このメッセージングシステムに該当する場合。 | string | 操作が実行されたメッセージング中継ノードのピアアドレス。[10] | `10.1.2.80`; `/tmp/my.sock` |
| [`network.peer.port`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/network/) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Recommended` `network.peer.address` が設定されている場合に限る。 | int | 操作が実行されたメッセージング中継ノードのピアポート。 | `65123` |
| [`server.address`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/server/) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Recommended` | string | 利用可能であればリバースDNSルックアップなしのサーバードメイン名。それ以外の場合はIPアドレスまたはUNIXドメインソケット名。[11] | `example.com`; `10.1.2.80`; `/tmp/my.sock` |
| [`server.port`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/server/) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Recommended` | int | サーバーのポート番号。[12] | `80`; `8080`; `443` |
| [`messaging.message.body.size`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Opt-In` | int | メッセージ本文のバイト数。単一メッセージの操作を記述するスパンにのみ適用可能。[13] | `1439` |
| [`messaging.message.envelope.size`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Opt-In` | int | メッセージ本文とメタデータのバイト数。[14] | `2738` |

**[1] `messaging.system`:** `"rocketmq"` に設定しなければなりません（MUST）。

**[2] `error.type`:** `error.type` は予測可能であるべきであり（SHOULD）、低カーディナリティであるべきです（SHOULD）。

`error.type` に型（例えば例外の型）を設定する場合、そのアーティファクト内でその型を識別する正規のクラス名を使用すべきです（SHOULD）。

記録されたエラー型が、失敗の分類にとって意味を持たないラッパーである場合、計装は代わりに内部のエラーの型を使用してもかまいません（MAY）。
例えばGoでは、`%w` を使って `fmt.Errorf` で作成されたエラーは、ラッパー型が失敗の分類に役立たない場合、ラップを解除してもかまいません（MAY）。

計装は、報告するエラーの一覧を文書化すべきです（SHOULD）。

1つの計装ライブラリ内での `error.type` のカーディナリティは低くあるべきですが（SHOULD）、複数の計装ライブラリやアプリケーションからのデータを集約するテレメトリーの利用者は、追加のフィルターが適用されないクエリ時には `error.type` が高カーディナリティになることを想定しておくべきです。

操作が正常に完了した場合、計装は `error.type` を設定するべきではありません（SHOULD NOT）。

特定のドメインが独自のエラー識別子の集合を定義している場合（HTTPやRPCのステータスコードなど）、次のようにすることが推奨されます（RECOMMENDED）。

- ドメイン固有の属性を使用する
- そのドメイン固有の集合内で定義されているかどうかにかかわらず、すべてのエラーを捉えるように `error.type` を設定する

**[3] `messaging.batch.message_count`:** スパンがメッセージのバッチに対する操作を記述する場合。

**[4] `messaging.batch.message_count`:** 計装は、単一のメッセージを扱うスパンに `messaging.batch.message_count` を設定するべきではありません（SHOULD NOT）。メッセージングクライアントライブラリが同じ操作についてバッチAPIと単一メッセージAPIの両方をサポートする場合、計装はバッチAPIには `messaging.batch.message_count` を使用すべきであり（SHOULD）、単一メッセージAPIには使用するべきではありません（SHOULD NOT）。

**[5] `messaging.destination.name`:** スパンが単一のメッセージに対する操作を記述する場合、またはその値がバッチ内のすべてのメッセージに当てはまる場合。

**[6] `messaging.destination.name`:** ブローカー内の特定のキュー、トピック、その他のエンティティを一意に識別すべきです（SHOULD）。ブローカーにそのような概念がない場合は、ブローカー自体を一意に識別すべきです（SHOULD）。

**[7] `messaging.destination.template`:** 利用可能な場合。宛先名の低カーディナリティが保証されない限り、計装は `messaging.destination.name` をテンプレートとして使用してはなりません（MUST NOT）。

**[8] `messaging.destination.template`:** 宛先名は、テンプレートから構築されることがあります。例えば、ユーザー名や製品IDを含む宛先名などです。この場合の宛先名自体は高カーディナリティですが、その基となるテンプレートは低カーディナリティであり、グルーピングや集計に効果的に利用できます。

**[9] `messaging.operation.type`:** `receive` に設定すべきです（SHOULD）。

**[10] `network.peer.address`:** 個々のメッセージングシステムに関するセマンティック規約は、`network.peer.*` 属性が適用可能かどうかを文書化すべきです（SHOULD）。
アプリケーションが個々の中継ノードと直接やり取りする場合、ネットワークピアアドレスとポートが重要になります。
メッセージング操作に（再試行などによる）複数のネットワーク呼び出しが含まれる場合、最後に接続したノードのアドレスを使用すべきです（SHOULD）。

**[11] `server.address`:** 利用可能であればリバースDNSルックアップなしのブローカーのサーバードメイン名。それ以外の場合はIPアドレスまたはUNIXドメインソケット名。

**[12] `server.port`:** クライアント側から観測し、かつ中継者を経由して通信している場合、`server.port` は、利用可能であれば、（プロキシなどの）中継者の背後にあるサーバーポートを表すべきです（SHOULD）。

**[13] `messaging.message.body.size`:** これは、圧縮後または圧縮前のいずれのボディサイズも指すことができます。両方のサイズが分かっている場合は、圧縮前のサイズを使用すべきです。

**[14] `messaging.message.envelope.size`:** これは、圧縮後または圧縮前のいずれのサイズも指すことができます。両方のサイズが分かっている場合は、圧縮前のサイズを使用すべきです。

次の属性は、サンプリング判断に重要となりうるため、（いずれかが提供される場合）**スパン作成時点**で提供すべきです（SHOULD）。

* [`messaging.consumer.group.name`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/)
* [`messaging.destination.name`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/)
* [`messaging.destination.partition.id`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/)
* [`messaging.destination.template`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/)
* [`messaging.operation.name`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/)
* [`messaging.operation.type`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/)
* [`messaging.system`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/)
* [`server.address`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/server/)
* [`server.port`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/server/)

---

`error.type` には、次のよく知られた値の一覧があります。いずれかが該当する場合はその値を使用しなければならず（MUST）、それ以外の場合は独自の値を使ってもかまいません（MAY）。

| Value | Description | Stability |
| --- | --- | --- |
| `_OTHER` | 計装がカスタム値を定義していない場合に使用されるフォールバックのエラー値。 | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |

---

`messaging.operation.type` には、次のよく知られた値の一覧があります。いずれかが該当する場合はその値を使用しなければならず（MUST）、それ以外の場合は独自の値を使ってもかまいません（MAY）。

| Value | Description | Stability |
| --- | --- | --- |
| `create` | メッセージが作成されます。"Create"スパンは常に単一のメッセージを指し、バッチ送信シナリオにおいてメッセージに一意な作成コンテキストを提供するために使用されます。 | ![Development](https://img.shields.io/badge/-development-blue) |
| `process` | 1つ以上のメッセージがコンシューマーによって処理されます。 | ![Development](https://img.shields.io/badge/-development-blue) |
| `receive` | 1つ以上のメッセージがコンシューマーによって要求されます。この操作はpullベースのシナリオを指し、コンシューマーがメッセージングSDKのメソッドを明示的に呼び出してメッセージを受信します。 | ![Development](https://img.shields.io/badge/-development-blue) |
| `send` | 1つ以上のメッセージが中継者への送信のために提供されます。単一のメッセージが送信される場合、"Send"スパンのコンテキストを作成コンテキストとして使用できるため、"Create"スパンを作成する必要はありません。 | ![Development](https://img.shields.io/badge/-development-blue) |
| `settle` | 1つ以上のメッセージが決着（settle）されます。 | ![Development](https://img.shields.io/badge/-development-blue) |

---

`messaging.rocketmq.consumption_model` には、次のよく知られた値の一覧があります。いずれかが該当する場合はその値を使用しなければならず（MUST）、それ以外の場合は独自の値を使ってもかまいません（MAY）。

| Value | Description | Stability |
| --- | --- | --- |
| `broadcasting` | ブロードキャスト型の消費モデル | ![Development](https://img.shields.io/badge/-development-blue) |
| `clustering` | クラスタリング型の消費モデル | ![Development](https://img.shields.io/badge/-development-blue) |

---

`messaging.rocketmq.message.type` には、次のよく知られた値の一覧があります。いずれかが該当する場合はその値を使用しなければならず（MUST）、それ以外の場合は独自の値を使ってもかまいません（MAY）。

| Value | Description | Stability |
| --- | --- | --- |
| `delay` | 遅延メッセージ | ![Development](https://img.shields.io/badge/-development-blue) |
| `fifo` | FIFOメッセージ | ![Development](https://img.shields.io/badge/-development-blue) |
| `normal` | 通常メッセージ | ![Development](https://img.shields.io/badge/-development-blue) |
| `transaction` | トランザクションメッセージ | ![Development](https://img.shields.io/badge/-development-blue) |

---

`messaging.system` には、次のよく知られた値の一覧があります。いずれかが該当する場合はその値を使用しなければならず（MUST）、それ以外の場合は独自の値を使ってもかまいません（MAY）。

| Value | Description | Stability |
| --- | --- | --- |
| `activemq` | Apache ActiveMQ | ![Development](https://img.shields.io/badge/-development-blue) |
| `aws.sns` | Amazon Simple Notification Service（SNS） | ![Development](https://img.shields.io/badge/-development-blue) |
| `aws_sqs` | Amazon Simple Queue Service（SQS） | ![Development](https://img.shields.io/badge/-development-blue) |
| `eventgrid` | Azure Event Grid | ![Development](https://img.shields.io/badge/-development-blue) |
| `eventhubs` | Azure Event Hubs | ![Development](https://img.shields.io/badge/-development-blue) |
| `gcp_pubsub` | Google Cloud Pub/Sub | ![Development](https://img.shields.io/badge/-development-blue) |
| `jms` | Java Message Service | ![Development](https://img.shields.io/badge/-development-blue) |
| `kafka` | Apache Kafka | ![Development](https://img.shields.io/badge/-development-blue) |
| `pulsar` | Apache Pulsar | ![Development](https://img.shields.io/badge/-development-blue) |
| `rabbitmq` | RabbitMQ | ![Development](https://img.shields.io/badge/-development-blue) |
| `rocketmq` | Apache RocketMQ | ![Development](https://img.shields.io/badge/-development-blue) |
| `servicebus` | Azure Service Bus | ![Development](https://img.shields.io/badge/-development-blue) |

<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
<!-- endsemconv -->

### "Process"スパン

<!-- semconv span.messaging.rocketmq.process.consumer -->
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/snippet.md.j2 -->
<!-- prettier-ignore-start -->

**Status:** ![Development](https://img.shields.io/badge/-development-blue)

Apache RocketMQから1つ以上のメッセージを処理するコンシューマー（push型）を表します。

"Process"スパンは、コールバックやハンドラーを通じてメッセージがアプリケーションに渡されるpushベースのシナリオについて作成されます。詳細は
[Consumer spans](/works/otel-specs-ja/semconv/messaging/messaging-spans/#consumer-spans)を参照してください。

単一メッセージのシナリオに限り、メッセージの作成コンテキストが親として使用される場合については、
[Message creation context as parent of "Process" span](/works/otel-specs-ja/semconv/messaging/messaging-spans/#message-creation-context-as-parent-of-process-span)を参照してください。

**Span kind** は `CONSUMER` にすべきです（SHOULD）。

**Span status** は[エラーの記録](/works/otel-specs-ja/semconv/general/recording-errors/)の文書に従うべきです（SHOULD）。

**Attributes:**

| Key | Stability | [Requirement Level](/works/otel-specs-ja/semconv/general/attribute-requirement-level/) | Value Type | Description | Example Values |
| --- | --- | --- | --- | --- | --- |
| [`messaging.consumer.group.name`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | RocketMQの[コンシューマーグループ名](https://rocketmq.apache.org/docs/domainModel/08consumergroup/)。 | `my-group`; `indexer` |
| [`messaging.operation.name`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | メッセージング操作のシステム固有の名前。 | `process`; `consume` |
| [`messaging.rocketmq.namespace`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | RocketMQリソースの名前空間。異なる名前空間のリソースは個別に扱われます。 | `myNamespace` |
| [`messaging.system`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | クライアント計装によって識別されるメッセージングシステム。[1] | `rocketmq` |
| [`error.type`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/error/) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Conditionally Required` メッセージング操作が失敗した場合に限る。 | string | 操作が終了したエラーのクラスを記述します。[2] | `TOPIC_NOT_EXIST`; `SERVICE_NOT_AVAILABLE`; `SYSTEM_BUSY` |
| [`messaging.batch.message_count`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [3] | int | バッチ操作の範囲内で送信、受信、または処理されたメッセージの数。[4] | `0`; `1`; `2` |
| [`messaging.destination.name`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [5] | string | メッセージの宛先名。[6] | `MyTopic` |
| [`messaging.destination.template`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [7] | string | メッセージの宛先名の低カーディナリティな表現。[8] | `/customers/{customerId}` |
| [`messaging.operation.type`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` 該当する場合。 | string | メッセージング操作の種類を識別する文字列。[9] | `process` |
| [`messaging.rocketmq.message.group`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` メッセージ種別がFIFOの場合。 | string | FIFOメッセージにとって必須。同じメッセージグループに属するメッセージは、同じコンシューマーグループ内で常に1つずつ順番に処理されます。 | `myMessageGroup` |
| [`messaging.client.id`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | メッセージを消費または生成するクライアントの一意な識別子。 | `client-5`; `myhost@8742@s8083jm` |
| [`messaging.destination.partition.id`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` 該当する場合。 | string | メッセージが送信または受信されるパーティションの識別子。`messaging.destination.name` の中で一意。 | `1` |
| [`messaging.message.conversation_id`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | メッセージが属する会話を識別する会話ID。文字列として表現される。「correlation ID」と呼ばれることもある。 | `MyConversationId` |
| [`messaging.message.id`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` スパンが単一のメッセージに対する操作を記述する場合。 | string | メッセージングシステムがメッセージの識別子として使用する値。文字列として表現される。 | `452a7c7c7c7048c2f887f61572b18fc2` |
| [`messaging.rocketmq.consumption_model`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | メッセージ消費のモデル。コンシューマースパンにのみ適用されます。 | `clustering`; `broadcasting` |
| [`messaging.rocketmq.message.keys`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string[] | メッセージのキー。メッセージIDとは別にメッセージを識別する手段。 | `["keyA", "keyB"]` |
| [`messaging.rocketmq.message.tag`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | トピックとは別のメッセージの二次分類子。 | `tagA` |
| [`messaging.rocketmq.message.type`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | メッセージの種別。 | `normal`; `fifo`; `delay` |
| [`server.address`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/server/) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Recommended` | string | 利用可能であればリバースDNSルックアップなしのサーバードメイン名。それ以外の場合はIPアドレスまたはUNIXドメインソケット名。[10] | `example.com`; `10.1.2.80`; `/tmp/my.sock` |
| [`server.port`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/server/) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Recommended` | int | サーバーのポート番号。[11] | `80`; `8080`; `443` |
| [`messaging.message.body.size`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Opt-In` | int | メッセージ本文のバイト数。単一メッセージの操作を記述するスパンにのみ適用可能。[12] | `1439` |
| [`messaging.message.envelope.size`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Opt-In` | int | メッセージ本文とメタデータのバイト数。[13] | `2738` |

**[1] `messaging.system`:** `"rocketmq"` に設定しなければなりません（MUST）。

**[2] `error.type`:** `error.type` は予測可能であるべきであり（SHOULD）、低カーディナリティであるべきです（SHOULD）。

`error.type` に型（例えば例外の型）を設定する場合、そのアーティファクト内でその型を識別する正規のクラス名を使用すべきです（SHOULD）。

記録されたエラー型が、失敗の分類にとって意味を持たないラッパーである場合、計装は代わりに内部のエラーの型を使用してもかまいません（MAY）。
例えばGoでは、`%w` を使って `fmt.Errorf` で作成されたエラーは、ラッパー型が失敗の分類に役立たない場合、ラップを解除してもかまいません（MAY）。

計装は、報告するエラーの一覧を文書化すべきです（SHOULD）。

1つの計装ライブラリ内での `error.type` のカーディナリティは低くあるべきですが（SHOULD）、複数の計装ライブラリやアプリケーションからのデータを集約するテレメトリーの利用者は、追加のフィルターが適用されないクエリ時には `error.type` が高カーディナリティになることを想定しておくべきです。

操作が正常に完了した場合、計装は `error.type` を設定するべきではありません（SHOULD NOT）。

特定のドメインが独自のエラー識別子の集合を定義している場合（HTTPやRPCのステータスコードなど）、次のようにすることが推奨されます（RECOMMENDED）。

- ドメイン固有の属性を使用する
- そのドメイン固有の集合内で定義されているかどうかにかかわらず、すべてのエラーを捉えるように `error.type` を設定する

**[3] `messaging.batch.message_count`:** スパンがメッセージのバッチに対する操作を記述する場合。

**[4] `messaging.batch.message_count`:** 計装は、単一のメッセージを扱うスパンに `messaging.batch.message_count` を設定するべきではありません（SHOULD NOT）。メッセージングクライアントライブラリが同じ操作についてバッチAPIと単一メッセージAPIの両方をサポートする場合、計装はバッチAPIには `messaging.batch.message_count` を使用すべきであり（SHOULD）、単一メッセージAPIには使用するべきではありません（SHOULD NOT）。

**[5] `messaging.destination.name`:** スパンが単一のメッセージに対する操作を記述する場合、またはその値がバッチ内のすべてのメッセージに当てはまる場合。

**[6] `messaging.destination.name`:** ブローカー内の特定のキュー、トピック、その他のエンティティを一意に識別すべきです（SHOULD）。ブローカーにそのような概念がない場合は、ブローカー自体を一意に識別すべきです（SHOULD）。

**[7] `messaging.destination.template`:** 利用可能な場合。宛先名の低カーディナリティが保証されない限り、計装は `messaging.destination.name` をテンプレートとして使用してはなりません（MUST NOT）。

**[8] `messaging.destination.template`:** 宛先名は、テンプレートから構築されることがあります。例えば、ユーザー名や製品IDを含む宛先名などです。この場合の宛先名自体は高カーディナリティですが、その基となるテンプレートは低カーディナリティであり、グルーピングや集計に効果的に利用できます。

**[9] `messaging.operation.type`:** `process` に設定すべきです（SHOULD）。

**[10] `server.address`:** 利用可能であればリバースDNSルックアップなしのブローカーのサーバードメイン名。それ以外の場合はIPアドレスまたはUNIXドメインソケット名。

**[11] `server.port`:** クライアント側から観測し、かつ中継者を経由して通信している場合、`server.port` は、利用可能であれば、（プロキシなどの）中継者の背後にあるサーバーポートを表すべきです（SHOULD）。

**[12] `messaging.message.body.size`:** これは、圧縮後または圧縮前のいずれのボディサイズも指すことができます。両方のサイズが分かっている場合は、圧縮前のサイズを使用すべきです。

**[13] `messaging.message.envelope.size`:** これは、圧縮後または圧縮前のいずれのサイズも指すことができます。両方のサイズが分かっている場合は、圧縮前のサイズを使用すべきです。

次の属性は、サンプリング判断に重要となりうるため、（いずれかが提供される場合）**スパン作成時点**で提供すべきです（SHOULD）。

* [`messaging.consumer.group.name`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/)
* [`messaging.destination.name`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/)
* [`messaging.destination.partition.id`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/)
* [`messaging.destination.template`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/)
* [`messaging.operation.name`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/)
* [`messaging.operation.type`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/)
* [`messaging.system`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/)
* [`server.address`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/server/)
* [`server.port`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/server/)

---

`error.type` には、次のよく知られた値の一覧があります。いずれかが該当する場合はその値を使用しなければならず（MUST）、それ以外の場合は独自の値を使ってもかまいません（MAY）。

| Value | Description | Stability |
| --- | --- | --- |
| `_OTHER` | 計装がカスタム値を定義していない場合に使用されるフォールバックのエラー値。 | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |

---

`messaging.operation.type` には、次のよく知られた値の一覧があります。いずれかが該当する場合はその値を使用しなければならず（MUST）、それ以外の場合は独自の値を使ってもかまいません（MAY）。

| Value | Description | Stability |
| --- | --- | --- |
| `create` | メッセージが作成されます。"Create"スパンは常に単一のメッセージを指し、バッチ送信シナリオにおいてメッセージに一意な作成コンテキストを提供するために使用されます。 | ![Development](https://img.shields.io/badge/-development-blue) |
| `process` | 1つ以上のメッセージがコンシューマーによって処理されます。 | ![Development](https://img.shields.io/badge/-development-blue) |
| `receive` | 1つ以上のメッセージがコンシューマーによって要求されます。この操作はpullベースのシナリオを指し、コンシューマーがメッセージングSDKのメソッドを明示的に呼び出してメッセージを受信します。 | ![Development](https://img.shields.io/badge/-development-blue) |
| `send` | 1つ以上のメッセージが中継者への送信のために提供されます。単一のメッセージが送信される場合、"Send"スパンのコンテキストを作成コンテキストとして使用できるため、"Create"スパンを作成する必要はありません。 | ![Development](https://img.shields.io/badge/-development-blue) |
| `settle` | 1つ以上のメッセージが決着（settle）されます。 | ![Development](https://img.shields.io/badge/-development-blue) |

---

`messaging.rocketmq.consumption_model` には、次のよく知られた値の一覧があります。いずれかが該当する場合はその値を使用しなければならず（MUST）、それ以外の場合は独自の値を使ってもかまいません（MAY）。

| Value | Description | Stability |
| --- | --- | --- |
| `broadcasting` | ブロードキャスト型の消費モデル | ![Development](https://img.shields.io/badge/-development-blue) |
| `clustering` | クラスタリング型の消費モデル | ![Development](https://img.shields.io/badge/-development-blue) |

---

`messaging.rocketmq.message.type` には、次のよく知られた値の一覧があります。いずれかが該当する場合はその値を使用しなければならず（MUST）、それ以外の場合は独自の値を使ってもかまいません（MAY）。

| Value | Description | Stability |
| --- | --- | --- |
| `delay` | 遅延メッセージ | ![Development](https://img.shields.io/badge/-development-blue) |
| `fifo` | FIFOメッセージ | ![Development](https://img.shields.io/badge/-development-blue) |
| `normal` | 通常メッセージ | ![Development](https://img.shields.io/badge/-development-blue) |
| `transaction` | トランザクションメッセージ | ![Development](https://img.shields.io/badge/-development-blue) |

---

`messaging.system` には、次のよく知られた値の一覧があります。いずれかが該当する場合はその値を使用しなければならず（MUST）、それ以外の場合は独自の値を使ってもかまいません（MAY）。

| Value | Description | Stability |
| --- | --- | --- |
| `activemq` | Apache ActiveMQ | ![Development](https://img.shields.io/badge/-development-blue) |
| `aws.sns` | Amazon Simple Notification Service（SNS） | ![Development](https://img.shields.io/badge/-development-blue) |
| `aws_sqs` | Amazon Simple Queue Service（SQS） | ![Development](https://img.shields.io/badge/-development-blue) |
| `eventgrid` | Azure Event Grid | ![Development](https://img.shields.io/badge/-development-blue) |
| `eventhubs` | Azure Event Hubs | ![Development](https://img.shields.io/badge/-development-blue) |
| `gcp_pubsub` | Google Cloud Pub/Sub | ![Development](https://img.shields.io/badge/-development-blue) |
| `jms` | Java Message Service | ![Development](https://img.shields.io/badge/-development-blue) |
| `kafka` | Apache Kafka | ![Development](https://img.shields.io/badge/-development-blue) |
| `pulsar` | Apache Pulsar | ![Development](https://img.shields.io/badge/-development-blue) |
| `rabbitmq` | RabbitMQ | ![Development](https://img.shields.io/badge/-development-blue) |
| `rocketmq` | Apache RocketMQ | ![Development](https://img.shields.io/badge/-development-blue) |
| `servicebus` | Azure Service Bus | ![Development](https://img.shields.io/badge/-development-blue) |

<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
<!-- endsemconv -->

`messaging.client.id` は、Apache RocketMQ SDKによって自動生成されるクライアントIDに設定すべきです（SHOULD）。

[DocumentStatus]: https://opentelemetry.io/docs/specs/otel/document-status

