Skip to content

Commit

Permalink
fix schema_url constants in semconv (#4069)
Browse files Browse the repository at this point in the history
  • Loading branch information
emdneto authored Jul 22, 2024
1 parent e3467d4 commit 8749168
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 10 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#3991](https://github.com/open-telemetry/opentelemetry-python/pull/3991))
- Add attributes field in `MeterProvider.get_meter` and `InstrumentationScope`
([#4015](https://github.com/open-telemetry/opentelemetry-python/pull/4015))
- Fix inaccessible `SCHEMA_URL` constants in `opentelemetry-semantic-conventions`
([#4069](https://github.com/open-telemetry/opentelemetry-python/pull/4069))

## Version 1.25.0/0.46b0 (2024-05-30)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
reason="Use metrics defined in the :py:const:`opentelemetry.semconv.metrics` and :py:const:`opentelemetry.semconv._incubating.metrics` modules instead.",
) # type: ignore
class MetricInstruments:
SCHEMA_URL = "https://opentelemetry.io/schemas/v1.21.0"
SCHEMA_URL = "https://opentelemetry.io/schemas/1.21.0"
"""
The URL of the OpenTelemetry schema for these keys and values.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
reason="Use attributes defined in the :py:const:`opentelemetry.semconv.attributes` and :py:const:`opentelemetry.semconv._incubating.attributes` modules instead.",
) # type: ignore
class ResourceAttributes:
SCHEMA_URL = "https://opentelemetry.io/schemas/v1.21.0"
SCHEMA_URL = "https://opentelemetry.io/schemas/1.21.0"
"""
The URL of the OpenTelemetry schema for these keys and values.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ class Schemas(Enum):
The URL of the OpenTelemetry schema version 1.23.1.
"""

V1_25_0 = "https://opentelemetry.io/schemas/v1.25.0"
V1_25_0 = "https://opentelemetry.io/schemas/1.25.0"
"""
The URL of the OpenTelemetry schema version v1.25.0.
The URL of the OpenTelemetry schema version 1.25.0.
"""

V1_26_0 = "https://opentelemetry.io/schemas/v1.26.0"
V1_26_0 = "https://opentelemetry.io/schemas/1.26.0"
"""
The URL of the OpenTelemetry schema version v1.26.0.
The URL of the OpenTelemetry schema version 1.26.0.
"""

# when generating new semantic conventions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
reason="Use attributes defined in the :py:const:`opentelemetry.semconv.attributes` and :py:const:`opentelemetry.semconv._incubating.attributes` modules instead.",
) # type: ignore
class SpanAttributes:
SCHEMA_URL = "https://opentelemetry.io/schemas/v1.21.0"
SCHEMA_URL = "https://opentelemetry.io/schemas/1.21.0"
"""
The URL of the OpenTelemetry schema for these keys and values.
"""
Expand Down
7 changes: 4 additions & 3 deletions scripts/semconv/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ROOT_DIR="${SCRIPT_DIR}/../../"

# freeze the spec version to make SemanticAttributes generation reproducible
SEMCONV_VERSION=v1.26.0
OTEL_SEMCONV_GEN_IMG_VERSION=0.24.0
SEMCONV_VERSION=1.26.0
SEMCONV_VERSION_TAG=v$SEMCONV_VERSION
OTEL_SEMCONV_GEN_IMG_VERSION=0.25.0
INCUBATING_DIR=_incubating
cd ${SCRIPT_DIR}

Expand All @@ -16,7 +17,7 @@ cd semantic-conventions

git init
git remote add origin https://github.com/open-telemetry/semantic-conventions.git
git fetch origin "$SEMCONV_VERSION"
git fetch origin "$SEMCONV_VERSION_TAG"
git reset --hard FETCH_HEAD
cd ${SCRIPT_DIR}

Expand Down

0 comments on commit 8749168

Please sign in to comment.