diff --git a/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/__init__.py b/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/__init__.py index d3e21fd08d..68e3d0839f 100644 --- a/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/__init__.py @@ -119,7 +119,7 @@ class AsyncioInstrumentor(BaseInstrumentor): def __init__(self): super().__init__() self.process_duration_histogram = None - self.process_counts_counter = None + self.process_created_counter = None self._tracer = None self._meter = None @@ -147,8 +147,8 @@ def _instrument(self, **kwargs): description="Duration of asyncio process", unit="s", ) - self.process_counts_counter = self._meter.create_counter( - name="asyncio.process.count", + self.process_created_counter = self._meter.create_counter( + name="asyncio.process.created", description="Number of asyncio process", unit="{process}", ) @@ -331,7 +331,7 @@ def record_process( """ duration = max(default_timer() - start, 0) self.process_duration_histogram.record(duration, attr) - self.process_counts_counter.add(1, attr) + self.process_created_counter.add(1, attr) if span: if span.is_recording() and exception: diff --git a/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/utils.py b/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/utils.py index eb457fb67a..15c78ae1ce 100644 --- a/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/utils.py +++ b/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/utils.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. import os +from typing import Set # pylint: disable=no-name-in-module from opentelemetry.instrumentation.asyncio.environment_variables import ( diff --git a/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_cancellation.py b/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_cancellation.py index 62905e3eee..9172cd4458 100644 --- a/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_cancellation.py +++ b/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_cancellation.py @@ -66,7 +66,7 @@ def test_cancel(self): point.attributes["name"], ["cancellation_coro", "cancellable_coroutine"], ) - if metric.name == "asyncio.process.count": + if metric.name == "asyncio.process.created": for point in metric.data.data_points: self.assertEqual(point.attributes["type"], "coroutine") self.assertIn( diff --git a/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_ensure_future.py b/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_ensure_future.py index 26de02b77d..4907aa4bf8 100644 --- a/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_ensure_future.py +++ b/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_ensure_future.py @@ -85,7 +85,7 @@ async def test(): if metric.name == "asyncio.process.duration": for point in metric.data.data_points: self.assertEqual(point.attributes["type"], "future") - if metric.name == "asyncio.process.count": + if metric.name == "asyncio.process.created": for point in metric.data.data_points: self.assertEqual(point.attributes["type"], "future") self.assertEqual(point.attributes["state"], "finished") diff --git a/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_to_thread.py b/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_to_thread.py index 54c85374c9..b53a6edc08 100644 --- a/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_to_thread.py +++ b/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_to_thread.py @@ -67,7 +67,7 @@ async def to_thread(): for point in metric.data.data_points: self.assertEqual(point.attributes["type"], "to_thread") self.assertEqual(point.attributes["name"], "multiply") - if metric.name == "asyncio.process.count": + if metric.name == "asyncio.process.created": for point in metric.data.data_points: self.assertEqual(point.attributes["type"], "to_thread") self.assertEqual(point.attributes["name"], "multiply")