Skip to content

Commit

Permalink
generate semconv 1.24.0 (#1219)
Browse files Browse the repository at this point in the history
* generate semconv 1.24.0
generate latest semconv version, and add back Trace and Resource attribute values which
seem to have been dropped in a previous change.

* document source repo release urls

* remove redundant semconv deprecations
two trace attributes were deleted then added back to upstream semconv, so remove our ones.
  • Loading branch information
brettmc authored Jan 23, 2024
1 parent 1af8334 commit 810aa2f
Show file tree
Hide file tree
Showing 6 changed files with 2,228 additions and 73 deletions.
38 changes: 37 additions & 1 deletion script/semantic-conventions/semconv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@
# Supported semantic conventions:
# - Trace
# - Resource
#
# Source repositories:
# - https://github.com/open-telemetry/semantic-conventions/releases
# - https://github.com/open-telemetry/build-tools/releases

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ROOT_DIR="${SCRIPT_DIR}/../../"
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.23.1}
SEMCONV_VERSION=${SEMCONV_VERSION:=1.24.0}
SPEC_VERSION=v$SEMCONV_VERSION
SCHEMA_URL=https://opentelemetry.io/schemas/$SEMCONV_VERSION
GENERATOR_VERSION=0.23.0
Expand Down Expand Up @@ -65,4 +69,36 @@ docker run --rm \
-Dclass="Resource" \
-DschemaUrl=$SCHEMA_URL

# Trace attribute values
docker run --rm \
-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 \
--yaml-root /source \
code \
--template /templates/AttributeValues.php.j2 \
--output "/output/TraceAttributeValues.php" \
-Dnamespace="OpenTelemetry\\SemConv" \
-Dclass="Trace" \
-DschemaUrl=$SCHEMA_URL

# Resource attribute values
docker run --rm \
-v "${SPEC_DIR}/model:/source" \
-v "${SCRIPT_DIR}/templates:/templates" \
-v "${CODE_DIR}:/output" \
-u "${UID}" \
otel/semconvgen:$GENERATOR_VERSION \
--only resource \
--yaml-root /source \
code \
--template /templates/AttributeValues.php.j2 \
--output "/output/ResourceAttributeValues.php" \
-Dnamespace="OpenTelemetry\\SemConv" \
-Dclass="Resource" \
-DschemaUrl=$SCHEMA_URL

rm -rf "${SPEC_DIR}" || true
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@
*/
public const HTTP_SERVER_NAME = 'http.server_name';

/**
* @deprecated
*/
public const HTTP_USER_AGENT = 'http.user_agent';

/**
* @deprecated
*/
Expand Down Expand Up @@ -93,11 +88,6 @@
*/
public const HTTP_CLIENT_IP = 'http.client_ip';

/**
* @deprecated
*/
public const HTTP_FLAVOR = 'http.flavor';

/**
* @deprecated
*/
Expand Down Expand Up @@ -207,3 +197,18 @@
* @deprecated
*/
public const THREAD_DAEMON = 'thread.daemon';

/**
* @deprecated
*/
public const EVENT_DOMAIN = 'event.domain';

/**
* @deprecated
*/
public const SYSTEM_DISK_DIRECTION = 'system.disk.direction';

/**
* @deprecated
*/
public const SYSTEM_NETWORK_DIRECTION = 'system.network.direction';
Loading

0 comments on commit 810aa2f

Please sign in to comment.