Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resource: Allow service.version to be auto-populated by SDKs #1338

Closed
Show file tree
Hide file tree
Changes from 2 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
18 changes: 12 additions & 6 deletions docs/attributes-registry/service.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@

A service instance.

| Attribute | Type | Description | Examples | Stability |
| --------------------- | ------ | -------------------------------------------------------------------------------------------------------- | -------------------------------------- | ---------------------------------------------------------------- |
| `service.instance.id` | string | The string ID of the service instance. [1] | `627cc493-f310-47de-96bd-71410b7dec09` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `service.name` | string | Logical name of the service. [2] | `shoppingcart` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `service.namespace` | string | A namespace for `service.name`. [3] | `Shop` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `service.version` | string | The version string of the service API or implementation. The format is not defined by these conventions. | `2.0.0`; `a01dbef8a` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| Attribute | Type | Description | Examples | Stability |
| --------------------- | ------ | ------------------------------------------------------------------------------------------------------------ | -------------------------------------- | ---------------------------------------------------------------- |
| `service.instance.id` | string | The string ID of the service instance. [1] | `627cc493-f310-47de-96bd-71410b7dec09` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `service.name` | string | Logical name of the service. [2] | `shoppingcart` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `service.namespace` | string | A namespace for `service.name`. [3] | `Shop` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `service.version` | string | The version string of the service API or implementation. The format is not defined by these conventions. [4] | `2.0.0`; `a01dbef8a` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |

**[1]:** MUST be unique for each instance of the same `service.namespace,service.name` pair (in other words
`service.namespace,service.name,service.instance.id` triplet MUST be globally unique). The ID helps to
Expand Down Expand Up @@ -47,3 +47,9 @@ port.
**[2]:** 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]:** 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.

**[4]:** When languages/platforms offer standard ways to version applications
and/or libraries SDKs MAY offer mechanisms to auto-populate `service.version`
from the standard sources. If SDKs offer an auto-population mechanism it MUST be
an optional feature users opt-into and if `service.version` is manually
populated it MUST take priority over auto-population.
8 changes: 7 additions & 1 deletion docs/resource/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,16 @@ as specified in the [Resource SDK specification](https://github.com/open-telemet
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---|
| [`service.name`](/docs/attributes-registry/service.md) | string | Logical name of the service. [1] | `shoppingcart` | `Required` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| [`service.version`](/docs/attributes-registry/service.md) | string | The version string of the service API or implementation. The format is not defined by these conventions. | `2.0.0`; `a01dbef8a` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| [`service.version`](/docs/attributes-registry/service.md) | string | The version string of the service API or implementation. The format is not defined by these conventions. [2] | `2.0.0`; `a01dbef8a` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |

**[1]:** 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`.

**[2]:** When languages/platforms offer standard ways to version applications
and/or libraries SDKs MAY offer mechanisms to auto-populate `service.version`
from the standard sources. If SDKs offer an auto-population mechanism it MUST be
an optional feature users opt-into and if `service.version` is manually
populated it MUST take priority over auto-population.




Expand Down
6 changes: 6 additions & 0 deletions model/registry/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ groups:
type: string
brief: >
The version string of the service API or implementation. The format is not defined by these conventions.
note: |
When languages/platforms offer standard ways to version applications
and/or libraries SDKs MAY offer mechanisms to auto-populate `service.version`
from the standard sources. If SDKs offer an auto-population mechanism it MUST be
an optional feature users opt-into and if `service.version` is manually
populated it MUST take priority over auto-population.
lmolkova marked this conversation as resolved.
Show resolved Hide resolved
examples: ["2.0.0", "a01dbef8a"]
stability: stable
- id: service.namespace
Expand Down
Loading