nucliadb-telemetry 5.2.1.post1904__py3-none-any.whl → 5.2.1.post1912__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.
- nucliadb_telemetry/fastapi/context.py +10 -9
- {nucliadb_telemetry-5.2.1.post1904.dist-info → nucliadb_telemetry-5.2.1.post1912.dist-info}/METADATA +10 -10
- {nucliadb_telemetry-5.2.1.post1904.dist-info → nucliadb_telemetry-5.2.1.post1912.dist-info}/RECORD +5 -5
- {nucliadb_telemetry-5.2.1.post1904.dist-info → nucliadb_telemetry-5.2.1.post1912.dist-info}/WHEEL +0 -0
- {nucliadb_telemetry-5.2.1.post1904.dist-info → nucliadb_telemetry-5.2.1.post1912.dist-info}/top_level.txt +0 -0
|
@@ -16,16 +16,13 @@
|
|
|
16
16
|
#
|
|
17
17
|
# You should have received a copy of the GNU Affero General Public License
|
|
18
18
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
19
|
-
from starlette.middleware.base import BaseHTTPMiddleware, RequestResponseEndpoint
|
|
20
|
-
from starlette.requests import Request
|
|
21
|
-
from starlette.responses import Response
|
|
22
19
|
|
|
23
20
|
from nucliadb_telemetry import context
|
|
24
21
|
|
|
25
22
|
from .utils import get_path_template
|
|
26
23
|
|
|
27
24
|
|
|
28
|
-
class ContextInjectorMiddleware
|
|
25
|
+
class ContextInjectorMiddleware:
|
|
29
26
|
"""
|
|
30
27
|
Automatically inject context values for the current request's path parameters
|
|
31
28
|
|
|
@@ -33,9 +30,13 @@ class ContextInjectorMiddleware(BaseHTTPMiddleware):
|
|
|
33
30
|
- `/api/v1/kb/{kbid}` would inject a context value for `kbid`
|
|
34
31
|
"""
|
|
35
32
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
if found_path_template.match:
|
|
39
|
-
context.add_context(found_path_template.scope.get("path_params", {})) # type: ignore
|
|
33
|
+
def __init__(self, app):
|
|
34
|
+
self.app = app
|
|
40
35
|
|
|
41
|
-
|
|
36
|
+
async def __call__(self, scope, receive, send):
|
|
37
|
+
if scope["type"] == "http":
|
|
38
|
+
found_path_template = get_path_template(scope)
|
|
39
|
+
if found_path_template.match:
|
|
40
|
+
context.add_context(found_path_template.scope.get("path_params", {})) # type: ignore
|
|
41
|
+
|
|
42
|
+
return await self.app(scope, receive, send)
|
{nucliadb_telemetry-5.2.1.post1904.dist-info → nucliadb_telemetry-5.2.1.post1912.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: nucliadb_telemetry
|
|
3
|
-
Version: 5.2.1.
|
|
3
|
+
Version: 5.2.1.post1912
|
|
4
4
|
Summary: NucliaDB Telemetry Library Python process
|
|
5
5
|
Home-page: https://github.com/nuclia/nucliadb
|
|
6
6
|
Author: nucliadb Authors
|
|
@@ -26,24 +26,24 @@ Requires-Dist: prometheus-client>=0.12.0
|
|
|
26
26
|
Requires-Dist: orjson>=3.6.7
|
|
27
27
|
Requires-Dist: wrapt>=1.14.1
|
|
28
28
|
Provides-Extra: all
|
|
29
|
+
Requires-Dist: grpcio-reflection<1.63.0,>=1.44.0; extra == "all"
|
|
29
30
|
Requires-Dist: grpcio<1.63.0,>=1.44.0; extra == "all"
|
|
30
31
|
Requires-Dist: opentelemetry-exporter-jaeger==1.21.0; extra == "all"
|
|
31
|
-
Requires-Dist: grpcio-tools<1.63.0,>=1.44.0; extra == "all"
|
|
32
|
-
Requires-Dist: opentelemetry-propagator-b3==1.21.0; extra == "all"
|
|
33
32
|
Requires-Dist: grpcio-channelz<1.63.0,>=1.44.0; extra == "all"
|
|
34
|
-
Requires-Dist:
|
|
33
|
+
Requires-Dist: fastapi; extra == "all"
|
|
34
|
+
Requires-Dist: opentelemetry-propagator-b3==1.21.0; extra == "all"
|
|
35
|
+
Requires-Dist: opentelemetry-sdk==1.21.0; extra == "all"
|
|
35
36
|
Requires-Dist: opentelemetry-instrumentation-aiohttp-client>=0.42b0; extra == "all"
|
|
36
37
|
Requires-Dist: grpcio-health-checking<1.63.0,>=1.44.0; extra == "all"
|
|
37
|
-
Requires-Dist: grpcio-status<1.63.0,>=1.44.0; extra == "all"
|
|
38
|
-
Requires-Dist: grpcio-reflection<1.63.0,>=1.44.0; extra == "all"
|
|
39
|
-
Requires-Dist: nats-py[nkeys]>=2.5.0; extra == "all"
|
|
40
|
-
Requires-Dist: fastapi; extra == "all"
|
|
41
38
|
Requires-Dist: opentelemetry-semantic-conventions>=0.42b0; extra == "all"
|
|
42
|
-
Requires-Dist: grpcio-
|
|
39
|
+
Requires-Dist: grpcio-status<1.63.0,>=1.44.0; extra == "all"
|
|
40
|
+
Requires-Dist: grpcio-tools<1.63.0,>=1.44.0; extra == "all"
|
|
43
41
|
Requires-Dist: opentelemetry-api==1.21.0; extra == "all"
|
|
42
|
+
Requires-Dist: opentelemetry-instrumentation-fastapi>=0.42b0; extra == "all"
|
|
44
43
|
Requires-Dist: PyNaCl; extra == "all"
|
|
45
|
-
Requires-Dist: opentelemetry-sdk==1.21.0; extra == "all"
|
|
46
44
|
Requires-Dist: opentelemetry-proto==1.21.0; extra == "all"
|
|
45
|
+
Requires-Dist: grpcio-testing<1.63.0,>=1.44.0; extra == "all"
|
|
46
|
+
Requires-Dist: nats-py[nkeys]>=2.5.0; extra == "all"
|
|
47
47
|
Provides-Extra: fastapi
|
|
48
48
|
Requires-Dist: fastapi; extra == "fastapi"
|
|
49
49
|
Requires-Dist: opentelemetry-sdk==1.21.0; extra == "fastapi"
|
{nucliadb_telemetry-5.2.1.post1904.dist-info → nucliadb_telemetry-5.2.1.post1912.dist-info}/RECORD
RENAMED
|
@@ -15,7 +15,7 @@ nucliadb_telemetry/settings.py,sha256=Gr5rC9tBKHwck6sMMP76rn4Zgwh1w81dSzJJNcgkZv
|
|
|
15
15
|
nucliadb_telemetry/tracerprovider.py,sha256=ycVqSMo0NTa7EEv4QLC8qAt0NYKbOy8uC9k14PjAiuk,3744
|
|
16
16
|
nucliadb_telemetry/utils.py,sha256=lqbW5SjpGcfEhiJUScYeaNrtt5BFnOTaJn5dwnjCVMM,4765
|
|
17
17
|
nucliadb_telemetry/fastapi/__init__.py,sha256=NRtQtyE1jZzTK5bZETYqb0d6bpjthTAt-UXiO8DAQWQ,3716
|
|
18
|
-
nucliadb_telemetry/fastapi/context.py,sha256=
|
|
18
|
+
nucliadb_telemetry/fastapi/context.py,sha256=qhl3rVDtqDfnsCHBAlv-eX8SUSlooMnsryBcV5FMZvU,1530
|
|
19
19
|
nucliadb_telemetry/fastapi/metrics.py,sha256=15GDaTNslQ00AZEAZvQFC8OyVIKdKLjzhafnWbsfytw,3906
|
|
20
20
|
nucliadb_telemetry/fastapi/tracing.py,sha256=U85I3QIFb27aj4v3Cl6l5evEgskP12LuEXW4pAsvGCc,15052
|
|
21
21
|
nucliadb_telemetry/fastapi/utils.py,sha256=HtfhBSaYs_HWHx7SBp0pPAsoig5CLcHNFIFnzb-RXOE,2979
|
|
@@ -30,7 +30,7 @@ nucliadb_telemetry/tests/grpc/helloworld_pb2.py,sha256=ht4dmi0pAy6qDrwcjkbtSf_hO
|
|
|
30
30
|
nucliadb_telemetry/tests/grpc/helloworld_pb2.pyi,sha256=mBZCQE6z7riQw6fOegJgZ5lHmXqO23_zxL8iQMqSqms,1191
|
|
31
31
|
nucliadb_telemetry/tests/grpc/helloworld_pb2_grpc.py,sha256=_jxUNxl4Fx-JztK9RO5R6osjNP2sVNVPAxLnmczEYOc,2677
|
|
32
32
|
nucliadb_telemetry/tests/grpc/helloworld_pb2_grpc.pyi,sha256=Y6teCx-PhPU-rI6w5ItLBKaTb34FLpngPnuDVWtNve4,958
|
|
33
|
-
nucliadb_telemetry-5.2.1.
|
|
34
|
-
nucliadb_telemetry-5.2.1.
|
|
35
|
-
nucliadb_telemetry-5.2.1.
|
|
36
|
-
nucliadb_telemetry-5.2.1.
|
|
33
|
+
nucliadb_telemetry-5.2.1.post1912.dist-info/METADATA,sha256=KWshCWonuqgJZ9_OCcPnBS7gNDjfZ-WtrsmIqQafilI,10708
|
|
34
|
+
nucliadb_telemetry-5.2.1.post1912.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
|
|
35
|
+
nucliadb_telemetry-5.2.1.post1912.dist-info/top_level.txt,sha256=3qEHI_5ttqQIL2gkNYwSlKsFyBBiEzDiIy9UKISzOaQ,19
|
|
36
|
+
nucliadb_telemetry-5.2.1.post1912.dist-info/RECORD,,
|
{nucliadb_telemetry-5.2.1.post1904.dist-info → nucliadb_telemetry-5.2.1.post1912.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|