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


# Azureメッセージングシステムに関するセマンティック規約

**Status**: [Development][DocumentStatus]

[Azure Service Bus](https://learn.microsoft.com/azure/service-bus-messaging/service-bus-messaging-overview)と[Azure Event Hubs](https://learn.microsoft.com/azure/event-hubs/event-hubs-about)に関するセマンティック規約は、[メッセージングに関するセマンティック規約](/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）。

## Azure Service Bus

### Create span

<!-- semconv span.messaging.servicebus.create.producer -->

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

Azure Service Busへの送信のために作成されるメッセージを記述します。

"Create"スパンは常に単一のメッセージを参照し、バッチ送信シナリオにおいてメッセージに一意な作成コンテキストを提供するために使用されます。"Create"スパンは、それにリンクするクライアントの"Send"スパン（`messaging.send.client`）と組み合わせて使用される場合に限られます。"Send"スパン自体が作成コンテキストとして機能する場合は、代わりにプロデューサーの"Send"スパン（`messaging.send.producer`）を使用し、"Create"スパンは省略してください。詳細は[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 | Azure Service Busの操作名。[1] | `create` |
| [`messaging.system`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | クライアント計装によって識別されるメッセージングシステム。[2] | `servicebus` |
| [`error.type`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/error/) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Conditionally Required` メッセージング操作が失敗した場合に限る。 | string | 操作が終了したエラーのクラスを記述します。[3] | `MessageLockLost`; `MessagingEntityNotFound`; `ServiceBusy` |
| [`messaging.destination.name`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [4] | string | メッセージの宛先名 [5] | `MyQueue`; `MyTopic` |
| [`messaging.destination.template`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [6] | string | メッセージング宛先名の低カーディナリティな表現 [7] | `/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 | メッセージング操作の種別を識別する文字列。[8] | `create` |
| [`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](https://learn.microsoft.com/azure/service-bus-messaging/service-bus-messages-payloads#message-routing-and-correlation)プロパティ。 | `MyConversationId` |
| [`messaging.message.id`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` スパンが単一のメッセージに対する操作を記述する場合。 | string | メッセージングシステムがメッセージの識別子として使用する値。文字列として表現されます。 | `452a7c7c7c7048c2f887f61572b18fc2` |
| [`server.address`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/server/) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Recommended` | string | 利用可能であればリバースDNSルックアップなしのサーバードメイン名。それ以外の場合はIPアドレスまたはUNIXドメインソケット名。[9] | `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 | サーバーのポート番号。[10] | `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 | メッセージボディのバイト数。単一メッセージの操作を記述するスパンにのみ適用されます。[11] | `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 | メッセージボディとメタデータの合計バイト数。[12] | `2738` |

**[1] `messaging.operation.name`：** `create` に設定すべきです（SHOULD）。

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

**[3] `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` を設定する

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

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

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

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

**[8] `messaging.operation.type`：** `create` に設定すべきです（SHOULD）。

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

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

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

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

次の属性は、サンプリング判断に重要となりうるため、（いずれかが提供される場合）**スパン作成時点**で提供すべきです（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つ以上のメッセージがコンシューマーによってリクエストされます。この操作はプル型のシナリオを指し、コンシューマーがメッセージングSDKのメソッドを明示的に呼び出してメッセージを受信します。 | ![Development](https://img.shields.io/badge/-development-blue) |
| `send` | 1つ以上のメッセージが中継者への送信のために提供されます。単一のメッセージが送信される場合、"Send"スパンのコンテキストを作成コンテキストとして使用でき、"Create"スパンを作成する必要はありません。 | ![Development](https://img.shields.io/badge/-development-blue) |
| `settle` | 1つ以上のメッセージが決済されます。 | ![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) |

<!-- endsemconv -->

### Send span (producer)

<!-- semconv span.messaging.servicebus.send.producer -->

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

プロデューサーがAzure Service Busへ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 | Azure Service Busの操作名。[1] | `send`; `schedule` |
| [`messaging.system`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | クライアント計装によって識別されるメッセージングシステム。[2] | `servicebus` |
| [`error.type`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/error/) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Conditionally Required` メッセージング操作が失敗した場合に限る。 | string | 操作が終了したエラーのクラスを記述します。[3] | `MessageLockLost`; `MessagingEntityNotFound`; `ServiceBusy` |
| [`messaging.batch.message_count`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [4] | int | バッチ処理操作の範囲内で送信、受信、または処理されたメッセージの数。[5] | `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` [6] | string | メッセージの宛先名 [7] | `MyQueue`; `MyTopic` |
| [`messaging.destination.template`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [8] | string | メッセージング宛先名の低カーディナリティな表現 [9] | `/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 | メッセージング操作の種別を識別する文字列。[10] | `send` |
| [`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](https://learn.microsoft.com/azure/service-bus-messaging/service-bus-messages-payloads#message-routing-and-correlation)プロパティ。 | `MyConversationId` |
| [`messaging.message.id`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` スパンが単一のメッセージに対する操作を記述する場合。 | string | メッセージングシステムがメッセージの識別子として使用する値。文字列として表現されます。 | `452a7c7c7c7048c2f887f61572b18fc2` |
| [`network.peer.address`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/network/) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Recommended` このメッセージングシステムに適用可能な場合。 | string | 操作が実行されたメッセージング中継者ノードのピアアドレス。[11] | `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ドメインソケット名。[12] | `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 | サーバーのポート番号。[13] | `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 | メッセージボディのバイト数。単一メッセージの操作を記述するスパンにのみ適用されます。[14] | `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 | メッセージボディとメタデータの合計バイト数。[15] | `2738` |

**[1] `messaging.operation.name`：** 次のいずれかの値に一致すべきです（SHOULD）。

- `send`
- `schedule`

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

**[3] `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` を設定する

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

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

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

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

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

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

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

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

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

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

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

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

次の属性は、サンプリング判断に重要となりうるため、（いずれかが提供される場合）**スパン作成時点**で提供すべきです（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つ以上のメッセージがコンシューマーによってリクエストされます。この操作はプル型のシナリオを指し、コンシューマーがメッセージングSDKのメソッドを明示的に呼び出してメッセージを受信します。 | ![Development](https://img.shields.io/badge/-development-blue) |
| `send` | 1つ以上のメッセージが中継者への送信のために提供されます。単一のメッセージが送信される場合、"Send"スパンのコンテキストを作成コンテキストとして使用でき、"Create"スパンを作成する必要はありません。 | ![Development](https://img.shields.io/badge/-development-blue) |
| `settle` | 1つ以上のメッセージが決済されます。 | ![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) |

<!-- endsemconv -->

### Send span (client)

<!-- semconv span.messaging.servicebus.send.client -->

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

プロデューサーがAzure Service Busへ1つ以上のメッセージを送信することを記述します。

メッセージに対して"Create"スパン（またはカスタムの作成コンテキスト）が既に存在する場合にこのスパンを使用してください。この場合、"Send"スパンは転送操作のみを記述し、メッセージに注入された作成コンテキストにリンクします。詳細は[Producer spans](/works/otel-specs-ja/semconv/messaging/messaging-spans/#producer-spans)を参照してください。

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

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

**Attributes:**

（属性はSend span (producer)と同一です。）

| 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 | Azure Service Busの操作名。[1] | `send`; `schedule` |
| [`messaging.system`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | クライアント計装によって識別されるメッセージングシステム。[2] | `servicebus` |
| [`error.type`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/error/) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Conditionally Required` メッセージング操作が失敗した場合に限る。 | string | 操作が終了したエラーのクラスを記述します。[3] | `MessageLockLost`; `MessagingEntityNotFound`; `ServiceBusy` |
| [`messaging.batch.message_count`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [4] | int | バッチ処理操作の範囲内で送信、受信、または処理されたメッセージの数。[5] | `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` [6] | string | メッセージの宛先名 [7] | `MyQueue`; `MyTopic` |
| [`messaging.destination.template`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [8] | string | メッセージング宛先名の低カーディナリティな表現 [9] | `/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 | メッセージング操作の種別を識別する文字列。[10] | `send` |
| [`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](https://learn.microsoft.com/azure/service-bus-messaging/service-bus-messages-payloads#message-routing-and-correlation)プロパティ。 | `MyConversationId` |
| [`messaging.message.id`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` スパンが単一のメッセージに対する操作を記述する場合。 | string | メッセージングシステムがメッセージの識別子として使用する値。文字列として表現されます。 | `452a7c7c7c7048c2f887f61572b18fc2` |
| [`network.peer.address`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/network/) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Recommended` このメッセージングシステムに適用可能な場合。 | string | 操作が実行されたメッセージング中継者ノードのピアアドレス。[11] | `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ドメインソケット名。[12] | `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 | サーバーのポート番号。[13] | `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 | メッセージボディのバイト数。単一メッセージの操作を記述するスパンにのみ適用されます。[14] | `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 | メッセージボディとメタデータの合計バイト数。[15] | `2738` |

**[1]〜[15]** の脚注は、直前の[Send span (producer)](#send-span-producer)節と同一です。

次の属性は、サンプリング判断に重要となりうるため、（いずれかが提供される場合）**スパン作成時点**で提供すべきです（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`・`messaging.operation.type`・`messaging.system` のよく知られた値の一覧は、直前の節と同一です。

<!-- endsemconv -->

### Receive span

<!-- semconv span.messaging.servicebus.receive.client -->

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

コンシューマーがAzure Service Busから1つ以上のメッセージを受信することを記述します。

"Receive"スパンは、コンシューマーがメッセージングSDKのメソッドを明示的に呼び出してメッセージを受信するプル型のシナリオで作成されます。詳細は[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.operation.name`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | Azure Service Busの操作名。[1] | `receive`; `peek`; `receive_deferred` |
| [`messaging.system`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | クライアント計装によって識別されるメッセージングシステム。[2] | `servicebus` |
| [`error.type`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/error/) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Conditionally Required` メッセージング操作が失敗した場合に限る。 | string | 操作が終了したエラーのクラスを記述します。[3] | `MessageLockLost`; `MessagingEntityNotFound`; `ServiceBusy` |
| [`messaging.batch.message_count`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [4] | int | バッチ処理操作の範囲内で送信、受信、または処理されたメッセージの数。[5] | `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` [6] | string | メッセージの宛先名 [7] | `MyQueue`; `MyTopic` |
| [`messaging.destination.subscription.name`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` サブスクリプションからメッセージを受信する場合。 | string | Azure Service Busの[サブスクリプション名](https://learn.microsoft.com/azure/service-bus-messaging/service-bus-queues-topics-subscriptions#topics-and-subscriptions)。 | `subscription-a` |
| [`messaging.destination.template`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [8] | string | メッセージング宛先名の低カーディナリティな表現 [9] | `/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 | メッセージング操作の種別を識別する文字列。[10] | `receive` |
| [`messaging.servicebus.message.delivery_count`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [11] | int | このメッセージについて試行された配信の回数。 | `2` |
| [`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](https://learn.microsoft.com/azure/service-bus-messaging/service-bus-messages-payloads#message-routing-and-correlation)プロパティ。 | `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.servicebus.message.enqueued_time`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | int | メッセージがエンティティに受け入れられ、保存されたUTCエポック秒。 | `1701393730` |
| [`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.operation.name`：** 次のいずれかの値に一致すべきです（SHOULD）。

- `receive`
- `peek`
- `receive_deferred`

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

**[3] `error.type`：** [Create span](#create-span)節の**[3]**と同一です。

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

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

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

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

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

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

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

**[11] `messaging.servicebus.message.delivery_count`：** 配信回数が利用可能で、0より大きい場合。

**[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`：** これは圧縮後または圧縮前のボディサイズのいずれかを指すことができます。両方のサイズが分かっている場合は、圧縮前のサイズを使用すべきです（SHOULD）。

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

次の属性は、サンプリング判断に重要となりうるため、（いずれかが提供される場合）**スパン作成時点**で提供すべきです（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.subscription.name`](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`・`messaging.operation.type`・`messaging.system` のよく知られた値の一覧は、[Create span](#create-span)節と同一です。

<!-- endsemconv -->

### Process span

<!-- semconv span.messaging.servicebus.process.consumer -->

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

コンシューマーがAzure Service Busから1つ以上のメッセージを処理する（プッシュ型）ことを記述します。

"Process"スパンは、コールバックやハンドラーを通じてメッセージがアプリケーションに渡されるプッシュ型のシナリオで作成されます。詳細は[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.operation.name`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | Azure Service Busの操作名。[1] | `process` |
| [`messaging.system`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | クライアント計装によって識別されるメッセージングシステム。[2] | `servicebus` |
| [`error.type`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/error/) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Conditionally Required` メッセージング操作が失敗した場合に限る。 | string | 操作が終了したエラーのクラスを記述します。[3] | `MessageLockLost`; `MessagingEntityNotFound`; `ServiceBusy` |
| [`messaging.batch.message_count`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [4] | int | バッチ処理操作の範囲内で送信、受信、または処理されたメッセージの数。[5] | `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` [6] | string | メッセージの宛先名 [7] | `MyQueue`; `MyTopic` |
| [`messaging.destination.subscription.name`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` サブスクリプションからメッセージを受信する場合。 | string | Azure Service Busの[サブスクリプション名](https://learn.microsoft.com/azure/service-bus-messaging/service-bus-queues-topics-subscriptions#topics-and-subscriptions)。 | `subscription-a` |
| [`messaging.destination.template`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [8] | string | メッセージング宛先名の低カーディナリティな表現 [9] | `/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 | メッセージング操作の種別を識別する文字列。[10] | `process` |
| [`messaging.servicebus.message.delivery_count`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [11] | int | このメッセージについて試行された配信の回数。 | `2` |
| [`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](https://learn.microsoft.com/azure/service-bus-messaging/service-bus-messages-payloads#message-routing-and-correlation)プロパティ。 | `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.servicebus.message.enqueued_time`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | int | メッセージがエンティティに受け入れられ、保存されたUTCエポック秒。 | `1701393730` |
| [`server.address`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/server/) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Recommended` | string | 利用可能であればリバースDNSルックアップなしのサーバードメイン名。それ以外の場合はIPアドレスまたはUNIXドメインソケット名。[12] | `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 | サーバーのポート番号。[13] | `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 | メッセージボディのバイト数。単一メッセージの操作を記述するスパンにのみ適用されます。[14] | `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 | メッセージボディとメタデータの合計バイト数。[15] | `2738` |

**[1] `messaging.operation.name`：** `process` に設定すべきです（SHOULD）。

**[2]〜[15]** の脚注は、[Receive span](#receive-span)節の対応する脚注（`messaging.operation.type` は `process` に設定すべき点を除く）と同一です。

次の属性は、サンプリング判断に重要となりうるため、（いずれかが提供される場合）**スパン作成時点**で提供すべきです（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.subscription.name`](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`・`messaging.operation.type`・`messaging.system` のよく知られた値の一覧は、[Create span](#create-span)節と同一です。

<!-- endsemconv -->

### Settle span

<!-- semconv span.messaging.servicebus.settle.client -->

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

1つ以上のAzure Service Busメッセージを決済（完了・中断・延期・デッドレター化）することを記述します。

"Settle"スパンは、手動または自動でトリガーされるすべての決済操作について作成されます。詳細は[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.operation.name`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | Azure Service Busの操作名。[1] | `complete`; `abandon`; `dead_letter` |
| [`messaging.system`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | クライアント計装によって識別されるメッセージングシステム。[2] | `servicebus` |
| [`error.type`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/error/) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Conditionally Required` メッセージング操作が失敗した場合に限る。 | string | 操作が終了したエラーのクラスを記述します。[3] | `MessageLockLost`; `MessagingEntityNotFound`; `ServiceBusy` |
| [`messaging.batch.message_count`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [4] | int | バッチ処理操作の範囲内で送信、受信、または処理されたメッセージの数。[5] | `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` [6] | string | メッセージの宛先名 [7] | `MyQueue`; `MyTopic` |
| [`messaging.destination.subscription.name`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` サブスクリプションからメッセージを受信する場合。 | string | Azure Service Busの[サブスクリプション名](https://learn.microsoft.com/azure/service-bus-messaging/service-bus-queues-topics-subscriptions#topics-and-subscriptions)。 | `subscription-a` |
| [`messaging.destination.template`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [8] | string | メッセージング宛先名の低カーディナリティな表現 [9] | `/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 | メッセージング操作の種別を識別する文字列。[10] | `settle` |
| [`messaging.servicebus.disposition_status`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [11] | string | [決済タイプ](https://learn.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock)を記述します。 | `complete`; `abandon`; `dead_letter` |
| [`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](https://learn.microsoft.com/azure/service-bus-messaging/service-bus-messages-payloads#message-routing-and-correlation)プロパティ。 | `MyConversationId` |
| [`messaging.message.id`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` スパンが単一のメッセージに対する操作を記述する場合。 | string | メッセージングシステムがメッセージの識別子として使用する値。文字列として表現されます。 | `452a7c7c7c7048c2f887f61572b18fc2` |
| [`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` |

**[1] `messaging.operation.name`：** 次のいずれかの値に一致すべきです（SHOULD）。

- `abandon`
- `complete`
- `defer`
- `dead_letter`
- `delete`

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

**[3] `error.type`：** [Create span](#create-span)節の**[3]**と同一です。

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

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

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

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

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

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

**[10] `messaging.operation.type`：** `settle` に設定すべきです（SHOULD）。

**[11] `messaging.servicebus.disposition_status`：** メッセージが特定の処理状態で決済される場合。

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

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

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

次の属性は、サンプリング判断に重要となりうるため、（いずれかが提供される場合）**スパン作成時点**で提供すべきです（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.subscription.name`](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つ以上のメッセージがコンシューマーによってリクエストされます。この操作はプル型のシナリオを指し、コンシューマーがメッセージングSDKのメソッドを明示的に呼び出してメッセージを受信します。 | ![Development](https://img.shields.io/badge/-development-blue) |
| `send` | 1つ以上のメッセージが中継者への送信のために提供されます。単一のメッセージが送信される場合、"Send"スパンのコンテキストを作成コンテキストとして使用でき、"Create"スパンを作成する必要はありません。 | ![Development](https://img.shields.io/badge/-development-blue) |
| `settle` | 1つ以上のメッセージが決済されます。 | ![Development](https://img.shields.io/badge/-development-blue) |

---

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

| Value | Description | Stability |
| --- | --- | --- |
| `abandon` | メッセージが中断されます | ![Development](https://img.shields.io/badge/-development-blue) |
| `complete` | メッセージが完了します | ![Development](https://img.shields.io/badge/-development-blue) |
| `dead_letter` | メッセージがデッドレターキューに送信されます | ![Development](https://img.shields.io/badge/-development-blue) |
| `defer` | メッセージが延期されます | ![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) |

<!-- endsemconv -->

### Generic client span

<!-- semconv span.messaging.servicebus.generic.client -->

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

より具体的な（create、send、receive、process、settleのいずれかの）スパンでカバーされないAzure Service Busクライアント操作を記述します。

セッション管理やロックの更新など、create、send、receive、process、settleスパンのいずれにも対応しないAzure Service Busクライアント操作のための、汎用（catch-all）スパンです。

**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.operation.name`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | Azure Service Busの操作名。[1] | `accept_session`; `renew_message_lock`; `create_transaction` |
| [`messaging.system`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | クライアント計装によって識別されるメッセージングシステム。[2] | `servicebus` |
| [`error.type`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/error/) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Conditionally Required` メッセージング操作が失敗した場合に限る。 | string | 操作が終了したエラーのクラスを記述します。[3] | `MessageLockLost`; `MessagingEntityNotFound`; `ServiceBusy` |
| [`messaging.batch.message_count`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [4] | int | バッチ処理操作の範囲内で送信、受信、または処理されたメッセージの数。[5] | `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` [6] | string | メッセージの宛先名 [7] | `MyQueue`; `MyTopic` |
| [`messaging.destination.subscription.name`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` サブスクリプションからメッセージを受信する場合。 | string | Azure Service Busの[サブスクリプション名](https://learn.microsoft.com/azure/service-bus-messaging/service-bus-queues-topics-subscriptions#topics-and-subscriptions)。 | `subscription-a` |
| [`messaging.destination.template`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [8] | string | メッセージング宛先名の低カーディナリティな表現 [9] | `/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 | メッセージング操作の種別を識別する文字列。[10] | `create`; `send`; `receive` |
| [`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](https://learn.microsoft.com/azure/service-bus-messaging/service-bus-messages-payloads#message-routing-and-correlation)プロパティ。 | `MyConversationId` |
| [`messaging.message.id`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` スパンが単一のメッセージに対する操作を記述する場合。 | string | メッセージングシステムがメッセージの識別子として使用する値。文字列として表現されます。 | `452a7c7c7c7048c2f887f61572b18fc2` |
| [`network.peer.address`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/network/) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Recommended` このメッセージングシステムに適用可能な場合。 | string | 操作が実行されたメッセージング中継者ノードのピアアドレス。[11] | `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ドメインソケット名。[12] | `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 | サーバーのポート番号。[13] | `80`; `8080`; `443` |

**[1] `messaging.operation.name`：** クライアントメソッド名をsnake_caseで設定すべきです（SHOULD）。例:

- セッション操作: `accept_session`、`get_session_state`、`set_session_state`、`renew_session_lock`
- ロックの更新: `renew_message_lock`
- スケジュール操作: `cancel_scheduled`
- トランザクション操作: `create_transaction`、`commit_transaction`、`rollback_transaction`

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

**[3]〜[9]、[11]〜[13]** の脚注は、[Create span](#create-span)節・[Receive span](#receive-span)節の対応する脚注と同一です。

**[10] `messaging.operation.type`：** カスタム値を使用する場合、低カーディナリティでなければなりません（MUST）。

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

* [`messaging.destination.name`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/)
* [`messaging.destination.subscription.name`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/)
* [`messaging.operation.name`](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`・`messaging.operation.type`・`messaging.system` のよく知られた値の一覧は、[Create span](#create-span)節と同一です。

<!-- endsemconv -->

## Azure Event Hubs

### Create span

<!-- semconv span.messaging.eventhubs.create.producer -->

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

Azure Event Hubsへの送信のために作成されるメッセージを記述します。

"Create"スパンは常に単一のメッセージを参照し、バッチ送信シナリオにおいてメッセージに一意な作成コンテキストを提供するために使用されます。"Create"スパンは、それにリンクするクライアントの"Send"スパン（`messaging.send.client`）と組み合わせて使用される場合に限られます。"Send"スパン自体が作成コンテキストとして機能する場合は、代わりにプロデューサーの"Send"スパン（`messaging.send.producer`）を使用し、"Create"スパンは省略してください。詳細は[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 | Azure Event Hubsの操作名。[1] | `create` |
| [`messaging.system`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | クライアント計装によって識別されるメッセージングシステム。[2] | `eventhubs` |
| [`error.type`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/error/) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Conditionally Required` メッセージング操作が失敗した場合に限る。 | string | 操作が終了したエラーのクラスを記述します。[3] | `ConsumerDisconnected`; `ResourceNotFound`; `ServiceBusy` |
| [`messaging.destination.name`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [4] | string | メッセージの宛先名 [5] | `MyTopic` |
| [`messaging.destination.partition.id`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` 利用可能な場合。 | string | メッセージが送信される、または受信されるパーティションの識別子であり、`messaging.destination.name` 内で一意です。 | `1` |
| [`messaging.destination.template`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [6] | string | メッセージング宛先名の低カーディナリティな表現 [7] | `/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 | メッセージング操作の種別を識別する文字列。[8] | `create` |
| [`messaging.message.conversation_id`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | メッセージが属する会話を識別する会話ID。文字列として表現されます。「相関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` |
| [`server.address`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/server/) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Recommended` | string | 利用可能であればリバースDNSルックアップなしのサーバードメイン名。それ以外の場合はIPアドレスまたはUNIXドメインソケット名。[9] | `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 | サーバーのポート番号。[10] | `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 | メッセージボディのバイト数。単一メッセージの操作を記述するスパンにのみ適用されます。[11] | `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 | メッセージボディとメタデータの合計バイト数。[12] | `2738` |

**[1] `messaging.operation.name`：** `create` に設定すべきです（SHOULD）。

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

**[3] `error.type`：** [Azure Service Bus - Create span](#create-span)節の**[3]**と同一です。

**[4]〜[9]** の脚注は、Azure Service Busの対応する脚注と同一です。

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

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

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

次の属性は、サンプリング判断に重要となりうるため、（いずれかが提供される場合）**スパン作成時点**で提供すべきです（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`・`messaging.operation.type`・`messaging.system` のよく知られた値の一覧は、Azure Service Busの節と同一です。

<!-- endsemconv -->

### Send span (producer)

<!-- semconv span.messaging.eventhubs.send.producer -->

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

プロデューサーがAzure Event Hubsへ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 | Azure Event Hubsの操作名。[1] | `send` |
| [`messaging.system`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | クライアント計装によって識別されるメッセージングシステム。[2] | `eventhubs` |
| [`error.type`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/error/) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Conditionally Required` メッセージング操作が失敗した場合に限る。 | string | 操作が終了したエラーのクラスを記述します。[3] | `ConsumerDisconnected`; `ResourceNotFound`; `ServiceBusy` |
| [`messaging.batch.message_count`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [4] | int | バッチ処理操作の範囲内で送信、受信、または処理されたメッセージの数。[5] | `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` [6] | string | メッセージの宛先名 [7] | `MyTopic` |
| [`messaging.destination.partition.id`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` 利用可能な場合。 | string | メッセージが送信される、または受信されるパーティションの識別子であり、`messaging.destination.name` 内で一意です。 | `1` |
| [`messaging.destination.template`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [8] | string | メッセージング宛先名の低カーディナリティな表現 [9] | `/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 | メッセージング操作の種別を識別する文字列。[10] | `send` |
| [`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.message.conversation_id`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | メッセージが属する会話を識別する会話ID。文字列として表現されます。「相関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` |
| [`network.peer.address`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/network/) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Recommended` このメッセージングシステムに適用可能な場合。 | string | 操作が実行されたメッセージング中継者ノードのピアアドレス。[11] | `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ドメインソケット名。[12] | `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 | サーバーのポート番号。[13] | `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 | メッセージボディのバイト数。単一メッセージの操作を記述するスパンにのみ適用されます。[14] | `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 | メッセージボディとメタデータの合計バイト数。[15] | `2738` |

**[1] `messaging.operation.name`：** `send` に設定すべきです（SHOULD）。

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

**[3]〜[15]** の脚注は、[Create span](#create-span-1)節・Azure Service Busの対応する脚注と同一です。

次の属性は、サンプリング判断に重要となりうるため、（いずれかが提供される場合）**スパン作成時点**で提供すべきです（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`・`messaging.operation.type`・`messaging.system` のよく知られた値の一覧は、Azure Service Busの節と同一です。

<!-- endsemconv -->

### Send span (client)

<!-- semconv span.messaging.eventhubs.send.client -->

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

プロデューサーがAzure Event Hubsへ1つ以上のメッセージを送信することを記述します。

メッセージに対して"Create"スパン（またはカスタムの作成コンテキスト）が既に存在する場合にこのスパンを使用してください。この場合、"Send"スパンは転送操作のみを記述し、メッセージに注入された作成コンテキストにリンクします。詳細は[Producer spans](/works/otel-specs-ja/semconv/messaging/messaging-spans/#producer-spans)を参照してください。

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

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

**Attributes:**

（属性は直前の[Send span (producer)](#send-span-producer-1)と同一です。）

**[1]〜[15]** の脚注も直前の節と同一です。

次の属性は、サンプリング判断に重要となりうるため、（いずれかが提供される場合）**スパン作成時点**で提供すべきです（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`・`messaging.operation.type`・`messaging.system` のよく知られた値の一覧は、Azure Service Busの節と同一です。

<!-- endsemconv -->

### Receive span

<!-- semconv span.messaging.eventhubs.receive.client -->

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

コンシューマーがAzure Event Hubsから1つ以上のメッセージを受信する（プル型）ことを記述します。

"Receive"スパンは、コンシューマーがメッセージングSDKのメソッドを明示的に呼び出してメッセージを受信するプル型のシナリオで作成されます。詳細は[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.operation.name`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | Azure Event Hubsの操作名。[1] | `receive` |
| [`messaging.system`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | クライアント計装によって識別されるメッセージングシステム。[2] | `eventhubs` |
| [`error.type`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/error/) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Conditionally Required` メッセージング操作が失敗した場合に限る。 | string | 操作が終了したエラーのクラスを記述します。[3] | `ConsumerDisconnected`; `ResourceNotFound`; `ServiceBusy` |
| [`messaging.batch.message_count`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [4] | int | バッチ処理操作の範囲内で送信、受信、または処理されたメッセージの数。[5] | `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` [6] | string | メッセージの宛先名 [7] | `MyTopic` |
| [`messaging.destination.partition.id`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` 利用可能な場合。 | string | メッセージが送信される、または受信されるパーティションの識別子であり、`messaging.destination.name` 内で一意です。 | `1` |
| [`messaging.destination.template`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [8] | string | メッセージング宛先名の低カーディナリティな表現 [9] | `/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 | メッセージング操作の種別を識別する文字列。[10] | `receive` |
| [`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.consumer.group.name`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | Azure Event Hubsの[コンシューマーグループ名](https://learn.microsoft.com/azure/event-hubs/event-hubs-features#consumer-groups)。 | `my-group`; `indexer` |
| [`messaging.eventhubs.message.enqueued_time`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | int | メッセージがエンティティに受け入れられ、保存されたUTCエポック秒。 | `1701393730` |
| [`messaging.message.conversation_id`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | メッセージが属する会話を識別する会話ID。文字列として表現されます。「相関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` |
| [`network.peer.address`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/network/) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Recommended` このメッセージングシステムに適用可能な場合。 | string | 操作が実行されたメッセージング中継者ノードのピアアドレス。[11] | `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ドメインソケット名。[12] | `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 | サーバーのポート番号。[13] | `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 | メッセージボディのバイト数。単一メッセージの操作を記述するスパンにのみ適用されます。[14] | `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 | メッセージボディとメタデータの合計バイト数。[15] | `2738` |

**[1] `messaging.operation.name`：** `receive` に設定すべきです（SHOULD）。

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

**[3]〜[15]** の脚注は、Azure Service BusのReceive spanの対応する脚注と同一です。

次の属性は、サンプリング判断に重要となりうるため、（いずれかが提供される場合）**スパン作成時点**で提供すべきです（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`・`messaging.operation.type`・`messaging.system` のよく知られた値の一覧は、Azure Service Busの節と同一です。

<!-- endsemconv -->

### Process span

<!-- semconv span.messaging.eventhubs.process.consumer -->

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

コンシューマーがAzure Event Hubsから1つ以上のメッセージを処理する（プッシュ型）ことを記述します。

"Process"スパンは、コールバックやハンドラーを通じてメッセージがアプリケーションに渡されるプッシュ型のシナリオで作成されます。詳細は[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.operation.name`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | Azure Event Hubsの操作名。[1] | `process` |
| [`messaging.system`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | クライアント計装によって識別されるメッセージングシステム。[2] | `eventhubs` |
| [`error.type`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/error/) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Conditionally Required` メッセージング操作が失敗した場合に限る。 | string | 操作が終了したエラーのクラスを記述します。[3] | `ConsumerDisconnected`; `ResourceNotFound`; `ServiceBusy` |
| [`messaging.batch.message_count`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [4] | int | バッチ処理操作の範囲内で送信、受信、または処理されたメッセージの数。[5] | `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` [6] | string | メッセージの宛先名 [7] | `MyTopic` |
| [`messaging.destination.partition.id`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` 利用可能な場合。 | string | メッセージが送信される、または受信されるパーティションの識別子であり、`messaging.destination.name` 内で一意です。 | `1` |
| [`messaging.destination.template`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [8] | string | メッセージング宛先名の低カーディナリティな表現 [9] | `/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 | メッセージング操作の種別を識別する文字列。[10] | `process` |
| [`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.consumer.group.name`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | Azure Event Hubsの[コンシューマーグループ名](https://learn.microsoft.com/azure/event-hubs/event-hubs-features#consumer-groups)。 | `my-group`; `indexer` |
| [`messaging.eventhubs.message.enqueued_time`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | int | メッセージがエンティティに受け入れられ、保存されたUTCエポック秒。 | `1701393730` |
| [`messaging.message.conversation_id`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | メッセージが属する会話を識別する会話ID。文字列として表現されます。「相関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` |
| [`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.operation.name`：** `process` に設定すべきです（SHOULD）。

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

**[3]〜[14]** の脚注は、直前の[Receive span](#receive-span-1)節の対応する脚注と同一です。

次の属性は、サンプリング判断に重要となりうるため、（いずれかが提供される場合）**スパン作成時点**で提供すべきです（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`・`messaging.operation.type`・`messaging.system` のよく知られた値の一覧は、Azure Service Busの節と同一です。

<!-- endsemconv -->

### Settle span

<!-- semconv span.messaging.eventhubs.settle.client -->

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

Azure Event Hubsで処理済みメッセージをチェックポイント（決済）することを記述します。

"Settle"スパンは、手動または自動でトリガーされるすべての決済操作について作成されます。詳細は[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.operation.name`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | Azure Event Hubsの操作名。[1] | `checkpoint` |
| [`messaging.system`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | クライアント計装によって識別されるメッセージングシステム。[2] | `eventhubs` |
| [`error.type`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/error/) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Conditionally Required` メッセージング操作が失敗した場合に限る。 | string | 操作が終了したエラーのクラスを記述します。[3] | `ConsumerDisconnected`; `ResourceNotFound`; `ServiceBusy` |
| [`messaging.batch.message_count`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [4] | int | バッチ処理操作の範囲内で送信、受信、または処理されたメッセージの数。[5] | `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` [6] | string | メッセージの宛先名 [7] | `MyTopic` |
| [`messaging.destination.partition.id`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` 利用可能な場合。 | string | メッセージがチェックポイントされるパーティションIDの文字列表現であり、Event Hub内で一意です。 | `1` |
| [`messaging.destination.template`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [8] | string | メッセージング宛先名の低カーディナリティな表現 [9] | `/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 | メッセージング操作の種別を識別する文字列。[10] | `settle` |
| [`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.consumer.group.name`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | Azure Event Hubsの[コンシューマーグループ名](https://learn.microsoft.com/azure/event-hubs/event-hubs-features#consumer-groups)。 | `my-group`; `indexer` |
| [`messaging.message.conversation_id`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | メッセージが属する会話を識別する会話ID。文字列として表現されます。「相関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` |
| [`network.peer.address`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/network/) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Recommended` このメッセージングシステムに適用可能な場合。 | string | 操作が実行されたメッセージング中継者ノードのピアアドレス。[11] | `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ドメインソケット名。[12] | `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 | サーバーのポート番号。[13] | `80`; `8080`; `443` |

**[1] `messaging.operation.name`：** `checkpoint` に設定すべきです（SHOULD）。

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

**[3]〜[13]** の脚注は、これまでのAzure Event Hubsの節の対応する脚注と同一です。

次の属性は、サンプリング判断に重要となりうるため、（いずれかが提供される場合）**スパン作成時点**で提供すべきです（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`・`messaging.operation.type`・`messaging.system` のよく知られた値の一覧は、Azure Service Busの節と同一です。

<!-- endsemconv -->

### Generic client span

<!-- semconv span.messaging.eventhubs.generic.client -->

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

より具体的な（create、send、receive、process、settleのいずれかの）スパンでカバーされないAzure Event Hubsクライアント操作を記述します。

メタデータの取得など、create、send、receive、process、settleスパンのいずれにも対応しないAzure Event Hubsクライアント操作のための、汎用（catch-all）スパンです。

**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.operation.name`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | Azure Event Hubsの操作名。[1] | `get_partition_properties`; `get_event_hub_properties` |
| [`messaging.system`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | クライアント計装によって識別されるメッセージングシステム。[2] | `eventhubs` |
| [`error.type`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/error/) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Conditionally Required` メッセージング操作が失敗した場合に限る。 | string | 操作が終了したエラーのクラスを記述します。[3] | `ConsumerDisconnected`; `ResourceNotFound`; `ServiceBusy` |
| [`messaging.batch.message_count`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [4] | int | バッチ処理操作の範囲内で送信、受信、または処理されたメッセージの数。[5] | `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` [6] | string | メッセージの宛先名 [7] | `MyTopic` |
| [`messaging.destination.partition.id`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` 利用可能な場合。 | string | パーティションIDの文字列表現であり、Event Hub内で一意です。 | `1` |
| [`messaging.destination.template`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [8] | string | メッセージング宛先名の低カーディナリティな表現 [9] | `/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 | メッセージング操作の種別を識別する文字列。[10] | `create`; `send`; `receive` |
| [`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.message.conversation_id`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | メッセージが属する会話を識別する会話ID。文字列として表現されます。「相関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` |
| [`network.peer.address`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/network/) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Recommended` このメッセージングシステムに適用可能な場合。 | string | 操作が実行されたメッセージング中継者ノードのピアアドレス。[11] | `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ドメインソケット名。[12] | `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 | サーバーのポート番号。[13] | `80`; `8080`; `443` |

**[1] `messaging.operation.name`：** クライアントメソッド名をsnake_caseで設定すべきです（SHOULD）。例:

- `get_partition_properties`
- `get_event_hub_properties`

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

**[3]〜[13]** の脚注は、これまでのAzure Event Hubsの節の対応する脚注と同一です。ただし**[10]** は「カスタム値を使用する場合、低カーディナリティでなければなりません（MUST）」です。

次の属性は、サンプリング判断に重要となりうるため、（いずれかが提供される場合）**スパン作成時点**で提供すべきです（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.operation.name`](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`・`messaging.operation.type`・`messaging.system` のよく知られた値の一覧は、Azure Service Busの節と同一です。

<!-- endsemconv -->

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

