Skip to content

Commit 4ac4a91

Browse files
committed
Exclude exception.escaped from (to-be-stable) artifact
1 parent 828296f commit 4ac4a91

File tree

4 files changed

+12
-33
lines changed

4 files changed

+12
-33
lines changed

buildscripts/templates/registry/incubating_java/weaver.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,11 @@ templates:
1919
filter: >
2020
semconv_grouped_attributes({
2121
"exclude_root_namespace": $excluded_namespaces,
22-
"exclude_stability": [],
23-
"exclude_deprecated": false
22+
"exclude_stability": []
2423
}) | map({
2524
root_namespace: .root_namespace,
2625
attributes: .attributes,
27-
excluded_attributes: $excluded_attributes[]
26+
excluded_attributes: $excluded_attributes
2827
})
2928
application_mode: each
3029
file_name: "{{ctx.root_namespace | pascal_case}}IncubatingAttributes.java"

buildscripts/templates/registry/java/SemanticAttributes.java.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import java.util.List;
3636
// DO NOT EDIT, this is an Auto-generated file from buildscripts/templates/registry/java/SemanticAttributes.java.j2
3737
@SuppressWarnings("unused")
3838
public final class {{ my_class_name }} {
39-
{% for attribute in ctx.attributes %}{% if attribute is stable %}
39+
{% for attribute in ctx.attributes | rejectattr("name", "in", ctx.excluded_attributes) %}{% if attribute is stable %}
4040
{%- if attribute is deprecated %}
4141
{%- set deprecated_javadoc = "@deprecated " ~ attribute.deprecated -%}
4242
{%- endif -%}

buildscripts/templates/registry/java/weaver.yaml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
params:
22
excluded_namespaces: ["ios", "aspnetcore", "signalr"]
3-
excluded_attributes: ["messaging.client_id"]
3+
# excluding "exception.escaped" from stable attributes
4+
# because we are anticipating it being deprecated soon
5+
excluded_attributes: ["messaging.client_id", "exception.escaped"]
46
comment_formats:
57
javadoc:
68
format: html
@@ -16,11 +18,14 @@ comment_formats:
1618
default_comment_format: javadoc
1719
templates:
1820
- pattern: SemanticAttributes.java.j2
19-
filter: >
21+
filter: >
2022
semconv_grouped_attributes({
2123
"exclude_root_namespace": $excluded_namespaces,
22-
"exclude_stability": ["experimental", "deprecated"],
23-
"exclude_deprecated": false
24+
"exclude_stability": ["experimental", "deprecated"]
25+
}) | map({
26+
root_namespace: .root_namespace,
27+
attributes: .attributes,
28+
excluded_attributes: $excluded_attributes
2429
})
2530
application_mode: each
2631
file_name: "{{ctx.root_namespace | pascal_case}}Attributes.java"

semconv/src/main/java/io/opentelemetry/semconv/ExceptionAttributes.java

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
package io.opentelemetry.semconv;
77

8-
import static io.opentelemetry.api.common.AttributeKey.booleanKey;
98
import static io.opentelemetry.api.common.AttributeKey.stringKey;
109

1110
import io.opentelemetry.api.common.AttributeKey;
@@ -14,30 +13,6 @@
1413
// buildscripts/templates/registry/java/SemanticAttributes.java.j2
1514
@SuppressWarnings("unused")
1615
public final class ExceptionAttributes {
17-
/**
18-
* SHOULD be set to true if the exception event is recorded at a point where it is known that the
19-
* exception is escaping the scope of the span.
20-
*
21-
* <p>Notes:
22-
*
23-
* <p>An exception is considered to have escaped (or left) the scope of a span, if that span is
24-
* ended while the exception is still logically "in flight". This may be actually "in flight" in
25-
* some languages (e.g. if the exception is passed to a Context manager's {@code __exit__} method
26-
* in Python) but will usually be caught at the point of recording the exception in most
27-
* languages.
28-
*
29-
* <p>It is usually not possible to determine at the point where an exception is thrown whether it
30-
* will escape the scope of a span. However, it is trivial to know that an exception will escape,
31-
* if one checks for an active exception just before ending the span, as done in the <a
32-
* href="https://opentelemetry.io/docs/specs/semconv/exceptions/exceptions-spans/#recording-an-exception">example
33-
* for recording span exceptions</a>.
34-
*
35-
* <p>It follows that an exception may still escape the scope of the span even if the {@code
36-
* exception.escaped} attribute was not set or set to false, since the event might have been
37-
* recorded at a time where it was not clear whether the exception will escape.
38-
*/
39-
public static final AttributeKey<Boolean> EXCEPTION_ESCAPED = booleanKey("exception.escaped");
40-
4116
/** The exception message. */
4217
public static final AttributeKey<String> EXCEPTION_MESSAGE = stringKey("exception.message");
4318

0 commit comments

Comments
 (0)