Skip to content

Commit

Permalink
update semver to 1.22.0
Browse files Browse the repository at this point in the history
Since 1.19.0, the source has been split out of opentelemetry-specifiction into semantic-conventions. Update the build script accordingly.
Update to latest generator.
Add 2 new deprecations for semconvs which were renamed since 1.19
  • Loading branch information
brettmc committed Oct 13, 2023
1 parent ea86fe1 commit cb5adc8
Show file tree
Hide file tree
Showing 4 changed files with 1,550 additions and 775 deletions.
18 changes: 10 additions & 8 deletions script/semantic-conventions/semconv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ROOT_DIR="${SCRIPT_DIR}/../../"
SPEC_DIR="${ROOT_DIR}/var/opentelemetry-specification"
SPEC_DIR="${ROOT_DIR}/var/semantic-conventions"
CODE_DIR="${ROOT_DIR}/src/SemConv"

# freeze the spec & generator tools versions to make SemanticAttributes generation reproducible
SEMCONV_VERSION=${SEMCONV_VERSION:=1.19.0}
SEMCONV_VERSION=${SEMCONV_VERSION:=1.22.0}
SPEC_VERSION=v$SEMCONV_VERSION
SCHEMA_URL=https://opentelemetry.io/schemas/$SEMCONV_VERSION
GENERATOR_VERSION=0.18.0
GENERATOR_VERSION=0.22.0

cd "${SCRIPT_DIR}" || exit

Expand All @@ -24,7 +24,7 @@ mkdir "${SPEC_DIR}"
cd "${SPEC_DIR}" || exit

git init -b main
git remote add origin https://github.com/open-telemetry/opentelemetry-specification.git
git remote add origin https://github.com/open-telemetry/semantic-conventions.git
git fetch origin "$SPEC_VERSION"
git reset --hard FETCH_HEAD

Expand All @@ -35,13 +35,14 @@ find "${CODE_DIR}" -name "*.php" -exec rm -f {} \;

# Trace
docker run --rm \
-v "${SPEC_DIR}/semantic_conventions:/source" \
-v "${SPEC_DIR}/model:/source" \
-v "${SCRIPT_DIR}/templates:/templates" \
-v "${CODE_DIR}:/output" \
-u "${UID}" \
otel/semconvgen:$GENERATOR_VERSION \
--only span,event,attribute_group,scope \
-f /source code \
--yaml-root /source \
code \
--template /templates/Attributes.php.j2 \
--output "/output/TraceAttributes.php" \
-Dnamespace="OpenTelemetry\\SemConv" \
Expand All @@ -50,13 +51,14 @@ docker run --rm \

# Resource
docker run --rm \
-v "${SPEC_DIR}/semantic_conventions:/source" \
-v "${SPEC_DIR}/model:/source" \
-v "${SCRIPT_DIR}/templates:/templates" \
-v "${CODE_DIR}:/output" \
-u "${UID}" \
otel/semconvgen:$GENERATOR_VERSION \
--only resource \
-f /source code \
--yaml-root /source \
code \
--template /templates/Attributes.php.j2 \
--output "/output/ResourceAttributes.php" \
-Dnamespace="OpenTelemetry\\SemConv" \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
/**
* @deprecated
* @deprecated Use USER_AGENT_ORIGINAL
*/
public const BROWSER_USER_AGENT = 'browser.user_agent';

/**
* @deprecated
* @deprecated Use CLOUD_RESOURCE_ID
*/
public const FAAS_ID = 'faas.id';

/**
* @deprecated Use TELEMETRY_DISTRO_VERSION
*/
public const TELEMETRY_AUTO_VERSION = 'telemetry.auto.version';

/**
* @deprecated Use CONTAINER_IMAGE_TAGS
*/
public const CONTAINER_IMAGE_TAG = 'container.image.tag';
Loading

0 comments on commit cb5adc8

Please sign in to comment.