Skip to content

Commit 0682797

Browse files
committed
Introduce the new requirement levels
1 parent 15f0d88 commit 0682797

File tree

4 files changed

+71
-3
lines changed

4 files changed

+71
-3
lines changed

docs/exceptions/exceptions-spans.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ This event describes a single exception.
3535
|---|---|---|---|---|---|
3636
| [`exception.message`](/docs/registry/attributes/exception.md) | string | The exception message. | `Division by zero`; `Can't convert 'int' object to str implicitly` | `Conditionally Required` [1] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
3737
| [`exception.type`](/docs/registry/attributes/exception.md) | string | The type of the exception (its fully-qualified class name, if applicable). The dynamic type of the exception should be preferred over the static type in languages that support it. | `java.net.ConnectException`; `OSError` | `Conditionally Required` [2] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
38-
| [`exception.escaped`](/docs/registry/attributes/exception.md) | boolean | Indicates that the exception is escaping the scope of the span. | | `Recommended` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>It's no longer recommended to record exceptions that are handled and do not escape the scope of a span. |
38+
| [`exception.escaped`](/docs/registry/attributes/exception.md) | boolean | Indicates that the exception is escaping the scope of the span. | | `Remove` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>It's no longer recommended to record exceptions that are handled and do not escape the scope of a span. |
3939
| [`exception.stacktrace`](/docs/registry/attributes/exception.md) | string | A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG. | `Exception in thread "main" java.lang.RuntimeException: Test exception\n at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\n at com.example.GenerateTrace.methodA(GenerateTrace.java:9)\n at com.example.GenerateTrace.main(GenerateTrace.java:5)` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
4040

4141
**[1] `exception.message`:** Required if `exception.type` is not set, recommended otherwise.

docs/general/attribute-requirement-level.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,71 @@ particularly expensive to retrieve or might pose a security or privacy risk.
112112
These should therefore only be enabled explicitly by a user making an informed
113113
decision.
114114

115+
## Migrate
116+
117+
The migrate requirement level is reserved for deprecated attributes and is
118+
designed to help support a allowing for a phased rollout of the stable semantic conventions.
119+
Under no circumstances should this attribute be added to an existing instrumentation.
120+
121+
The type of instrumentation helps to determine how the attribute should be handled, see below.
122+
123+
### Stable Instrumentation
124+
125+
Should continue emitting the attribute unless:
126+
* User has set the domain ie `database` via the `OTEL_SEMCONV_STABILITY_OPT_IN` environment variable.
127+
* User has excluded the attribute via explicit configuration
128+
* The instrumentation bumps it's major version but will continue providing security patches for
129+
the previous major version for at least 6 months.
130+
131+
Removal can occur when the major version is bumped provided previous major version will/has recieved 6 months of security patches from the time the replacement attribute is introduced.
132+
133+
### Long-term Unstable Instrumentation
134+
135+
> [!NOTE]
136+
> Example's of long term unstable instrumentation, would be the OpenTelemetry Contrib packages as
137+
> their stability is following that of the signal they are implementing.
138+
139+
Should stop emitting the attribute unless:
140+
* User has set the domain ie `database/dup` via the `OTEL_SEMCONV_STABILITY_OPT_IN` environment variable.
141+
* User has included the attribute via explicit configuration
142+
143+
Removal can occur when the deployment level of the package changes. For instance a beta package moves to release candidate.
144+
145+
### Unstable Instrumentation
146+
147+
Removal can occur once the new attribute is implemented,
148+
provided that the instrumentation does not fall into any of the other categories.
149+
Should that be the case the guidance for that category should be followed.
150+
151+
## Remove
152+
153+
The remove requirement level is reserved for deprecated attributes that are no longer relevant.
154+
Under no circumstances should this attribute be added to an existing instrumentation.
155+
156+
The type of instrumentation helps to determine how the attribute should be handled, see below.
157+
158+
### Stable Instrumentation
159+
160+
Should continue emitting the attribute unless:
161+
* User has excluded the attribute via explicit configuration
162+
* The instrumentation bumps it's major version but will continue providing security patches for
163+
the previous major version for at least 6 months.
164+
165+
Removal can occur when the major version is bumped provided previous major version will/has recieved 6 months of security patches from the time the replacement attribute is introduced.
166+
167+
### Long-term Unstable Instrumentation
168+
169+
Should stop emitting the attribute unless:
170+
* User has included the attribute via explicit configuration
171+
172+
Removal can occur when the deployment level of the package changes. For instance a beta package moves to release candidate.
173+
174+
### Unstable Instrumentation
175+
176+
Can remove attribute at any time,
177+
provided that the instrumentation does not fall into any of the other categories.
178+
Should that be the case the guidance for that category should be followed.
179+
115180
## Performance suggestions
116181

117182
Here are several examples of expensive operations to be avoided by default:

templates/registry/markdown/attribute_table.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
{#- Macro for creating attribute table -#}
99
{% macro generate(attributes, tag_filter, attribute_registry_base_url, lineage_attributes) %}{% if (tag_filter | length == 0) %}{% set filtered_attributes = attributes %}{% else %}{% set filtered_attributes = attributes | selectattr("tag", "in", tag_filter) %}{% endif %}{% if filtered_attributes | length > 0 %}| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
1010
|---|---|---|---|---|---|
11-
{% for attribute in filtered_attributes | attribute_sort %}| {{ attrs.name_with_link(attribute, attribute_registry_base_url, lineage_attributes) }} | {{ attrs.type(attribute) }} | {{ attribute.brief | trim }}{{ notes.add({"note": attribute.note, "name": attrs.name(attribute)}) }} | {{ examples.format(attribute) | trim }} | {{ requirement.render({"level": attribute.requirement_level, "name": attrs.name(attribute)}, notes) | trim }} | {{ stability.badge(attribute.stability, attribute.deprecated, attribute.brief) | trim }} |
11+
{% for attribute in filtered_attributes | attribute_sort %}| {{ attrs.name_with_link(attribute, attribute_registry_base_url, lineage_attributes) }} | {{ attrs.type(attribute) }} | {{ attribute.brief | trim }}{{ notes.add({"note": attribute.note, "name": attrs.name(attribute)}) }} | {{ examples.format(attribute) | trim }} | {{ requirement.render({"level": attribute.requirement_level, "name": attrs.name(attribute), "deprecated": attribute.deprecated}, notes) | trim }} | {{ stability.badge(attribute.stability, attribute.deprecated, attribute.brief) | trim }} |
1212
{% endfor %}{{ notes.render() }}{{ sampling.snippet(filtered_attributes, attribute_registry_base_url, lineage_attributes) }}{{ enums.tables(filtered_attributes | selectattr("type", "mapping"), notes) }}
1313
{% endif %}{% endmacro %}

templates/registry/markdown/requirement.j2

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{% macro render(attr, notes) -%}
2-
{%- if attr.level == "recommended" %}`Recommended`
2+
{%- if attr.deprecated and attr.deprecated.reason == "renamed" %}`Migrate`
3+
{% elif attr.deprecated and attr.deprecated.reason == "obsoleted" %}`Remove`
4+
{% elif attr.deprecated and attr.deprecated.reason == "uncategorized" %}`Migrate`
5+
{% elif attr.level == "recommended" %}`Recommended`
36
{% elif attr.level == "required" %}`Required`
47
{% elif attr.level == "opt_in" %}`Opt-In`
58
{% elif attr.level.conditionally_required %}`Conditionally Required`{{ notes.add_with_limit({"note": attr.level.conditionally_required, "name": attr.name}) }}

0 commit comments

Comments
 (0)