opentelemetry-instrumentation-requests 0.53b0__py3-none-any.whl → 0.54b0__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.
- opentelemetry/instrumentation/requests/__init__.py +27 -2
- opentelemetry/instrumentation/requests/version.py +1 -1
- {opentelemetry_instrumentation_requests-0.53b0.dist-info → opentelemetry_instrumentation_requests-0.54b0.dist-info}/METADATA +4 -4
- opentelemetry_instrumentation_requests-0.54b0.dist-info/RECORD +9 -0
- opentelemetry_instrumentation_requests-0.53b0.dist-info/RECORD +0 -9
- {opentelemetry_instrumentation_requests-0.53b0.dist-info → opentelemetry_instrumentation_requests-0.54b0.dist-info}/WHEEL +0 -0
- {opentelemetry_instrumentation_requests-0.53b0.dist-info → opentelemetry_instrumentation_requests-0.54b0.dist-info}/entry_points.txt +0 -0
- {opentelemetry_instrumentation_requests-0.53b0.dist-info → opentelemetry_instrumentation_requests-0.54b0.dist-info}/licenses/LICENSE +0 -0
@@ -57,6 +57,22 @@ The hooks can be configured as follows:
|
|
57
57
|
request_hook=request_hook, response_hook=response_hook
|
58
58
|
)
|
59
59
|
|
60
|
+
Custom Duration Histogram Boundaries
|
61
|
+
************************************
|
62
|
+
To customize the duration histogram bucket boundaries used for HTTP client request duration metrics,
|
63
|
+
you can provide a list of values when instrumenting:
|
64
|
+
|
65
|
+
.. code:: python
|
66
|
+
|
67
|
+
import requests
|
68
|
+
from opentelemetry.instrumentation.requests import RequestsInstrumentor
|
69
|
+
|
70
|
+
custom_boundaries = [0.0, 5.0, 10.0, 25.0, 50.0, 100.0]
|
71
|
+
|
72
|
+
RequestsInstrumentor().instrument(
|
73
|
+
duration_histogram_boundaries=custom_boundaries
|
74
|
+
)
|
75
|
+
|
60
76
|
Exclude lists
|
61
77
|
*************
|
62
78
|
To exclude certain URLs from being tracked, set the environment variable ``OTEL_PYTHON_REQUESTS_EXCLUDED_URLS``
|
@@ -87,6 +103,8 @@ from requests.sessions import Session
|
|
87
103
|
from requests.structures import CaseInsensitiveDict
|
88
104
|
|
89
105
|
from opentelemetry.instrumentation._semconv import (
|
106
|
+
HTTP_DURATION_HISTOGRAM_BUCKETS_NEW,
|
107
|
+
HTTP_DURATION_HISTOGRAM_BUCKETS_OLD,
|
90
108
|
_client_duration_attrs_new,
|
91
109
|
_client_duration_attrs_old,
|
92
110
|
_filter_semconv_duration_attrs,
|
@@ -410,8 +428,8 @@ class RequestsInstrumentor(BaseInstrumentor):
|
|
410
428
|
``tracer_provider``: a TracerProvider, defaults to global
|
411
429
|
``request_hook``: An optional callback that is invoked right after a span is created.
|
412
430
|
``response_hook``: An optional callback which is invoked right before the span is finished processing a response.
|
413
|
-
``excluded_urls``: A string containing a comma-delimited
|
414
|
-
|
431
|
+
``excluded_urls``: A string containing a comma-delimited list of regexes used to exclude URLs from tracking
|
432
|
+
``duration_histogram_boundaries``: A list of float values representing the explicit bucket boundaries for the duration histogram.
|
415
433
|
"""
|
416
434
|
semconv_opt_in_mode = _OpenTelemetrySemanticConventionStability._get_opentelemetry_stability_opt_in_mode(
|
417
435
|
_OpenTelemetryStabilitySignalType.HTTP,
|
@@ -426,6 +444,9 @@ class RequestsInstrumentor(BaseInstrumentor):
|
|
426
444
|
)
|
427
445
|
excluded_urls = kwargs.get("excluded_urls")
|
428
446
|
meter_provider = kwargs.get("meter_provider")
|
447
|
+
duration_histogram_boundaries = kwargs.get(
|
448
|
+
"duration_histogram_boundaries"
|
449
|
+
)
|
429
450
|
meter = get_meter(
|
430
451
|
__name__,
|
431
452
|
__version__,
|
@@ -438,6 +459,8 @@ class RequestsInstrumentor(BaseInstrumentor):
|
|
438
459
|
name=MetricInstruments.HTTP_CLIENT_DURATION,
|
439
460
|
unit="ms",
|
440
461
|
description="measures the duration of the outbound HTTP request",
|
462
|
+
explicit_bucket_boundaries_advisory=duration_histogram_boundaries
|
463
|
+
or HTTP_DURATION_HISTOGRAM_BUCKETS_OLD,
|
441
464
|
)
|
442
465
|
duration_histogram_new = None
|
443
466
|
if _report_new(semconv_opt_in_mode):
|
@@ -445,6 +468,8 @@ class RequestsInstrumentor(BaseInstrumentor):
|
|
445
468
|
name=HTTP_CLIENT_REQUEST_DURATION,
|
446
469
|
unit="s",
|
447
470
|
description="Duration of HTTP client requests.",
|
471
|
+
explicit_bucket_boundaries_advisory=duration_histogram_boundaries
|
472
|
+
or HTTP_DURATION_HISTOGRAM_BUCKETS_NEW,
|
448
473
|
)
|
449
474
|
_instrument(
|
450
475
|
tracer,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: opentelemetry-instrumentation-requests
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.54b0
|
4
4
|
Summary: OpenTelemetry requests instrumentation
|
5
5
|
Project-URL: Homepage, https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation/opentelemetry-instrumentation-requests
|
6
6
|
Project-URL: Repository, https://github.com/open-telemetry/opentelemetry-python-contrib
|
@@ -20,9 +20,9 @@ Classifier: Programming Language :: Python :: 3.12
|
|
20
20
|
Classifier: Programming Language :: Python :: 3.13
|
21
21
|
Requires-Python: >=3.8
|
22
22
|
Requires-Dist: opentelemetry-api~=1.12
|
23
|
-
Requires-Dist: opentelemetry-instrumentation==0.
|
24
|
-
Requires-Dist: opentelemetry-semantic-conventions==0.
|
25
|
-
Requires-Dist: opentelemetry-util-http==0.
|
23
|
+
Requires-Dist: opentelemetry-instrumentation==0.54b0
|
24
|
+
Requires-Dist: opentelemetry-semantic-conventions==0.54b0
|
25
|
+
Requires-Dist: opentelemetry-util-http==0.54b0
|
26
26
|
Provides-Extra: instruments
|
27
27
|
Requires-Dist: requests~=2.0; extra == 'instruments'
|
28
28
|
Description-Content-Type: text/x-rst
|
@@ -0,0 +1,9 @@
|
|
1
|
+
opentelemetry/instrumentation/requests/__init__.py,sha256=IJOPjE0Z-DjtS_tp-zhIYGBDwENlSiwTb9dq27e7ZPM,17878
|
2
|
+
opentelemetry/instrumentation/requests/package.py,sha256=84lK70NyCoRefASXKjU5f4byJhf5qWDL6IdYjch-UTM,679
|
3
|
+
opentelemetry/instrumentation/requests/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
|
+
opentelemetry/instrumentation/requests/version.py,sha256=f-9BkRhMqLnQxkWjji9piLvfWOtFo2uNhwsi1TTWzDQ,608
|
5
|
+
opentelemetry_instrumentation_requests-0.54b0.dist-info/METADATA,sha256=g74KOR6sMM2Ps2BerfW8-LaRxGKe81AhvUPG5qE7CRo,2670
|
6
|
+
opentelemetry_instrumentation_requests-0.54b0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
7
|
+
opentelemetry_instrumentation_requests-0.54b0.dist-info/entry_points.txt,sha256=w_cFVp9h9IXzWm2YeBaOEUANSn9iuUlNAl0QC3PDf94,100
|
8
|
+
opentelemetry_instrumentation_requests-0.54b0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
9
|
+
opentelemetry_instrumentation_requests-0.54b0.dist-info/RECORD,,
|
@@ -1,9 +0,0 @@
|
|
1
|
-
opentelemetry/instrumentation/requests/__init__.py,sha256=Cjqt-1i4X6MhTS6FHe9KoooI9rsaTFGvgXZ_RzFjv1w,16781
|
2
|
-
opentelemetry/instrumentation/requests/package.py,sha256=84lK70NyCoRefASXKjU5f4byJhf5qWDL6IdYjch-UTM,679
|
3
|
-
opentelemetry/instrumentation/requests/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
|
-
opentelemetry/instrumentation/requests/version.py,sha256=YINz8iltPDXGMAPN-XzoMRWHV-bhEWau0Rniz-pK9c0,608
|
5
|
-
opentelemetry_instrumentation_requests-0.53b0.dist-info/METADATA,sha256=OfPAJqR4QNFDkQPgI-w3Ie7GKbQ-E5uRXFdo4N7DIdQ,2670
|
6
|
-
opentelemetry_instrumentation_requests-0.53b0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
7
|
-
opentelemetry_instrumentation_requests-0.53b0.dist-info/entry_points.txt,sha256=w_cFVp9h9IXzWm2YeBaOEUANSn9iuUlNAl0QC3PDf94,100
|
8
|
-
opentelemetry_instrumentation_requests-0.53b0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
9
|
-
opentelemetry_instrumentation_requests-0.53b0.dist-info/RECORD,,
|
File without changes
|
File without changes
|