From 7f8c75d4de1a53beec59eed21cf95d2aa6428969 Mon Sep 17 00:00:00 2001 From: Leighton Chen Date: Mon, 2 Oct 2023 15:17:52 -0700 Subject: [PATCH] schema (#3454) --- CHANGELOG.md | 2 ++ .../src/opentelemetry/_logs/_internal/__init__.py | 3 ++- .../src/opentelemetry/metrics/_internal/__init__.py | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e5e0dd09f51..0f9ef1720a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#3447](https://github.com/open-telemetry/opentelemetry-python/pull/3447)) - Update semantic conventions to version 1.21.0 ([#3251](https://github.com/open-telemetry/opentelemetry-python/pull/3251)) +- Add missing schema_url in global api for logging and metrics + ([#3251](https://github.com/open-telemetry/opentelemetry-python/pull/3251)) ## Version 1.20.0/0.41b0 (2023-09-04) diff --git a/opentelemetry-api/src/opentelemetry/_logs/_internal/__init__.py b/opentelemetry-api/src/opentelemetry/_logs/_internal/__init__.py index c6d35dbf070..f5f9437f148 100644 --- a/opentelemetry-api/src/opentelemetry/_logs/_internal/__init__.py +++ b/opentelemetry-api/src/opentelemetry/_logs/_internal/__init__.py @@ -215,6 +215,7 @@ def get_logger( instrumenting_module_name: str, instrumenting_library_version: str = "", logger_provider: Optional[LoggerProvider] = None, + schema_url: Optional[str] = None, ) -> "Logger": """Returns a `Logger` for use within a python process. @@ -226,5 +227,5 @@ def get_logger( if logger_provider is None: logger_provider = get_logger_provider() return logger_provider.get_logger( - instrumenting_module_name, instrumenting_library_version + instrumenting_module_name, instrumenting_library_version, schema_url ) diff --git a/opentelemetry-api/src/opentelemetry/metrics/_internal/__init__.py b/opentelemetry-api/src/opentelemetry/metrics/_internal/__init__.py index 630e9c4053d..aad76b33a72 100644 --- a/opentelemetry-api/src/opentelemetry/metrics/_internal/__init__.py +++ b/opentelemetry-api/src/opentelemetry/metrics/_internal/__init__.py @@ -719,6 +719,7 @@ def get_meter( name: str, version: str = "", meter_provider: Optional[MeterProvider] = None, + schema_url: Optional[str] = None, ) -> "Meter": """Returns a `Meter` for use by the given instrumentation library. @@ -729,7 +730,7 @@ def get_meter( """ if meter_provider is None: meter_provider = get_meter_provider() - return meter_provider.get_meter(name, version) + return meter_provider.get_meter(name, version, schema_url) def _set_meter_provider(meter_provider: MeterProvider, log: bool) -> None: