diff --git a/.chloggen/add_localAddress_to_rpc.yaml b/.chloggen/add_localAddress_to_rpc.yaml new file mode 100644 index 0000000000..4342298645 --- /dev/null +++ b/.chloggen/add_localAddress_to_rpc.yaml @@ -0,0 +1,22 @@ +# Use this changelog template to create an entry for release notes. +# +# If your change doesn't affect end users you should instead start +# your pull request title with [chore] or use the "Skip Changelog" label. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: enhancement + +# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db) +component: rpc + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Add `network.local.address` and `network.local.port` as opt-in attributes on rpc server spans. + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +# The values here must be integers. +issues: [2862] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: diff --git a/docs/rpc/connect-rpc.md b/docs/rpc/connect-rpc.md index bdc4435698..f727c3204f 100644 --- a/docs/rpc/connect-rpc.md +++ b/docs/rpc/connect-rpc.md @@ -158,6 +158,8 @@ This span represents an incoming Remote Procedure Call (RPC). | [`network.type`](/docs/registry/attributes/network.md) | string | [OSI network layer](https://wikipedia.org/wiki/Network_layer) or non-OSI equivalent. [7] | `ipv4`; `ipv6` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`rpc.method`](/docs/registry/attributes/rpc.md) | string | This is the logical name of the method from the RPC interface perspective. [8] | `exampleMethod` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) | | [`rpc.service`](/docs/registry/attributes/rpc.md) | string | The full (logical) name of the service being called, including its package name, if applicable. [9] | `myservice.EchoService` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) | +| [`network.local.address`](/docs/registry/attributes/network.md) | string | Local address of the network connection - IP address or Unix domain socket name. | `10.1.2.80`; `/tmp/my.sock` | `Opt-In` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`network.local.port`](/docs/registry/attributes/network.md) | int | Local port number of the network connection. | `65123` | `Opt-In` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`rpc.connect_rpc.request.metadata.`](/docs/registry/attributes/rpc.md) | string[] | Connect request metadata, `` being the normalized Connect Metadata key (lowercase), the value being the metadata values. [10] | `["1.2.3.4", "1.2.3.5"]` | `Opt-In` | ![Development](https://img.shields.io/badge/-development-blue) | | [`rpc.connect_rpc.response.metadata.`](/docs/registry/attributes/rpc.md) | string[] | Connect response metadata, `` being the normalized Connect Metadata key (lowercase), the value being the metadata values. [11] | `["attribute_value"]` | `Opt-In` | ![Development](https://img.shields.io/badge/-development-blue) | diff --git a/docs/rpc/grpc.md b/docs/rpc/grpc.md index efd7b4617c..020425635b 100644 --- a/docs/rpc/grpc.md +++ b/docs/rpc/grpc.md @@ -159,6 +159,8 @@ This span represents an incoming Remote Procedure Call (RPC). | [`network.type`](/docs/registry/attributes/network.md) | string | [OSI network layer](https://wikipedia.org/wiki/Network_layer) or non-OSI equivalent. [7] | `ipv4`; `ipv6` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`rpc.method`](/docs/registry/attributes/rpc.md) | string | This is the logical name of the method from the RPC interface perspective. [8] | `exampleMethod` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) | | [`rpc.service`](/docs/registry/attributes/rpc.md) | string | The full (logical) name of the service being called, including its package name, if applicable. [9] | `myservice.EchoService` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) | +| [`network.local.address`](/docs/registry/attributes/network.md) | string | Local address of the network connection - IP address or Unix domain socket name. | `10.1.2.80`; `/tmp/my.sock` | `Opt-In` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`network.local.port`](/docs/registry/attributes/network.md) | int | Local port number of the network connection. | `65123` | `Opt-In` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`rpc.grpc.request.metadata.`](/docs/registry/attributes/rpc.md) | string[] | gRPC request metadata, `` being the normalized gRPC Metadata key (lowercase), the value being the metadata values. [10] | `["1.2.3.4", "1.2.3.5"]` | `Opt-In` | ![Development](https://img.shields.io/badge/-development-blue) | | [`rpc.grpc.response.metadata.`](/docs/registry/attributes/rpc.md) | string[] | gRPC response metadata, `` being the normalized gRPC Metadata key (lowercase), the value being the metadata values. [11] | `["attribute_value"]` | `Opt-In` | ![Development](https://img.shields.io/badge/-development-blue) | diff --git a/docs/rpc/json-rpc.md b/docs/rpc/json-rpc.md index bae5e919d8..f22e66ffcd 100644 --- a/docs/rpc/json-rpc.md +++ b/docs/rpc/json-rpc.md @@ -123,6 +123,8 @@ This span represents an incoming Remote Procedure Call (RPC). | [`network.type`](/docs/registry/attributes/network.md) | string | [OSI network layer](https://wikipedia.org/wiki/Network_layer) or non-OSI equivalent. [8] | `ipv4`; `ipv6` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`rpc.jsonrpc.error_message`](/docs/registry/attributes/rpc.md) | string | `error.message` property of response if it is an error response. | `Parse error`; `User already exists` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) | | [`rpc.jsonrpc.request_id`](/docs/registry/attributes/rpc.md) | string | `id` property of request or response. Since protocol allows id to be int, string, `null` or missing (for notifications), value is expected to be cast to string for simplicity. Use empty string in case of `null` value. Omit entirely if this is a notification. | `10`; `request-7`; `` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) | +| [`network.local.address`](/docs/registry/attributes/network.md) | string | Local address of the network connection - IP address or Unix domain socket name. | `10.1.2.80`; `/tmp/my.sock` | `Opt-In` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`network.local.port`](/docs/registry/attributes/network.md) | int | Local port number of the network connection. | `65123` | `Opt-In` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | **[1] `rpc.method`:** This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function.name` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). diff --git a/docs/rpc/rpc-spans.md b/docs/rpc/rpc-spans.md index b322a35abe..0fb8180a49 100644 --- a/docs/rpc/rpc-spans.md +++ b/docs/rpc/rpc-spans.md @@ -205,6 +205,8 @@ This span represents an incoming Remote Procedure Call (RPC). | [`network.type`](/docs/registry/attributes/network.md) | string | [OSI network layer](https://wikipedia.org/wiki/Network_layer) or non-OSI equivalent. [7] | `ipv4`; `ipv6` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`rpc.method`](/docs/registry/attributes/rpc.md) | string | This is the logical name of the method from the RPC interface perspective. [8] | `exampleMethod` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) | | [`rpc.service`](/docs/registry/attributes/rpc.md) | string | The full (logical) name of the service being called, including its package name, if applicable. [9] | `myservice.EchoService` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) | +| [`network.local.address`](/docs/registry/attributes/network.md) | string | Local address of the network connection - IP address or Unix domain socket name. | `10.1.2.80`; `/tmp/my.sock` | `Opt-In` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`network.local.port`](/docs/registry/attributes/network.md) | int | Local port number of the network connection. | `65123` | `Opt-In` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | **[1] `server.address`:** May contain server IP address, DNS name, or local socket name. When host component is an IP address, instrumentations SHOULD NOT do a reverse proxy lookup to obtain DNS name and SHOULD set `server.address` to the IP address provided in the host component. diff --git a/model/rpc/common.yaml b/model/rpc/common.yaml index 59dbda4f79..0f6e1dfca0 100644 --- a/model/rpc/common.yaml +++ b/model/rpc/common.yaml @@ -87,6 +87,10 @@ groups: requirement_level: recommended - ref: network.type requirement_level: recommended + - ref: network.local.address + requirement_level: opt_in + - ref: network.local.port + requirement_level: opt_in - id: rpc_service.server type: attribute_group @@ -101,3 +105,7 @@ groups: requirement_level: recommended - ref: network.type requirement_level: recommended + - ref: network.local.address + requirement_level: opt_in + - ref: network.local.port + requirement_level: opt_in