Skip to content

Commit

Permalink
Merge experimental and stable attributes per resource type. (#1423)
Browse files Browse the repository at this point in the history
Co-authored-by: Joao Grassi <[email protected]>
  • Loading branch information
jsuereth and joaopgrassi authored Nov 6, 2024
1 parent de8f94e commit 2ce39aa
Show file tree
Hide file tree
Showing 10 changed files with 62 additions and 59 deletions.
23 changes: 23 additions & 0 deletions .chloggen/1423.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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: bug_fix

# 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: "Merge `resource` experimental and stable groups for service and telemetry.sdk"

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

# (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: |
Discovered when fixing [weaver#306](https://github.com/open-telemetry/weaver/issues/306#issue-2458430277)
45 changes: 10 additions & 35 deletions docs/resource/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ This document defines standard attributes for resources. These attributes are ty
- [Semantic Attributes with Dedicated Environment Variable](#semantic-attributes-with-dedicated-environment-variable)
- [Semantic Attributes with SDK-provided Default Value](#semantic-attributes-with-sdk-provided-default-value)
- [Service](#service)
- [Service (Experimental)](#service-experimental)
- [Telemetry SDK](#telemetry-sdk)
- [Telemetry Distribution (Experimental)](#telemetry-distribution-experimental)
- [Telemetry Distro](#telemetry-distro)
- [Compute Unit](#compute-unit)
- [Compute Instance](#compute-instance)
- [Environment](#environment)
Expand Down Expand Up @@ -81,7 +80,7 @@ as specified in the [Resource SDK specification](https://github.com/open-telemet
<!-- markdownlint-disable -->


**Status:** ![Stable](https://img.shields.io/badge/-stable-lightgreen)
**Status:** ![Mixed](https://img.shields.io/badge/-mixed-yellow)

**type:** `service`

Expand All @@ -90,37 +89,13 @@ 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.instance.id`](/docs/attributes-registry/service.md) | string | The string ID of the service instance. [2] | `627cc493-f310-47de-96bd-71410b7dec09` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`service.namespace`](/docs/attributes-registry/service.md) | string | A namespace for `service.name`. [3] | `Shop` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`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) |

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

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

## Service (Experimental)

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


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

**type:** `service`

**Description:** A service instance.

| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---|
| [`service.instance.id`](/docs/attributes-registry/service.md) | string | The string ID of the service instance. [1] | `627cc493-f310-47de-96bd-71410b7dec09` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`service.namespace`](/docs/attributes-registry/service.md) | string | A namespace for `service.name`. [2] | `Shop` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

**[1]:** MUST be unique for each instance of the same `service.namespace,service.name` pair (in other words
**[2]:** 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
distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled
service).
Expand All @@ -147,7 +122,7 @@ However, Collectors can set the `service.instance.id` if they can unambiguously
for that telemetry. This is typically the case for scraping receivers, as they know the target address and
port.

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

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
Expand Down Expand Up @@ -219,9 +194,9 @@ All custom identifiers SHOULD be stable across different versions of an implemen
<!-- END AUTOGENERATED TEXT -->
<!-- endsemconv -->

## Telemetry Distribution (Experimental)
## Telemetry Distro

<!-- semconv telemetry.sdk_experimental -->
<!-- semconv telemetry.distro -->
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/snippet.md.j2 -->
<!-- prettier-ignore-start -->
Expand All @@ -231,9 +206,9 @@ All custom identifiers SHOULD be stable across different versions of an implemen

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

**type:** `telemetry.sdk`
**type:** `telemetry.distro`

**Description:** The telemetry SDK used to capture data recorded by the instrumentation libraries.
**Description:** The distribution of telemetry SDK used to capture data recorded by the instrumentation libraries.

| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---|
Expand Down
2 changes: 1 addition & 1 deletion docs/resource/browser.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<!-- markdownlint-disable -->


**Status:** ![Experimental](https://img.shields.io/badge/-experimental-blue)
**Status:** ![Mixed](https://img.shields.io/badge/-mixed-yellow)

**type:** `browser`

Expand Down
9 changes: 0 additions & 9 deletions model/service/resources-experimental.yaml

This file was deleted.

2 changes: 2 additions & 0 deletions model/service/resources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ groups:
- ref: service.name
requirement_level: required
- ref: service.version
- ref: service.namespace
- ref: service.instance.id
11 changes: 0 additions & 11 deletions model/telemetry/resources-experimental.yaml

This file was deleted.

11 changes: 11 additions & 0 deletions model/telemetry/resources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,14 @@ groups:
requirement_level: required
- ref: telemetry.sdk.version
requirement_level: required
- id: telemetry.distro
name: 'telemetry.distro'
type: resource
stability: experimental
brief: >
The distribution of telemetry SDK used to capture data recorded by the instrumentation libraries.
attributes:
- ref: telemetry.distro.name
requirement_level: recommended
- ref: telemetry.distro.version
requirement_level: recommended
8 changes: 6 additions & 2 deletions policies/group_stability.rego
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ deny[group_stability_violation(description, group.id, name)] {
group.type != "attribute_group"
group.stability == "stable"

# TODO: https://github.com/open-telemetry/semantic-conventions/issues/1514
exceptions = {"metric.kestrel.connection.duration", "metric.kestrel.tls_handshake.duration"}
exceptions = {
# TODO: https://github.com/open-telemetry/semantic-conventions/issues/1514
"metric.kestrel.connection.duration", "metric.kestrel.tls_handshake.duration",
# TODO: https://github.com/open-telemetry/semantic-conventions/issues/1519
"service",
}
not exceptions[group.id]

attr := group.attributes[_]
Expand Down
9 changes: 8 additions & 1 deletion templates/registry/markdown/resource_macros.j2
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
{#- Macros for simplifying creating "Resource" documentation. -#}
{% import 'stability.j2' as stability %}
{% macro real_stability(resource) %}
{% if resource.attributes | map(attribute='stability') | unique | length > 1 -%}
{{ stability.badge("mixed", "") }}
{%- else -%}
{{ stability.badge(resource.stability, resource.deprecated) }}
{%- endif %}
{% endmacro %}
{% macro header(resource) %}
**Status:** {{ stability.badge(resource.stability, resource.deprecated) }}
**Status:** {{ real_stability(resource) | trim }}

**type:** `{{ resource.name }}`

Expand Down
1 change: 1 addition & 0 deletions templates/registry/markdown/stability.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% macro badge(stability, deprecated) -%}
{%- if deprecated %}![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>{{ deprecated | trim }}
{%- elif stability == "mixed" %}![Mixed](https://img.shields.io/badge/-mixed-yellow)
{%- elif stability == "stable" %}![Stable](https://img.shields.io/badge/-stable-lightgreen)
{%- elif stability == "deprecated" %}![Deprecated](https://img.shields.io/badge/-deprecated-red)
{%- else %}![Experimental](https://img.shields.io/badge/-experimental-blue)
Expand Down

0 comments on commit 2ce39aa

Please sign in to comment.