reqly 0.1.2__tar.gz → 0.1.3__tar.gz
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.
- {reqly-0.1.2 → reqly-0.1.3}/PKG-INFO +1 -1
- {reqly-0.1.2 → reqly-0.1.3}/pyproject.toml +1 -1
- {reqly-0.1.2 → reqly-0.1.3}/reqly/__init__.py +1 -1
- {reqly-0.1.2 → reqly-0.1.3}/reqly/core/capture.py +9 -1
- {reqly-0.1.2 → reqly-0.1.3}/reqly/core/config.py +9 -1
- {reqly-0.1.2 → reqly-0.1.3}/reqly/core/shipper.py +7 -0
- {reqly-0.1.2 → reqly-0.1.3}/reqly.egg-info/PKG-INFO +1 -1
- {reqly-0.1.2 → reqly-0.1.3}/README.md +0 -0
- {reqly-0.1.2 → reqly-0.1.3}/reqly/core/__init__.py +0 -0
- {reqly-0.1.2 → reqly-0.1.3}/reqly/core/buffer.py +0 -0
- {reqly-0.1.2 → reqly-0.1.3}/reqly/core/client.py +0 -0
- {reqly-0.1.2 → reqly-0.1.3}/reqly/core/sampling.py +0 -0
- {reqly-0.1.2 → reqly-0.1.3}/reqly/integrations/__init__.py +0 -0
- {reqly-0.1.2 → reqly-0.1.3}/reqly/integrations/fastapi.py +0 -0
- {reqly-0.1.2 → reqly-0.1.3}/reqly/integrations/flask.py +0 -0
- {reqly-0.1.2 → reqly-0.1.3}/reqly.egg-info/SOURCES.txt +0 -0
- {reqly-0.1.2 → reqly-0.1.3}/reqly.egg-info/dependency_links.txt +0 -0
- {reqly-0.1.2 → reqly-0.1.3}/reqly.egg-info/requires.txt +0 -0
- {reqly-0.1.2 → reqly-0.1.3}/reqly.egg-info/top_level.txt +0 -0
- {reqly-0.1.2 → reqly-0.1.3}/setup.cfg +0 -0
- {reqly-0.1.2 → reqly-0.1.3}/tests/test_buffer.py +0 -0
- {reqly-0.1.2 → reqly-0.1.3}/tests/test_capture.py +0 -0
- {reqly-0.1.2 → reqly-0.1.3}/tests/test_fastapi_integration.py +0 -0
- {reqly-0.1.2 → reqly-0.1.3}/tests/test_flask_integration.py +0 -0
- {reqly-0.1.2 → reqly-0.1.3}/tests/test_sampling.py +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "reqly"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.3"
|
|
8
8
|
description = "Auto-instrumentation SDK for FastAPI and Flask: zero-code latency, error rates, and status codes shipped to a Reqly collector."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.9"
|
|
@@ -44,7 +44,7 @@ def instrument(
|
|
|
44
44
|
max_queue_size: int | None = None,
|
|
45
45
|
ignore_routes: list[str] | None = None,
|
|
46
46
|
capture_request_body: bool | None = None,
|
|
47
|
-
) -> ReqlyClient:
|
|
47
|
+
) -> ReqlyClient | None:
|
|
48
48
|
"""Instrument a FastAPI or Flask app with one line.
|
|
49
49
|
|
|
50
50
|
Config resolution order for any omitted argument: explicit kwarg >
|
|
@@ -4,6 +4,14 @@ import socket
|
|
|
4
4
|
import uuid
|
|
5
5
|
from dataclasses import asdict, dataclass, field
|
|
6
6
|
from datetime import datetime, timezone
|
|
7
|
+
from importlib.metadata import PackageNotFoundError, version as _pkg_version
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def _get_sdk_version() -> str:
|
|
11
|
+
try:
|
|
12
|
+
return _pkg_version("reqly")
|
|
13
|
+
except PackageNotFoundError:
|
|
14
|
+
return "0.1.0"
|
|
7
15
|
|
|
8
16
|
_HOSTNAME = socket.gethostname()
|
|
9
17
|
|
|
@@ -27,7 +35,7 @@ class RequestEvent:
|
|
|
27
35
|
error: bool = False
|
|
28
36
|
error_type: str | None = None
|
|
29
37
|
host: str = _HOSTNAME
|
|
30
|
-
sdk_version: str =
|
|
38
|
+
sdk_version: str = field(default_factory=_get_sdk_version)
|
|
31
39
|
|
|
32
40
|
def to_dict(self) -> dict:
|
|
33
41
|
return asdict(self)
|
|
@@ -2,6 +2,14 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import os
|
|
4
4
|
from dataclasses import dataclass, field
|
|
5
|
+
from importlib.metadata import PackageNotFoundError, version as _pkg_version
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def _get_sdk_version() -> str:
|
|
9
|
+
try:
|
|
10
|
+
return _pkg_version("reqly")
|
|
11
|
+
except PackageNotFoundError:
|
|
12
|
+
return "0.1.0"
|
|
5
13
|
|
|
6
14
|
|
|
7
15
|
def _env_float(name: str, default: float) -> float:
|
|
@@ -48,7 +56,7 @@ class Config:
|
|
|
48
56
|
max_queue_size: int = 2000
|
|
49
57
|
ignore_routes: list[str] = field(default_factory=lambda: ["/health", "/metrics"])
|
|
50
58
|
capture_request_body: bool = False
|
|
51
|
-
sdk_version: str =
|
|
59
|
+
sdk_version: str = field(default_factory=_get_sdk_version)
|
|
52
60
|
|
|
53
61
|
@classmethod
|
|
54
62
|
def resolve(
|
|
@@ -82,6 +82,13 @@ class Shipper:
|
|
|
82
82
|
attempt + 1,
|
|
83
83
|
_MAX_RETRIES,
|
|
84
84
|
)
|
|
85
|
+
except Exception as exc:
|
|
86
|
+
logger.warning(
|
|
87
|
+
"reqly: unexpected shipper error %s, attempt %d/%d",
|
|
88
|
+
exc,
|
|
89
|
+
attempt + 1,
|
|
90
|
+
_MAX_RETRIES,
|
|
91
|
+
)
|
|
85
92
|
|
|
86
93
|
if attempt < _MAX_RETRIES - 1:
|
|
87
94
|
backoff = _BACKOFF_BASE_SECONDS * (2**attempt)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|