road24-artifacthub 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.
Files changed (64) hide show
  1. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/PKG-INFO +1 -1
  2. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/pyproject.toml +1 -1
  3. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/road24_sdk/integrations/httpx.py +11 -2
  4. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/.claude/CLAUDE.md +0 -0
  5. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/.claude/agents/engineer.md +0 -0
  6. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/.claude/agents/tester.md +0 -0
  7. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/.gitignore +0 -0
  8. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/.hooks/check-commit-msg.sh +0 -0
  9. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/.pre-commit-config.yaml +0 -0
  10. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/Makefile +0 -0
  11. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/README.md +0 -0
  12. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/commands/__init__.py +0 -0
  13. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/commands/test_logs_db.py +0 -0
  14. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/commands/test_logs_exceptions.py +0 -0
  15. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/commands/test_logs_http_input.py +0 -0
  16. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/commands/test_logs_http_output.py +0 -0
  17. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/commands/test_logs_redis.py +0 -0
  18. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/commands/test_metrics_http.py +0 -0
  19. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/examples/__init__.py +0 -0
  20. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/examples/core/__init__.py +0 -0
  21. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/examples/core/database/__init__.py +0 -0
  22. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/examples/core/database/config.py +0 -0
  23. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/examples/core/database/mixins.py +0 -0
  24. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/examples/core/http.py +0 -0
  25. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/examples/core/redis.py +0 -0
  26. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/examples/core/road24.py +0 -0
  27. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/examples/core/settings.py +0 -0
  28. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/examples/core/utils.py +0 -0
  29. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/examples/src/__init__.py +0 -0
  30. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/examples/src/main.py +0 -0
  31. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/main.py +0 -0
  32. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/road24_sdk/__init__.py +0 -0
  33. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/road24_sdk/_formatter.py +0 -0
  34. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/road24_sdk/_sanitizer.py +0 -0
  35. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/road24_sdk/_schemas.py +0 -0
  36. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/road24_sdk/_types.py +0 -0
  37. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/road24_sdk/integrations/__init__.py +0 -0
  38. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/road24_sdk/integrations/_base.py +0 -0
  39. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/road24_sdk/integrations/fastapi.py +0 -0
  40. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/road24_sdk/integrations/redis.py +0 -0
  41. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/road24_sdk/integrations/sqlalchemy.py +0 -0
  42. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/road24_sdk/metrics/__init__.py +0 -0
  43. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/road24_sdk/metrics/db.py +0 -0
  44. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/road24_sdk/metrics/http.py +0 -0
  45. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/road24_sdk/metrics/redis.py +0 -0
  46. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/tests/__init__.py +0 -0
  47. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/tests/conftest.py +0 -0
  48. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/tests/test_data_classes.py +0 -0
  49. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/tests/test_formatter.py +0 -0
  50. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/tests/test_init.py +0 -0
  51. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/tests/test_integrations/__init__.py +0 -0
  52. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/tests/test_integrations/test_base.py +0 -0
  53. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/tests/test_integrations/test_fastapi.py +0 -0
  54. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/tests/test_integrations/test_httpx.py +0 -0
  55. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/tests/test_integrations/test_redis.py +0 -0
  56. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/tests/test_integrations/test_sqlalchemy.py +0 -0
  57. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/tests/test_metrics/__init__.py +0 -0
  58. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/tests/test_metrics/test_db.py +0 -0
  59. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/tests/test_metrics/test_http.py +0 -0
  60. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/tests/test_metrics/test_redis.py +0 -0
  61. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/tests/test_sanitizer.py +0 -0
  62. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/tests/test_schemas.py +0 -0
  63. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/tests/test_types.py +0 -0
  64. {road24_artifacthub-0.1.2 → road24_artifacthub-0.1.3}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: road24-artifacthub
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: Shared logging and metrics library for Road24 FastAPI microservices
5
5
  Requires-Python: >=3.12
6
6
  Requires-Dist: build>=1.4.0
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "road24-artifacthub"
3
- version = "0.1.2"
3
+ version = "0.1.3"
4
4
  description = "Shared logging and metrics library for Road24 FastAPI microservices"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
@@ -10,7 +10,7 @@ from road24_sdk._types import HttpDirection, LogType
10
10
  from road24_sdk.integrations._base import Integration
11
11
 
12
12
  if TYPE_CHECKING:
13
- from httpx import AsyncClient, Request, Response
13
+ from httpx import AsyncClient, Request, RequestNotRead, Response
14
14
 
15
15
  logger = logging.getLogger(__name__)
16
16
 
@@ -46,7 +46,7 @@ class HttpOutputLogger:
46
46
  direction=HttpDirection.OUTPUT,
47
47
  )
48
48
 
49
- request_body = self._decode_body(request.content, request.headers.get("content-type"))
49
+ request_body = self._get_request_body(request)
50
50
  response_body = self._decode_body(response.content, response.headers.get("content-type"))
51
51
 
52
52
  http_attrs = HttpAttributes(
@@ -63,6 +63,15 @@ class HttpOutputLogger:
63
63
  log_level = self._get_log_level(response.status_code)
64
64
  getattr(logger, log_level)(LogType.HTTP_REQUEST, extra=http_attrs.as_dict())
65
65
 
66
+ def _get_request_body(self, request: "Request") -> str:
67
+ from httpx import RequestNotRead
68
+
69
+ content_type = request.headers.get("content-type")
70
+ try:
71
+ return self._decode_body(request.content, content_type)
72
+ except RequestNotRead:
73
+ return "<streaming request>"
74
+
66
75
  def _decode_body(self, content: bytes, content_type: str | None) -> str:
67
76
  if not content:
68
77
  return ""