Fix docker-tests assumption by Postgres-Sqlalchemy case about scope of metrics (#4258)

* Fix postgres-sqlalchemy docker-test assumption about metrics

* Changelog
This commit is contained in:
Tammy Baylis
2026-02-25 03:25:41 -08:00
committed by GitHub
parent 5560324cff
commit 2b8ca97f91
2 changed files with 5 additions and 1 deletions

View File

@@ -113,6 +113,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#4078](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4171))
- `opentelemetry-instrumentation-aiohttp-server`: fix HTTP error inconsistencies
([#4175](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4175))
- `opentelemetry-docker-tests` Fix docker-tests assumption by Postgres-Sqlalchemy case about scope of metrics
([#4258](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4258))
### Breaking changes

View File

@@ -23,6 +23,8 @@ from opentelemetry.semconv.trace import SpanAttributes
from .mixins import SQLAlchemyTestMixin
SCOPE = "opentelemetry.instrumentation.sqlalchemy"
POSTGRES_CONFIG = {
"host": "127.0.0.1",
"port": int(os.getenv("TEST_POSTGRES_PORT", "5432")),
@@ -117,7 +119,7 @@ class PostgresMetricsTestCase(PostgresTestCase):
POSTGRES_CONFIG["port"],
self.SQL_DB,
)
metrics = self.get_sorted_metrics()
metrics = self.get_sorted_metrics(SCOPE)
self.assertEqual(len(metrics), 1)
self.assert_metric_expected(
metrics[0],