From e3467d49edab2f3389b3f13e5493f123a550753b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Em=C3=ADdio=20Neto?= <9735060+emdneto@users.noreply.github.com> Date: Mon, 22 Jul 2024 13:27:15 -0300 Subject: [PATCH 1/2] Update README.md (#4068) --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 3bf66016dea..b9820add973 100644 --- a/README.md +++ b/README.md @@ -80,9 +80,7 @@ this repository and perform an [editable install](https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs): ```sh -pip install -e ./opentelemetry-api -pip install -e ./opentelemetry-sdk -pip install -e ./instrumentation/opentelemetry-instrumentation-{instrumentation} +pip install -e ./opentelemetry-api -e ./opentelemetry-sdk -e ./opentelemetry-semantic-conventions ``` For additional exporter and instrumentation packages, see the From 874916822139f46c4060fbd82d8f30ff45a9b628 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Em=C3=ADdio=20Neto?= <9735060+emdneto@users.noreply.github.com> Date: Mon, 22 Jul 2024 13:52:49 -0300 Subject: [PATCH 2/2] fix schema_url constants in semconv (#4069) --- CHANGELOG.md | 2 ++ .../src/opentelemetry/semconv/metrics/__init__.py | 2 +- .../src/opentelemetry/semconv/resource/__init__.py | 2 +- .../src/opentelemetry/semconv/schemas.py | 8 ++++---- .../src/opentelemetry/semconv/trace/__init__.py | 2 +- scripts/semconv/generate.sh | 7 ++++--- 6 files changed, 13 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 02866e9711a..05ae64c1531 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/__init__.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/__init__.py index ce388fbe828..bad7b745f79 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/__init__.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/__init__.py @@ -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. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/resource/__init__.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/resource/__init__.py index 4015b207670..75496e02ce7 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/resource/__init__.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/resource/__init__.py @@ -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. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/schemas.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/schemas.py index 9af106cef99..0e45ae806b5 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/schemas.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/schemas.py @@ -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, diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/trace/__init__.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/trace/__init__.py index ee63258a05a..299d3db0a87 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/trace/__init__.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/trace/__init__.py @@ -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. """ diff --git a/scripts/semconv/generate.sh b/scripts/semconv/generate.sh index 12efd2b0b1e..8c5dbdbea1b 100755 --- a/scripts/semconv/generate.sh +++ b/scripts/semconv/generate.sh @@ -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} @@ -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}