Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8749168

Browse files
authored
fix schema_url constants in semconv (open-telemetry#4069)
1 parent e3467d4 commit 8749168

File tree

6 files changed

+13
-10
lines changed

6 files changed

+13
-10
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5252
([#3991](https://github.com/open-telemetry/opentelemetry-python/pull/3991))
5353
- Add attributes field in `MeterProvider.get_meter` and `InstrumentationScope`
5454
([#4015](https://github.com/open-telemetry/opentelemetry-python/pull/4015))
55+
- Fix inaccessible `SCHEMA_URL` constants in `opentelemetry-semantic-conventions`
56+
([#4069](https://github.com/open-telemetry/opentelemetry-python/pull/4069))
5557

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

opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
reason="Use metrics defined in the :py:const:`opentelemetry.semconv.metrics` and :py:const:`opentelemetry.semconv._incubating.metrics` modules instead.",
2121
) # type: ignore
2222
class MetricInstruments:
23-
SCHEMA_URL = "https://opentelemetry.io/schemas/v1.21.0"
23+
SCHEMA_URL = "https://opentelemetry.io/schemas/1.21.0"
2424
"""
2525
The URL of the OpenTelemetry schema for these keys and values.
2626
"""

opentelemetry-semantic-conventions/src/opentelemetry/semconv/resource/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
reason="Use attributes defined in the :py:const:`opentelemetry.semconv.attributes` and :py:const:`opentelemetry.semconv._incubating.attributes` modules instead.",
2525
) # type: ignore
2626
class ResourceAttributes:
27-
SCHEMA_URL = "https://opentelemetry.io/schemas/v1.21.0"
27+
SCHEMA_URL = "https://opentelemetry.io/schemas/1.21.0"
2828
"""
2929
The URL of the OpenTelemetry schema for these keys and values.
3030
"""

opentelemetry-semantic-conventions/src/opentelemetry/semconv/schemas.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ class Schemas(Enum):
2121
The URL of the OpenTelemetry schema version 1.23.1.
2222
"""
2323

24-
V1_25_0 = "https://opentelemetry.io/schemas/v1.25.0"
24+
V1_25_0 = "https://opentelemetry.io/schemas/1.25.0"
2525
"""
26-
The URL of the OpenTelemetry schema version v1.25.0.
26+
The URL of the OpenTelemetry schema version 1.25.0.
2727
"""
2828

29-
V1_26_0 = "https://opentelemetry.io/schemas/v1.26.0"
29+
V1_26_0 = "https://opentelemetry.io/schemas/1.26.0"
3030
"""
31-
The URL of the OpenTelemetry schema version v1.26.0.
31+
The URL of the OpenTelemetry schema version 1.26.0.
3232
"""
3333

3434
# when generating new semantic conventions,

opentelemetry-semantic-conventions/src/opentelemetry/semconv/trace/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
reason="Use attributes defined in the :py:const:`opentelemetry.semconv.attributes` and :py:const:`opentelemetry.semconv._incubating.attributes` modules instead.",
2525
) # type: ignore
2626
class SpanAttributes:
27-
SCHEMA_URL = "https://opentelemetry.io/schemas/v1.21.0"
27+
SCHEMA_URL = "https://opentelemetry.io/schemas/1.21.0"
2828
"""
2929
The URL of the OpenTelemetry schema for these keys and values.
3030
"""

scripts/semconv/generate.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
55
ROOT_DIR="${SCRIPT_DIR}/../../"
66

77
# freeze the spec version to make SemanticAttributes generation reproducible
8-
SEMCONV_VERSION=v1.26.0
9-
OTEL_SEMCONV_GEN_IMG_VERSION=0.24.0
8+
SEMCONV_VERSION=1.26.0
9+
SEMCONV_VERSION_TAG=v$SEMCONV_VERSION
10+
OTEL_SEMCONV_GEN_IMG_VERSION=0.25.0
1011
INCUBATING_DIR=_incubating
1112
cd ${SCRIPT_DIR}
1213

@@ -16,7 +17,7 @@ cd semantic-conventions
1617

1718
git init
1819
git remote add origin https://github.com/open-telemetry/semantic-conventions.git
19-
git fetch origin "$SEMCONV_VERSION"
20+
git fetch origin "$SEMCONV_VERSION_TAG"
2021
git reset --hard FETCH_HEAD
2122
cd ${SCRIPT_DIR}
2223

0 commit comments

Comments
 (0)