Skip to content

Commit

Permalink
Update semantic convention constants generator script, template and s…
Browse files Browse the repository at this point in the history
…pec reference

The template was updated to reflect the changes introduced in otel/semconvgen v0.3.0 and v0.3.1.
The script was updated to pin the version of the otel/semconvgen image, otherwise incompatible updates would break it.

Fixes open-telemetry#3042.
  • Loading branch information
arminru committed Apr 15, 2021
1 parent 50408d4 commit d6dabf6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions buildscripts/semantic-convention/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ROOT_DIR="${SCRIPT_DIR}/../../"

# freeze the spec & generator tools versions to make SemanticAttributes generation reproducible
SPEC_VERSION=v1.1.0
GENERATOR_VERSION=0.2.1
SPEC_VERSION=v1.2.0
GENERATOR_VERSION=0.3.1

cd ${SCRIPT_DIR}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
List<String>
{%- elif type == "boolean" -%}
boolean
{%- elif type == "number" -%}
{%- elif type == "int" -%}
long
{%- elif type == "double" -%}
double
{%- else -%}
{{type}}
{%- endif -%}
Expand All @@ -24,8 +26,10 @@
stringArrayKey
{%- elif type == "boolean" -%}
booleanKey
{%- elif type == "number" -%}
{%- elif type == "int" -%}
longKey
{%- elif type == "double" -%}
doubleKey
{%- else -%}
{{lowerFirst(type)}}Key
{%- endif -%}
Expand All @@ -43,6 +47,7 @@
package {{pkg | trim}};

import static io.opentelemetry.api.common.AttributeKey.booleanKey;
import static io.opentelemetry.api.common.AttributeKey.doubleKey;
import static io.opentelemetry.api.common.AttributeKey.longKey;
import static io.opentelemetry.api.common.AttributeKey.stringKey;
import static io.opentelemetry.api.common.AttributeKey.stringArrayKey;
Expand Down

0 comments on commit d6dabf6

Please sign in to comment.