diff --git a/buildscripts/templates/registry/incubating_java/weaver.yaml b/buildscripts/templates/registry/incubating_java/weaver.yaml index 78b52cfb..34a14c93 100644 --- a/buildscripts/templates/registry/incubating_java/weaver.yaml +++ b/buildscripts/templates/registry/incubating_java/weaver.yaml @@ -1,6 +1,6 @@ params: excluded_namespaces: ["ios", "aspnetcore", "signalr"] - excluded_attributes: ["messaging.client_id"] + excluded_attributes: ["messaging.client_id", "exception.escaped"] comment_formats: javadoc: format: html @@ -19,12 +19,11 @@ templates: filter: > semconv_grouped_attributes({ "exclude_root_namespace": $excluded_namespaces, - "exclude_stability": [], - "exclude_deprecated": false + "exclude_stability": [] }) | map({ root_namespace: .root_namespace, attributes: .attributes, - excluded_attributes: $excluded_attributes[] + excluded_attributes: $excluded_attributes }) application_mode: each file_name: "{{ctx.root_namespace | pascal_case}}IncubatingAttributes.java" diff --git a/buildscripts/templates/registry/java/SemanticAttributes.java.j2 b/buildscripts/templates/registry/java/SemanticAttributes.java.j2 index 415ef81f..d30cfbaa 100644 --- a/buildscripts/templates/registry/java/SemanticAttributes.java.j2 +++ b/buildscripts/templates/registry/java/SemanticAttributes.java.j2 @@ -36,7 +36,7 @@ import java.util.List; // DO NOT EDIT, this is an Auto-generated file from buildscripts/templates/registry/java/SemanticAttributes.java.j2 @SuppressWarnings("unused") public final class {{ my_class_name }} { - {% for attribute in ctx.attributes %}{% if attribute is stable %} + {% for attribute in ctx.attributes | rejectattr("name", "in", ctx.excluded_attributes) %}{% if attribute is stable %} {%- if attribute is deprecated %} {%- set deprecated_javadoc = "@deprecated " ~ attribute.deprecated -%} {%- endif -%} diff --git a/buildscripts/templates/registry/java/weaver.yaml b/buildscripts/templates/registry/java/weaver.yaml index dbc0301f..ef29dbd9 100644 --- a/buildscripts/templates/registry/java/weaver.yaml +++ b/buildscripts/templates/registry/java/weaver.yaml @@ -1,6 +1,8 @@ params: excluded_namespaces: ["ios", "aspnetcore", "signalr"] - excluded_attributes: ["messaging.client_id"] + # excluding "exception.escaped" from stable attributes + # because we are anticipating it being deprecated soon + excluded_attributes: ["messaging.client_id", "exception.escaped"] comment_formats: javadoc: format: html @@ -16,11 +18,14 @@ comment_formats: default_comment_format: javadoc templates: - pattern: SemanticAttributes.java.j2 - filter: > + filter: > semconv_grouped_attributes({ "exclude_root_namespace": $excluded_namespaces, - "exclude_stability": ["experimental", "deprecated"], - "exclude_deprecated": false + "exclude_stability": ["experimental", "deprecated"] + }) | map({ + root_namespace: .root_namespace, + attributes: .attributes, + excluded_attributes: $excluded_attributes }) application_mode: each file_name: "{{ctx.root_namespace | pascal_case}}Attributes.java" diff --git a/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/ExceptionIncubatingAttributes.java b/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/ExceptionIncubatingAttributes.java index e1482add..a7438a8e 100644 --- a/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/ExceptionIncubatingAttributes.java +++ b/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/ExceptionIncubatingAttributes.java @@ -5,7 +5,6 @@ package io.opentelemetry.semconv.incubating; -import static io.opentelemetry.api.common.AttributeKey.booleanKey; import static io.opentelemetry.api.common.AttributeKey.stringKey; import io.opentelemetry.api.common.AttributeKey; @@ -14,34 +13,6 @@ // buildscripts/templates/registry/incubating_java/IncubatingSemanticAttributes.java.j2 @SuppressWarnings("unused") public final class ExceptionIncubatingAttributes { - /** - * SHOULD be set to true if the exception event is recorded at a point where it is known that the - * exception is escaping the scope of the span. - * - *
Notes: - * - *
An exception is considered to have escaped (or left) the scope of a span, if that span is - * ended while the exception is still logically "in flight". This may be actually "in flight" in - * some languages (e.g. if the exception is passed to a Context manager's {@code __exit__} method - * in Python) but will usually be caught at the point of recording the exception in most - * languages. - * - *
It is usually not possible to determine at the point where an exception is thrown whether it - * will escape the scope of a span. However, it is trivial to know that an exception will escape, - * if one checks for an active exception just before ending the span, as done in the example - * for recording span exceptions. - * - *
It follows that an exception may still escape the scope of the span even if the {@code
- * exception.escaped} attribute was not set or set to false, since the event might have been
- * recorded at a time where it was not clear whether the exception will escape.
- *
- * @deprecated deprecated in favor of stable {@link
- * io.opentelemetry.semconv.ExceptionAttributes#EXCEPTION_ESCAPED} attribute.
- */
- @Deprecated
- public static final AttributeKey Notes:
- *
- * An exception is considered to have escaped (or left) the scope of a span, if that span is
- * ended while the exception is still logically "in flight". This may be actually "in flight" in
- * some languages (e.g. if the exception is passed to a Context manager's {@code __exit__} method
- * in Python) but will usually be caught at the point of recording the exception in most
- * languages.
- *
- * It is usually not possible to determine at the point where an exception is thrown whether it
- * will escape the scope of a span. However, it is trivial to know that an exception will escape,
- * if one checks for an active exception just before ending the span, as done in the example
- * for recording span exceptions.
- *
- * It follows that an exception may still escape the scope of the span even if the {@code
- * exception.escaped} attribute was not set or set to false, since the event might have been
- * recorded at a time where it was not clear whether the exception will escape.
- */
- public static final AttributeKey