Skip to content

Commit

Permalink
ID2
Browse files Browse the repository at this point in the history
  • Loading branch information
lmolkova committed Jun 10, 2024
1 parent f7e7451 commit 6390847
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ fun generateTask(taskName: String, incubating: Boolean) {
"-v", "$buildDir/semantic-conventions-${semanticConventionsVersion}/model:/source",
"-v", "$projectDir/buildscripts/templates:/templates",
"-v", "$projectDir/$outputDir:/output",
"library/semconvgen2",
"otel/semconvgen:$generatorVersion",
"--yaml-root", "/source",
"--continue-on-validation-errors", "compatibility",
"code",
Expand Down
6 changes: 5 additions & 1 deletion buildscripts/templates/SemanticAttributes.java.j2
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@
{%- set filtered_enums = filtered_attributes | selectattr('is_enum', 'equalto', true) | list %}
{%- set excluded_namespaces_list = excluded_namespaces.replace("\"", "").split(' ') %}
{%- if root_namespace not in excluded_namespaces_list and filtered_attributes | count > 0 %}
{%- set name_map ={"messaging.client.id":"messaging_client_id2"} -%}
{%- macro to_const_name2(fqn) -%}
{{(name_map[fqn] or fqn) | to_const_name}}
{%- endmacro %}
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
Expand All @@ -64,7 +68,7 @@ import java.util.List;
public final class {{ root_namespace | to_camelcase(True) }}{{ classPrefix }}Attributes {
{%- for attribute in filtered_attributes %}
{% set attribute_const_name = attribute.fqn | to_const_name -%}
{% set attribute_const_name = to_const_name2(attribute.fqn) -%}
/**
* {{attribute.brief | render_markdown(code="{{@code {0}}}", paragraph="{0}")}}
{%- if attribute.note %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,15 @@ public final class MessagingIncubatingAttributes {
longKey("messaging.batch.message_count");

/** A unique identifier for the client that consumes or produces a message. */
public static final AttributeKey<String> MESSAGING_CLIENT_ID = stringKey("messaging.client.id");
public static final AttributeKey<String> MESSAGING_CLIENT_ID2 = stringKey("messaging.client.id");

/**
* Deprecated, use {@code messaging.client.id} instead.
*
* @deprecated Deprecated, use `messaging.client.id` instead.
*/
@Deprecated
public static final AttributeKey<String> MESSAGING_CLIENT_ID = stringKey("messaging.client_id");

/**
* A boolean that is true if the message destination is anonymous (could be unnamed or have
Expand Down

0 comments on commit 6390847

Please sign in to comment.