diff --git a/instrumentation-genai/opentelemetry-instrumentation-openai-v2/src/opentelemetry/instrumentation/openai_v2/__init__.py b/instrumentation-genai/opentelemetry-instrumentation-openai-v2/src/opentelemetry/instrumentation/openai_v2/__init__.py index dc08881729..0a472b89f2 100644 --- a/instrumentation-genai/opentelemetry-instrumentation-openai-v2/src/opentelemetry/instrumentation/openai_v2/__init__.py +++ b/instrumentation-genai/opentelemetry-instrumentation-openai-v2/src/opentelemetry/instrumentation/openai_v2/__init__.py @@ -58,6 +58,9 @@ class OpenAIInstrumentor(BaseInstrumentor): + def __init__(self): + self._meter = None + def instrumentation_dependencies(self) -> Collection[str]: return _instruments diff --git a/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/conftest.py b/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/conftest.py index c727a6a5f1..7318d15bc3 100644 --- a/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/conftest.py +++ b/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/conftest.py @@ -71,7 +71,7 @@ def fixture_event_logger_provider(log_exporter): @pytest.fixture(scope="function", name="meter_provider") def fixture_meter_provider(metric_reader): - TokenUsageHistogramView = View( + token_usage_histogram_view = View( instrument_type=Histogram, instrument_name="gen_ai.client.token.usage", aggregation=ExplicitBucketHistogramAggregation( @@ -94,7 +94,7 @@ def fixture_meter_provider(metric_reader): ), ) - DurationHistogramView = View( + duration_histogram_view = View( instrument_type=Histogram, instrument_name="gen_ai.client.operation.duration", aggregation=ExplicitBucketHistogramAggregation( @@ -119,7 +119,7 @@ def fixture_meter_provider(metric_reader): meter_provider = MeterProvider( metric_readers=[metric_reader], - views=[TokenUsageHistogramView, DurationHistogramView], + views=[token_usage_histogram_view, duration_histogram_view], ) return meter_provider