opentelemetry-instrumentation-aiohttp-client 0.50b0__py3-none-any.whl → 0.52b0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,6 +22,7 @@ Explicitly instrumenting a single client session:
22
22
 
23
23
  .. code:: python
24
24
 
25
+ import asyncio
25
26
  import aiohttp
26
27
  from opentelemetry.instrumentation.aiohttp_client import create_trace_config
27
28
  import yarl
@@ -29,17 +30,21 @@ Explicitly instrumenting a single client session:
29
30
  def strip_query_params(url: yarl.URL) -> str:
30
31
  return str(url.with_query(None))
31
32
 
32
- async with aiohttp.ClientSession(trace_configs=[create_trace_config(
33
+ async def get(url):
34
+ async with aiohttp.ClientSession(trace_configs=[create_trace_config(
33
35
  # Remove all query params from the URL attribute on the span.
34
36
  url_filter=strip_query_params,
35
- )]) as session:
36
- async with session.get(url) as response:
37
- await response.text()
37
+ )]) as session:
38
+ async with session.get(url) as response:
39
+ await response.text()
40
+
41
+ asyncio.run(get("https://example.com"))
38
42
 
39
43
  Instrumenting all client sessions:
40
44
 
41
45
  .. code:: python
42
46
 
47
+ import asyncio
43
48
  import aiohttp
44
49
  from opentelemetry.instrumentation.aiohttp_client import (
45
50
  AioHttpClientInstrumentor
@@ -49,9 +54,12 @@ Instrumenting all client sessions:
49
54
  AioHttpClientInstrumentor().instrument()
50
55
 
51
56
  # Create a session and make an HTTP get request
52
- async with aiohttp.ClientSession() as session:
53
- async with session.get(url) as response:
54
- await response.text()
57
+ async def get(url):
58
+ async with aiohttp.ClientSession() as session:
59
+ async with session.get(url) as response:
60
+ await response.text()
61
+
62
+ asyncio.run(get("https://example.com"))
55
63
 
56
64
  Configuration
57
65
  -------------
@@ -92,13 +100,13 @@ from opentelemetry import context as context_api
92
100
  from opentelemetry import trace
93
101
  from opentelemetry.instrumentation._semconv import (
94
102
  _get_schema_url,
95
- _HTTPStabilityMode,
96
103
  _OpenTelemetrySemanticConventionStability,
97
104
  _OpenTelemetryStabilitySignalType,
98
105
  _report_new,
99
106
  _set_http_method,
100
107
  _set_http_url,
101
108
  _set_status,
109
+ _StabilityMode,
102
110
  )
103
111
  from opentelemetry.instrumentation.aiohttp_client.package import _instruments
104
112
  from opentelemetry.instrumentation.aiohttp_client.version import __version__
@@ -142,7 +150,7 @@ def _set_http_status_code_attribute(
142
150
  span,
143
151
  status_code,
144
152
  metric_attributes=None,
145
- sem_conv_opt_in_mode=_HTTPStabilityMode.DEFAULT,
153
+ sem_conv_opt_in_mode=_StabilityMode.DEFAULT,
146
154
  ):
147
155
  status_code_str = str(status_code)
148
156
  try:
@@ -169,7 +177,7 @@ def create_trace_config(
169
177
  request_hook: _RequestHookT = None,
170
178
  response_hook: _ResponseHookT = None,
171
179
  tracer_provider: TracerProvider = None,
172
- sem_conv_opt_in_mode: _HTTPStabilityMode = _HTTPStabilityMode.DEFAULT,
180
+ sem_conv_opt_in_mode: _StabilityMode = _StabilityMode.DEFAULT,
173
181
  ) -> aiohttp.TraceConfig:
174
182
  """Create an aiohttp-compatible trace configuration.
175
183
 
@@ -326,7 +334,7 @@ def _instrument(
326
334
  trace_configs: typing.Optional[
327
335
  typing.Sequence[aiohttp.TraceConfig]
328
336
  ] = None,
329
- sem_conv_opt_in_mode: _HTTPStabilityMode = _HTTPStabilityMode.DEFAULT,
337
+ sem_conv_opt_in_mode: _StabilityMode = _StabilityMode.DEFAULT,
330
338
  ):
331
339
  """Enables tracing of all ClientSessions
332
340
 
@@ -12,4 +12,4 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- __version__ = "0.50b0"
15
+ __version__ = "0.52b0"
@@ -1,10 +1,12 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: opentelemetry-instrumentation-aiohttp-client
3
- Version: 0.50b0
3
+ Version: 0.52b0
4
4
  Summary: OpenTelemetry aiohttp client instrumentation
5
5
  Project-URL: Homepage, https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation/opentelemetry-instrumentation-aiohttp-client
6
+ Project-URL: Repository, https://github.com/open-telemetry/opentelemetry-python-contrib
6
7
  Author-email: OpenTelemetry Authors <cncf-opentelemetry-contributors@lists.cncf.io>
7
- License: Apache-2.0
8
+ License-Expression: Apache-2.0
9
+ License-File: LICENSE
8
10
  Classifier: Development Status :: 4 - Beta
9
11
  Classifier: Intended Audience :: Developers
10
12
  Classifier: License :: OSI Approved :: Apache Software License
@@ -15,11 +17,12 @@ Classifier: Programming Language :: Python :: 3.9
15
17
  Classifier: Programming Language :: Python :: 3.10
16
18
  Classifier: Programming Language :: Python :: 3.11
17
19
  Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
18
21
  Requires-Python: >=3.8
19
22
  Requires-Dist: opentelemetry-api~=1.12
20
- Requires-Dist: opentelemetry-instrumentation==0.50b0
21
- Requires-Dist: opentelemetry-semantic-conventions==0.50b0
22
- Requires-Dist: opentelemetry-util-http==0.50b0
23
+ Requires-Dist: opentelemetry-instrumentation==0.52b0
24
+ Requires-Dist: opentelemetry-semantic-conventions==0.52b0
25
+ Requires-Dist: opentelemetry-util-http==0.52b0
23
26
  Requires-Dist: wrapt<2.0.0,>=1.0.0
24
27
  Provides-Extra: instruments
25
28
  Requires-Dist: aiohttp~=3.0; extra == 'instruments'
@@ -0,0 +1,8 @@
1
+ opentelemetry/instrumentation/aiohttp_client/__init__.py,sha256=_rzwbYr1V-g3Br3P7-1Qbmx1PspqfvFiZalsryk2TKk,14474
2
+ opentelemetry/instrumentation/aiohttp_client/package.py,sha256=sNviXDOZG31-3USpt9VVWNqT8kAiIKaxtq-wi1k8WBM,681
3
+ opentelemetry/instrumentation/aiohttp_client/version.py,sha256=1XVCkO6Awpuy9bxUgeYyz_yjKViPwmuwsldOgsQj3-I,610
4
+ opentelemetry_instrumentation_aiohttp_client-0.52b0.dist-info/METADATA,sha256=X850zFgIuoyCvUJp9mVIqtdSewL6uWn99MIUyBbVj38,2217
5
+ opentelemetry_instrumentation_aiohttp_client-0.52b0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
6
+ opentelemetry_instrumentation_aiohttp_client-0.52b0.dist-info/entry_points.txt,sha256=RyZ5eVO-u3V_rwvLrhMM0ABs_WYZDqcagmMKwDPtmwE,117
7
+ opentelemetry_instrumentation_aiohttp_client-0.52b0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
8
+ opentelemetry_instrumentation_aiohttp_client-0.52b0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.26.3
2
+ Generator: hatchling 1.27.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,8 +0,0 @@
1
- opentelemetry/instrumentation/aiohttp_client/__init__.py,sha256=l3EfkPyCLBDBd8bwC9jXuK4FYhzBZPV3j33gGKm5o4I,14294
2
- opentelemetry/instrumentation/aiohttp_client/package.py,sha256=sNviXDOZG31-3USpt9VVWNqT8kAiIKaxtq-wi1k8WBM,681
3
- opentelemetry/instrumentation/aiohttp_client/version.py,sha256=iHUTxI2YL1TgSonSihvVzf6E5_Pphg6lWlPlzkyQwc4,610
4
- opentelemetry_instrumentation_aiohttp_client-0.50b0.dist-info/METADATA,sha256=Ymaob7VcV85rrfCMepFepHliIGALo1fQFbp3soeDtSU,2045
5
- opentelemetry_instrumentation_aiohttp_client-0.50b0.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
6
- opentelemetry_instrumentation_aiohttp_client-0.50b0.dist-info/entry_points.txt,sha256=RyZ5eVO-u3V_rwvLrhMM0ABs_WYZDqcagmMKwDPtmwE,117
7
- opentelemetry_instrumentation_aiohttp_client-0.50b0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
8
- opentelemetry_instrumentation_aiohttp_client-0.50b0.dist-info/RECORD,,