|
18 | 18 | import unittest
|
19 | 19 | import urllib.parse
|
20 | 20 | from functools import partial
|
21 |
| -from http import HTTPStatus |
22 | 21 | from unittest import mock
|
23 | 22 |
|
24 | 23 | import aiohttp
|
25 | 24 | import aiohttp.test_utils
|
26 |
| -import yarl |
27 | 25 | from pkg_resources import iter_entry_points
|
28 | 26 |
|
29 |
| -from opentelemetry import context |
30 |
| -from opentelemetry.instrumentation import aiohttp_server |
31 |
| -from opentelemetry.instrumentation.aiohttp_server import ( |
32 |
| - AioHttpServerInstrumentor, |
33 |
| -) |
34 |
| -from opentelemetry.instrumentation.utils import _SUPPRESS_INSTRUMENTATION_KEY |
| 27 | +from opentelemetry.instrumentation.aiohttp_server import AioHttpServerInstrumentor |
35 | 28 | from opentelemetry.semconv.trace import SpanAttributes
|
36 | 29 | from opentelemetry.test.test_base import TestBase
|
37 |
| -from opentelemetry.trace import Span, StatusCode |
38 | 30 |
|
39 | 31 |
|
40 | 32 | def run_with_test_server(
|
@@ -131,3 +123,13 @@ def test_not_recording(self):
|
131 | 123 | self.assertTrue(mock_span.is_recording.called)
|
132 | 124 | self.assertFalse(mock_span.set_attribute.called)
|
133 | 125 | self.assertFalse(mock_span.set_status.called)
|
| 126 | + |
| 127 | + |
| 128 | +class TestLoadingAioHttpInstrumentor(unittest.TestCase): |
| 129 | + def test_loading_instrumentor(self): |
| 130 | + entry_points = iter_entry_points( |
| 131 | + "opentelemetry_instrumentor", "aiohttp-server" |
| 132 | + ) |
| 133 | + |
| 134 | + instrumentor = next(entry_points).load()() |
| 135 | + self.assertIsInstance(instrumentor, AioHttpServerInstrumentor) |
0 commit comments