Skip to content

Commit 6b843a7

Browse files
committed
Introduce service.peer.name and service.peer.namespace; deprecate peer.service
1 parent 251a2c4 commit 6b843a7

File tree

8 files changed

+117
-3
lines changed

8 files changed

+117
-3
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Use this changelog template to create an entry for release notes.
2+
#
3+
# If your change doesn't affect end users you should instead start
4+
# your pull request title with [chore] or use the "Skip Changelog" label.
5+
6+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
7+
change_type: deprecation
8+
9+
# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db)
10+
component: peer
11+
12+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
13+
note: The `peer.service` attribute has been deprecated in favor of `service.peer.name`.
14+
15+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
16+
# The values here must be integers.
17+
issues: [2945]
18+
19+
# (Optional) One or more lines of additional information to render under the primary note.
20+
# These lines will be padded with 2 spaces and then inserted directly into the document.
21+
# Use pipe (|) for multiline entries.
22+
subtext: The `peer.service` attribute has been renamed to `service.peer.name` to align with the `service.{name|namespace}` resource attributes.

.chloggen/service-peer.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Use this changelog template to create an entry for release notes.
2+
#
3+
# If your change doesn't affect end users you should instead start
4+
# your pull request title with [chore] or use the "Skip Changelog" label.
5+
6+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
7+
change_type: enhancement
8+
9+
# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db)
10+
component: service
11+
12+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
13+
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."
14+
15+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
16+
# The values here must be integers.
17+
issues: [2945]
18+
19+
# (Optional) One or more lines of additional information to render under the primary note.
20+
# These lines will be padded with 2 spaces and then inserted directly into the document.
21+
# Use pipe (|) for multiline entries.
22+
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.

docs/general/attributes.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ Particular operations may refer to or require some of these attributes.
2929
- [Client/server example with forward proxy](#clientserver-example-with-forward-proxy)
3030
- [Network connection and carrier attributes](#network-connection-and-carrier-attributes)
3131
- [General remote service attributes](#general-remote-service-attributes)
32+
- [Service Peer](#service-peer)
33+
- [Peer namespace](#peer-namespace)
3234
- [General thread attributes](#general-thread-attributes)
3335
- [Source code attributes](#source-code-attributes)
3436

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

356358
## General remote service attributes
357359

358-
This attribute may be used for any operation that accesses some remote service.
360+
### Service Peer
361+
362+
Attributes of the `service.peer.*` namespace may also be used for any operation that accesses some remote service.
363+
Users can define what the name of a service is based on their particular semantics in their distributed system.
364+
Instrumentations SHOULD provide a way for users to configure this name.
365+
366+
<!-- semconv service.peer -->
367+
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
368+
<!-- see templates/registry/markdown/snippet.md.j2 -->
369+
<!-- prettier-ignore-start -->
370+
<!-- markdownlint-capture -->
371+
<!-- markdownlint-disable -->
372+
373+
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
374+
|---|---|---|---|---|---|
375+
| [`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) |
376+
| [`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) |
377+
378+
<!-- markdownlint-restore -->
379+
<!-- prettier-ignore-end -->
380+
<!-- END AUTOGENERATED TEXT -->
381+
<!-- endsemconv -->
382+
383+
### Peer namespace
384+
385+
Attributes of the `peer.*` namespace are deprecated, and they used to provide a way to describe any operation that accesses some remote service.
386+
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.
359387
Users can define what the name of a service is based on their particular semantics in their distributed system.
360388
Instrumentations SHOULD provide a way for users to configure this name.
361389

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

369397
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
370398
|---|---|---|---|---|---|
371-
| [`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) |
399+
| [`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`. |
372400

373401
<!-- markdownlint-restore -->
374402
<!-- prettier-ignore-end -->

docs/registry/attributes/service.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33

44
# Service
55

6+
- [Service Attributes](#service-attributes)
7+
- [Service Attributes for Peer Services](#service-attributes-for-peer-services)
8+
69
## Service Attributes
710

811
A service instance.
@@ -44,3 +47,12 @@ port.
4447
**[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`.
4548

4649
**[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.
50+
51+
## Service Attributes for Peer Services
52+
53+
How to describe the service on the other side of a request.
54+
55+
| Attribute | Type | Description | Examples | Stability |
56+
|---|---|---|---|---|
57+
| <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) |
58+
| <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) |

model/peer/common.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ groups:
44
brief: "Operations that access some remote service."
55
attributes:
66
- ref: peer.service
7-
requirement_level: recommended
7+
deprecated:
8+
reason: renamed
9+
renamed_to: service.peer.name
File renamed without changes.

model/service/common.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
groups:
2+
- id: service.peer
3+
type: attribute_group
4+
brief: "Operations that access some remote service."
5+
attributes:
6+
- ref: service.peer.name
7+
requirement_level: recommended
8+
- ref: service.peer.namespace
9+
requirement_level: recommended

model/service/registry.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,22 @@ groups:
6969
for that telemetry. This is typically the case for scraping receivers, as they know the target address and
7070
port.
7171
examples: ["627cc493-f310-47de-96bd-71410b7dec09"]
72+
- id: registry.service.peer
73+
type: attribute_group
74+
display_name: Service Attributes for Peer Services
75+
brief: >
76+
How to describe the service on the other side of a request.
77+
attributes:
78+
- id: service.peer.name
79+
type: string
80+
stability: development
81+
brief: >
82+
Logical name of the service on the other side of the connection.
83+
SHOULD be equal to the actual [`service.name`](/docs/resource/README.md#service) resource attribute of the remote service if any.
84+
examples: ["shoppingcart"]
85+
- id: service.peer.namespace
86+
type: string
87+
stability: development
88+
brief: >
89+
A namespace for `service.peer.name`.
90+
examples: ["Shop"]

0 commit comments

Comments
 (0)