-
Notifications
You must be signed in to change notification settings - Fork 30
Update to semconv 1.34.0 #217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,7 +36,7 @@ import java.util.List; | |
| // DO NOT EDIT, this is an Auto-generated file from buildscripts/templates/registry/incubating_java/IncubatingSemanticAttributes.java.j2 | ||
| @SuppressWarnings("unused") | ||
| public final class {{ my_class_name }} { | ||
| {% for attribute in ctx.attributes | rejectattr("name", "in", ctx.excluded_attributes) %}{% if attribute is experimental %} | ||
| {% for attribute in ctx.attributes | rejectattr("name", "in", ctx.excluded_attributes) | rejectattr("type", "eq", "any") %}{% if attribute is experimental %} | ||
| {%- if attribute is deprecated %}{%- set deprecated_javadoc = "@deprecated " ~ attribute.deprecated.note -%} | ||
| {%- else -%}{%- set deprecated_javadoc = "" -%} | ||
| {%- endif -%} | ||
|
|
@@ -49,8 +49,19 @@ public final class {{ my_class_name }} { | |
| {% endif %} | ||
| {% endfor %} | ||
| // Enum definitions | ||
| {% for attribute in ctx.attributes | select("enum") | rejectattr("name", "in", ctx.excluded_attributes) %} | ||
| {%- if attribute is stable -%} | ||
| {% for attribute in ctx.attributes | select("enum") | rejectattr("name", "in", ctx.excluded_attributes) %} | ||
| {% set enum_deprecated_in_favor_of_stable = namespace(value=false) %} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does the
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it creates something like an object with a nested attribute think of this code like AtomicBoolean being passed into methods (in this case into a nested if) so you can update the value in the method and then get updated value after the method call |
||
| {% if attribute is stable %} | ||
| {%- set enum_deprecated_in_favor_of_stable.value = true -%} | ||
| {%- endif -%} | ||
| {%- for member in attribute.type.members %} | ||
| {% if member is experimental %} | ||
| {% if not member is deprecated %} | ||
| {%- set enum_deprecated_in_favor_of_stable.value = false -%} | ||
| {%- endif -%} | ||
| {%- endif -%} | ||
| {%- endfor %} | ||
| {%- if enum_deprecated_in_favor_of_stable.value -%} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you summarize what this change is doing?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. when writing incubating model, deprecate the enum class if the attribute has been stabilized and it has no values which are still experimental (other than those which may be deprecated explicitly) (this is to deal with the db system name mixed status where only some values are stabilized |
||
| {%- set stable_class_link = "io.opentelemetry.semconv." ~ stable_class_name ~ "." ~ (attribute.name | pascal_case) ~ "Values" -%} | ||
| /** | ||
| * Values for {@link #{{ attribute.name | screaming_snake_case }}}. | ||
|
|
@@ -62,11 +73,16 @@ public final class {{ my_class_name }} { | |
| {%- else -%} | ||
| /** Values for {@link #{{ attribute.name | screaming_snake_case }}}. */ | ||
| {%- endif -%} | ||
| {% if attribute is stable or attribute is deprecated %}@Deprecated{% endif %} | ||
| {% if enum_deprecated_in_favor_of_stable.value or attribute is deprecated %}@Deprecated{% endif %} | ||
| public static final class {{ attribute.name | pascal_case }}IncubatingValues { | ||
| {%- for member in attribute.type.members %} | ||
| {{ [member.brief or (member.id ~ '.')] | comment(indent=4) }} | ||
| public static final {{ attribute.type | instantiated_type | map_text("java_enum_type") }} {{ member.id | screaming_snake_case }} = {{ member.value | print_member_value }}; | ||
| {% if member is experimental or enum_deprecated_in_favor_of_stable.value %}{{ [member.brief or (member.id ~ '.')] | comment(indent=4) }} | ||
| {% 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 }}; | ||
| {% elif member is stable %} | ||
| {%- set stable_class_link = "io.opentelemetry.semconv." ~ stable_class_name ~ "." ~ (attribute.name | pascal_case) ~ "Values#" ~ (member.id | screaming_snake_case) -%} | ||
| {{ [member.brief or (member.id ~ '.'), "@deprecated deprecated in favor of stable {@link " ~ stable_class_link ~ "} value."] | comment(indent=4) }} | ||
| @Deprecated public static final {{ attribute.type | instantiated_type | map_text("java_enum_type") }} {{ member.id | screaming_snake_case }} = {{ member.value | print_member_value }}; | ||
| {%- endif -%} | ||
| {%- endfor %} | ||
| private {{ attribute.name | pascal_case }}IncubatingValues() {} | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.