Skip to content

Commit edc5967

Browse files
committed
Update to semconv 1.34.0
1 parent 9bca9b6 commit edc5967

File tree

4 files changed

+28
-6
lines changed

4 files changed

+28
-6
lines changed

build.gradle.kts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ val snapshot = true
1111
// end
1212

1313
// The release version of https://github.com/open-telemetry/semantic-conventions used to generate classes
14-
var semanticConventionsVersion = "1.32.0"
14+
var semanticConventionsVersion = "1.34.0"
1515
val schemaUrlVersions = listOf(
1616
semanticConventionsVersion,
17+
"1.33.0",
18+
"1.32.0",
1719
"1.31.0",
1820
"1.30.0",
1921
"1.29.0",

buildscripts/templates/registry/incubating_java/IncubatingSemanticAttributes.java.j2

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,19 @@ public final class {{ my_class_name }} {
4949
{% endif %}
5050
{% endfor %}
5151
// Enum definitions
52-
{% for attribute in ctx.attributes | select("enum") | rejectattr("name", "in", ctx.excluded_attributes) %}
53-
{%- if attribute is stable -%}
52+
{% for attribute in ctx.attributes | select("enum") | rejectattr("name", "in", ctx.excluded_attributes) %}
53+
{% set enum_deprecated_in_favor_of_stable = namespace(value=false) %}
54+
{% if attribute is stable %}
55+
{%- set enum_deprecated_in_favor_of_stable.value = true -%}
56+
{%- endif -%}
57+
{%- for member in attribute.type.members %}
58+
{% if member is experimental %}
59+
{% if not member is deprecated %}
60+
{%- set enum_deprecated_in_favor_of_stable.value = false -%}
61+
{%- endif -%}
62+
{%- endif -%}
63+
{%- endfor %}
64+
{%- if enum_deprecated_in_favor_of_stable.value -%}
5465
{%- set stable_class_link = "io.opentelemetry.semconv." ~ stable_class_name ~ "." ~ (attribute.name | pascal_case) ~ "Values" -%}
5566
/**
5667
* Values for {@link #{{ attribute.name | screaming_snake_case }}}.
@@ -62,11 +73,16 @@ public final class {{ my_class_name }} {
6273
{%- else -%}
6374
/** Values for {@link #{{ attribute.name | screaming_snake_case }}}. */
6475
{%- endif -%}
65-
{% if attribute is stable or attribute is deprecated %}@Deprecated{% endif %}
76+
{% if enum_deprecated_in_favor_of_stable.value or attribute is deprecated %}@Deprecated{% endif %}
6677
public static final class {{ attribute.name | pascal_case }}IncubatingValues {
6778
{%- for member in attribute.type.members %}
68-
{{ [member.brief or (member.id ~ '.')] | comment(indent=4) }}
69-
public static final {{ attribute.type | instantiated_type | map_text("java_enum_type") }} {{ member.id | screaming_snake_case }} = {{ member.value | print_member_value }};
79+
{% if member is experimental or enum_deprecated_in_favor_of_stable.value %}{{ [member.brief or (member.id ~ '.')] | comment(indent=4) }}
80+
{% if member is deprecated %}@Deprecated{% endif %} public static final {{ attribute.type | instantiated_type | map_text("java_enum_type") }} {{ member.id | screaming_snake_case }} = {{ member.value | print_member_value }};
81+
{% elif member is stable %}
82+
{%- set stable_class_link = "io.opentelemetry.semconv." ~ stable_class_name ~ "." ~ (attribute.name | pascal_case) ~ "Values#" ~ (member.id | screaming_snake_case) -%}
83+
{{ [member.brief or (member.id ~ '.'), "@deprecated deprecated in favor of stable {@link " ~ stable_class_link ~ "} value."] | comment(indent=4) }}
84+
@Deprecated public static final {{ attribute.type | instantiated_type | map_text("java_enum_type") }} {{ member.id | screaming_snake_case }} = {{ member.value | print_member_value }};
85+
{%- endif -%}
7086
{%- endfor %}
7187
private {{ attribute.name | pascal_case }}IncubatingValues() {}
7288
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,10 @@ public final class {{ my_class_name }} {
4848
/** Values for {@link #{{ attribute.name | screaming_snake_case }}}. */
4949
public static final class {{ attribute.name | pascal_case }}Values {
5050
{%- for member in attribute.type.members %}
51+
{% if member is stable %}
5152
{{ [member.brief or (member.id ~ '.')] | comment(indent=4) }}
5253
public static final {{ attribute.type | instantiated_type | map_text("java_enum_type") }} {{ member.id | screaming_snake_case }} = {{ member.value | print_member_value }};
54+
{%- endif -%}
5355
{%- endfor %}
5456
private {{ attribute.name | pascal_case }}Values() {}
5557
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
public final class SchemaUrls {
99

10+
public static final String V1_34_0 = "https://opentelemetry.io/schemas/1.34.0";
11+
public static final String V1_33_0 = "https://opentelemetry.io/schemas/1.33.0";
1012
public static final String V1_32_0 = "https://opentelemetry.io/schemas/1.32.0";
1113
public static final String V1_31_0 = "https://opentelemetry.io/schemas/1.31.0";
1214
public static final String V1_30_0 = "https://opentelemetry.io/schemas/1.30.0";

0 commit comments

Comments
 (0)