logbrew-fastapi 0.1.7__tar.gz → 0.1.8__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 (19) hide show
  1. {logbrew_fastapi-0.1.7/src/logbrew_fastapi.egg-info → logbrew_fastapi-0.1.8}/PKG-INFO +28 -2
  2. logbrew_fastapi-0.1.7/PKG-INFO → logbrew_fastapi-0.1.8/README.md +24 -23
  3. {logbrew_fastapi-0.1.7 → logbrew_fastapi-0.1.8}/pyproject.toml +5 -2
  4. logbrew_fastapi-0.1.7/README.md → logbrew_fastapi-0.1.8/src/logbrew_fastapi.egg-info/PKG-INFO +49 -0
  5. logbrew_fastapi-0.1.8/src/logbrew_fastapi.egg-info/requires.txt +5 -0
  6. logbrew_fastapi-0.1.7/src/logbrew_fastapi.egg-info/requires.txt +0 -2
  7. {logbrew_fastapi-0.1.7 → logbrew_fastapi-0.1.8}/setup.cfg +0 -0
  8. {logbrew_fastapi-0.1.7 → logbrew_fastapi-0.1.8}/src/logbrew_fastapi/__init__.py +0 -0
  9. {logbrew_fastapi-0.1.7 → logbrew_fastapi-0.1.8}/src/logbrew_fastapi/examples/__init__.py +0 -0
  10. {logbrew_fastapi-0.1.7 → logbrew_fastapi-0.1.8}/src/logbrew_fastapi/examples/__main__.py +0 -0
  11. {logbrew_fastapi-0.1.7 → logbrew_fastapi-0.1.8}/src/logbrew_fastapi/examples/dependency_spans.py +0 -0
  12. {logbrew_fastapi-0.1.7 → logbrew_fastapi-0.1.8}/src/logbrew_fastapi/examples/outbound_http.py +0 -0
  13. {logbrew_fastapi-0.1.7 → logbrew_fastapi-0.1.8}/src/logbrew_fastapi/examples/readme_example.py +0 -0
  14. {logbrew_fastapi-0.1.7 → logbrew_fastapi-0.1.8}/src/logbrew_fastapi/examples/real_user_smoke.py +0 -0
  15. {logbrew_fastapi-0.1.7 → logbrew_fastapi-0.1.8}/src/logbrew_fastapi/py.typed +0 -0
  16. {logbrew_fastapi-0.1.7 → logbrew_fastapi-0.1.8}/src/logbrew_fastapi.egg-info/SOURCES.txt +0 -0
  17. {logbrew_fastapi-0.1.7 → logbrew_fastapi-0.1.8}/src/logbrew_fastapi.egg-info/dependency_links.txt +0 -0
  18. {logbrew_fastapi-0.1.7 → logbrew_fastapi-0.1.8}/src/logbrew_fastapi.egg-info/top_level.txt +0 -0
  19. {logbrew_fastapi-0.1.7 → logbrew_fastapi-0.1.8}/tests/test_fastapi_integration.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: logbrew-fastapi
3
- Version: 0.1.7
3
+ Version: 0.1.8
4
4
  Summary: FastAPI integration for capturing LogBrew request spans and exceptions.
5
5
  Author: LogBrew
6
6
  License-Expression: MIT
@@ -19,7 +19,9 @@ Classifier: Typing :: Typed
19
19
  Requires-Python: >=3.10
20
20
  Description-Content-Type: text/markdown
21
21
  Requires-Dist: fastapi>=0.111.1
22
- Requires-Dist: logbrew-sdk<0.2.0,>=0.1.6
22
+ Requires-Dist: logbrew-sdk<0.2.0,>=0.1.7
23
+ Provides-Extra: celery
24
+ Requires-Dist: logbrew-sdk[celery]<0.2.0,>=0.1.7; extra == "celery"
23
25
 
24
26
  # logbrew-fastapi
25
27
 
@@ -186,6 +188,30 @@ def checkout(order_id: str) -> dict[str, object]:
186
188
 
187
189
  Run `python -m logbrew_fastapi.examples dependency-spans` to see a local request span parenting SQLite, cache, and queue child spans from an installed package. LogBrew does not patch database drivers, cache clients, queue frameworks, or broker metadata globally, and the helpers avoid SQL values, cache keys/values, queue bodies, headers, baggage, and tracestate.
188
190
 
191
+ ## Celery background jobs
192
+
193
+ Install the optional Celery path when a FastAPI service publishes or processes Celery jobs:
194
+
195
+ ```bash
196
+ python3 -m pip install "logbrew-fastapi[celery]"
197
+ ```
198
+
199
+ The base FastAPI install stays Celery-free. The extra installs the compatible core Celery integration, which you attach only to the Celery app your service owns:
200
+
201
+ ```python
202
+ from celery import Celery
203
+ from logbrew_sdk import instrument_celery_app_with_logbrew_spans
204
+
205
+ celery_app = Celery("checkout")
206
+ celery_telemetry = instrument_celery_app_with_logbrew_spans(
207
+ celery_app,
208
+ client=client,
209
+ metadata={"service": "checkout-worker"},
210
+ )
211
+ ```
212
+
213
+ Producer and worker spans share W3C trace context. An unexpected final task failure emits one trace-correlated issue with task name and exception type only; retries and exception types declared through `task.throws` stay span-only. Task IDs, arguments, results, headers, exception messages, and stack traces are excluded. Uninstall direct instrumentation after tasks drain and before shutting down its client. Separate prefork workers need child-owned clients; follow the [core Celery lifecycle and encrypted persistence setup](https://github.com/LogBrewCo/sdk/tree/main/python/logbrew_py#automatic-celery-spans) instead of sharing the FastAPI process client across forks.
214
+
189
215
  Request duration metrics are opt-in. Set `capture_request_metrics=True` to emit an explicit `http.server.duration` histogram for completed requests:
190
216
 
191
217
  ```python
@@ -1,26 +1,3 @@
1
- Metadata-Version: 2.4
2
- Name: logbrew-fastapi
3
- Version: 0.1.7
4
- Summary: FastAPI integration for capturing LogBrew request spans and exceptions.
5
- Author: LogBrew
6
- License-Expression: MIT
7
- Project-URL: Repository, https://github.com/LogBrewCo/sdk
8
- Keywords: logbrew,observability,fastapi,asgi,logs
9
- Classifier: Development Status :: 3 - Alpha
10
- Classifier: Framework :: FastAPI
11
- Classifier: Intended Audience :: Developers
12
- Classifier: Programming Language :: Python :: 3
13
- Classifier: Programming Language :: Python :: 3 :: Only
14
- Classifier: Programming Language :: Python :: 3.10
15
- Classifier: Programming Language :: Python :: 3.11
16
- Classifier: Programming Language :: Python :: 3.12
17
- Classifier: Programming Language :: Python :: 3.13
18
- Classifier: Typing :: Typed
19
- Requires-Python: >=3.10
20
- Description-Content-Type: text/markdown
21
- Requires-Dist: fastapi>=0.111.1
22
- Requires-Dist: logbrew-sdk<0.2.0,>=0.1.6
23
-
24
1
  # logbrew-fastapi
25
2
 
26
3
  <p align="center">
@@ -186,6 +163,30 @@ def checkout(order_id: str) -> dict[str, object]:
186
163
 
187
164
  Run `python -m logbrew_fastapi.examples dependency-spans` to see a local request span parenting SQLite, cache, and queue child spans from an installed package. LogBrew does not patch database drivers, cache clients, queue frameworks, or broker metadata globally, and the helpers avoid SQL values, cache keys/values, queue bodies, headers, baggage, and tracestate.
188
165
 
166
+ ## Celery background jobs
167
+
168
+ Install the optional Celery path when a FastAPI service publishes or processes Celery jobs:
169
+
170
+ ```bash
171
+ python3 -m pip install "logbrew-fastapi[celery]"
172
+ ```
173
+
174
+ The base FastAPI install stays Celery-free. The extra installs the compatible core Celery integration, which you attach only to the Celery app your service owns:
175
+
176
+ ```python
177
+ from celery import Celery
178
+ from logbrew_sdk import instrument_celery_app_with_logbrew_spans
179
+
180
+ celery_app = Celery("checkout")
181
+ celery_telemetry = instrument_celery_app_with_logbrew_spans(
182
+ celery_app,
183
+ client=client,
184
+ metadata={"service": "checkout-worker"},
185
+ )
186
+ ```
187
+
188
+ Producer and worker spans share W3C trace context. An unexpected final task failure emits one trace-correlated issue with task name and exception type only; retries and exception types declared through `task.throws` stay span-only. Task IDs, arguments, results, headers, exception messages, and stack traces are excluded. Uninstall direct instrumentation after tasks drain and before shutting down its client. Separate prefork workers need child-owned clients; follow the [core Celery lifecycle and encrypted persistence setup](https://github.com/LogBrewCo/sdk/tree/main/python/logbrew_py#automatic-celery-spans) instead of sharing the FastAPI process client across forks.
189
+
189
190
  Request duration metrics are opt-in. Set `capture_request_metrics=True` to emit an explicit `http.server.duration` histogram for completed requests:
190
191
 
191
192
  ```python
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "logbrew-fastapi"
7
- version = "0.1.7"
7
+ version = "0.1.8"
8
8
  description = "FastAPI integration for capturing LogBrew request spans and exceptions."
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -27,9 +27,12 @@ classifiers = [
27
27
  ]
28
28
  dependencies = [
29
29
  "fastapi>=0.111.1",
30
- "logbrew-sdk>=0.1.6,<0.2.0"
30
+ "logbrew-sdk>=0.1.7,<0.2.0"
31
31
  ]
32
32
 
33
+ [project.optional-dependencies]
34
+ celery = ["logbrew-sdk[celery]>=0.1.7,<0.2.0"]
35
+
33
36
  [project.urls]
34
37
  Repository = "https://github.com/LogBrewCo/sdk"
35
38
 
@@ -1,3 +1,28 @@
1
+ Metadata-Version: 2.4
2
+ Name: logbrew-fastapi
3
+ Version: 0.1.8
4
+ Summary: FastAPI integration for capturing LogBrew request spans and exceptions.
5
+ Author: LogBrew
6
+ License-Expression: MIT
7
+ Project-URL: Repository, https://github.com/LogBrewCo/sdk
8
+ Keywords: logbrew,observability,fastapi,asgi,logs
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Framework :: FastAPI
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3 :: Only
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Typing :: Typed
19
+ Requires-Python: >=3.10
20
+ Description-Content-Type: text/markdown
21
+ Requires-Dist: fastapi>=0.111.1
22
+ Requires-Dist: logbrew-sdk<0.2.0,>=0.1.7
23
+ Provides-Extra: celery
24
+ Requires-Dist: logbrew-sdk[celery]<0.2.0,>=0.1.7; extra == "celery"
25
+
1
26
  # logbrew-fastapi
2
27
 
3
28
  <p align="center">
@@ -163,6 +188,30 @@ def checkout(order_id: str) -> dict[str, object]:
163
188
 
164
189
  Run `python -m logbrew_fastapi.examples dependency-spans` to see a local request span parenting SQLite, cache, and queue child spans from an installed package. LogBrew does not patch database drivers, cache clients, queue frameworks, or broker metadata globally, and the helpers avoid SQL values, cache keys/values, queue bodies, headers, baggage, and tracestate.
165
190
 
191
+ ## Celery background jobs
192
+
193
+ Install the optional Celery path when a FastAPI service publishes or processes Celery jobs:
194
+
195
+ ```bash
196
+ python3 -m pip install "logbrew-fastapi[celery]"
197
+ ```
198
+
199
+ The base FastAPI install stays Celery-free. The extra installs the compatible core Celery integration, which you attach only to the Celery app your service owns:
200
+
201
+ ```python
202
+ from celery import Celery
203
+ from logbrew_sdk import instrument_celery_app_with_logbrew_spans
204
+
205
+ celery_app = Celery("checkout")
206
+ celery_telemetry = instrument_celery_app_with_logbrew_spans(
207
+ celery_app,
208
+ client=client,
209
+ metadata={"service": "checkout-worker"},
210
+ )
211
+ ```
212
+
213
+ Producer and worker spans share W3C trace context. An unexpected final task failure emits one trace-correlated issue with task name and exception type only; retries and exception types declared through `task.throws` stay span-only. Task IDs, arguments, results, headers, exception messages, and stack traces are excluded. Uninstall direct instrumentation after tasks drain and before shutting down its client. Separate prefork workers need child-owned clients; follow the [core Celery lifecycle and encrypted persistence setup](https://github.com/LogBrewCo/sdk/tree/main/python/logbrew_py#automatic-celery-spans) instead of sharing the FastAPI process client across forks.
214
+
166
215
  Request duration metrics are opt-in. Set `capture_request_metrics=True` to emit an explicit `http.server.duration` histogram for completed requests:
167
216
 
168
217
  ```python
@@ -0,0 +1,5 @@
1
+ fastapi>=0.111.1
2
+ logbrew-sdk<0.2.0,>=0.1.7
3
+
4
+ [celery]
5
+ logbrew-sdk[celery]<0.2.0,>=0.1.7
@@ -1,2 +0,0 @@
1
- fastapi>=0.111.1
2
- logbrew-sdk<0.2.0,>=0.1.6