Skip to content

Commit 0b601a9

Browse files
authored
docs: add sentry section to README
1 parent 6b852f2 commit 0b601a9

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

README.rst

+23
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,29 @@ Swagger:
288288

289289
.. image:: ./images/fastapi-jsonrpc.png
290290

291+
Sentry
292+
======
293+
294+
295+
* (auto) JRPC method name as transaction name
296+
* (only for FastApiJsonRPCIntegration) Tracing support. Single transaction for batch requests, each method is span
297+
298+
.. code-block:: python
299+
300+
import sentry_sdk
301+
from fastapi_jsonrpc.contrib.sentry import FastApiJsonRPCIntegration
302+
from sentry_sdk.integrations.starlette import StarletteIntegration
303+
from sentry_sdk.integrations.fastapi import FastApiIntegration
304+
305+
306+
sentry_sdk.init(
307+
...,
308+
integrations=[FastApiJsonRPCIntegration()],
309+
# if you do not use common (RESTlike) routes you can disable other integrations
310+
# for performance reasons
311+
disabled_integrations=[StarletteIntegration, FastApiIntegration],
312+
)
313+
291314
Development
292315
===========
293316

0 commit comments

Comments
 (0)