Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .chloggen/peer-service-deprecation.yaml
Original file line number Diff line number Diff line change
@@ -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: deprecation

# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db)
component: peer

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: The `peer.service` attribute has been deprecated in favor of `service.peer.name`.

# 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: [2945]

# (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: The `peer.service` attribute has been renamed to `service.peer.name` to align with the `service.{name|namespace}` resource attributes.
22 changes: 22 additions & 0 deletions .chloggen/service-peer.yaml
Original file line number Diff line number Diff line change
@@ -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: service

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: "`service.peer.name` and `service.peer.namespace` have been introduced as the replacement for `peer.service` to describe remote services that use both a name and a namespace."

# 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: [2945]

# (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: The `peer.service` attribute could not fully represent the `service.{name|namespace}` resource attributes; `service.peer.name` and `service.peer.namespace` provide a more complete representation.
32 changes: 30 additions & 2 deletions docs/general/attributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ Particular operations may refer to or require some of these attributes.
- [Client/server example with forward proxy](#clientserver-example-with-forward-proxy)
- [Network connection and carrier attributes](#network-connection-and-carrier-attributes)
- [General remote service attributes](#general-remote-service-attributes)
- [Service Peer](#service-peer)
- [Peer namespace](#peer-namespace)
- [General thread attributes](#general-thread-attributes)
- [Source code attributes](#source-code-attributes)

Expand Down Expand Up @@ -355,7 +357,33 @@ For `Unix` and `pipe`, since the connection goes over the file system instead of

## General remote service attributes

This attribute may be used for any operation that accesses some remote service.
### Service Peer

Attributes of the `service.peer.*` namespace may also be used for any operation that accesses some remote service.
Users can define what the name of a service is based on their particular semantics in their distributed system.
Instrumentations SHOULD provide a way for users to configure this name.

<!-- semconv service.peer -->
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/snippet.md.j2 -->
<!-- prettier-ignore-start -->
<!-- markdownlint-capture -->
<!-- markdownlint-disable -->

| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---|
| [`service.peer.name`](/docs/registry/attributes/service.md) | string | Logical name of the service on the other side of the connection. SHOULD be equal to the actual [`service.name`](/docs/resource/README.md#service) resource attribute of the remote service if any. | `shoppingcart` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
| [`service.peer.namespace`](/docs/registry/attributes/service.md) | string | A namespace for `service.peer.name`. | `Shop` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |

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

### Peer namespace

Attributes of the `peer.*` namespace are deprecated, and they used to provide a way to describe any operation that accesses some remote service.
The `peer.service` attribute harkens back from OpenTracing, and has not been updated to match the `service.name` and `service.namespace` resource attributes to describe a service.
Users can define what the name of a service is based on their particular semantics in their distributed system.
Instrumentations SHOULD provide a way for users to configure this name.

Expand All @@ -368,7 +396,7 @@ Instrumentations SHOULD provide a way for users to configure this name.

| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---|
| [`peer.service`](/docs/registry/attributes/peer.md) | string | The [`service.name`](/docs/resource/README.md#service) of the remote service. SHOULD be equal to the actual `service.name` resource attribute of the remote service if any. | `AuthTokenCache` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
| [`peer.service`](/docs/registry/attributes/peer.md) | string | The [`service.name`](/docs/resource/README.md#service) of the remote service. SHOULD be equal to the actual `service.name` resource attribute of the remote service if any. | `AuthTokenCache` | `Recommended` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Replaced by `service.peer.name`. |

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
Expand Down
12 changes: 12 additions & 0 deletions docs/registry/attributes/service.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

# Service

- [Service Attributes](#service-attributes)
- [Service Attributes for Peer Services](#service-attributes-for-peer-services)

## Service Attributes

A service instance.
Expand Down Expand Up @@ -44,3 +47,12 @@ port.
**[2] `service.name`:** MUST be the same for all instances of horizontally scaled services. If the value was not specified, SDKs MUST fallback to `unknown_service:` concatenated with [`process.executable.name`](process.md), e.g. `unknown_service:bash`. If `process.executable.name` is not available, the value MUST be set to `unknown_service`.

**[3] `service.namespace`:** A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace.

## Service Attributes for Peer Services

How to describe the service on the other side of a request.

| Attribute | Type | Description | Examples | Stability |
|---|---|---|---|---|
| <a id="service-peer-name" href="#service-peer-name">`service.peer.name`</a> | string | Logical name of the service on the other side of the connection. SHOULD be equal to the actual [`service.name`](/docs/resource/README.md#service) resource attribute of the remote service if any. | `shoppingcart` | ![Development](https://img.shields.io/badge/-development-blue) |
| <a id="service-peer-namespace" href="#service-peer-namespace">`service.peer.namespace`</a> | string | A namespace for `service.peer.name`. | `Shop` | ![Development](https://img.shields.io/badge/-development-blue) |
4 changes: 3 additions & 1 deletion model/peer/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ groups:
brief: "Operations that access some remote service."
attributes:
- ref: peer.service
requirement_level: recommended
deprecated:
reason: renamed
renamed_to: service.peer.name
Comment on lines +7 to +9
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be specified on the attribute definition/registry and not the usage of it.

Suggested change
deprecated:
reason: renamed
renamed_to: service.peer.name

9 changes: 9 additions & 0 deletions model/service/common.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
groups:
- id: service.peer
type: attribute_group
brief: "Operations that access some remote service."
attributes:
- ref: service.peer.name
requirement_level: recommended
- ref: service.peer.namespace
requirement_level: recommended
19 changes: 19 additions & 0 deletions model/service/registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,22 @@ groups:
for that telemetry. This is typically the case for scraping receivers, as they know the target address and
port.
examples: ["627cc493-f310-47de-96bd-71410b7dec09"]
- id: registry.service.peer
type: attribute_group
display_name: Service Attributes for Peer Services
brief: >
How to describe the service on the other side of a request.
attributes:
- id: service.peer.name
type: string
stability: development
brief: >
Logical name of the service on the other side of the connection.
SHOULD be equal to the actual [`service.name`](/docs/resource/README.md#service) resource attribute of the remote service if any.
examples: ["shoppingcart"]
- id: service.peer.namespace
type: string
stability: development
brief: >
A namespace for `service.peer.name`.
examples: ["Shop"]
Comment on lines +78 to +90
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- id: service.peer.name
type: string
stability: development
brief: >
Logical name of the service on the other side of the connection.
SHOULD be equal to the actual [`service.name`](/docs/resource/README.md#service) resource attribute of the remote service if any.
examples: ["shoppingcart"]
- id: service.peer.namespace
type: string
stability: development
brief: >
A namespace for `service.peer.name`.
examples: ["Shop"]
- id: server.service.name
type: string
stability: development
brief: >
Logical name of the service running on the server side of the connection.
SHOULD be equal to the actual [`service.name`](/docs/resource/README.md#service) resource attribute of the remote service if any.
examples: ["shoppingcart"]
- id: server.service.namespace
type: string
stability: development
brief: >
A namespace for `server.service.name`.
examples: ["Shop"]

Loading