diff --git a/docs/my-website/docs/observability/sentry.md b/docs/my-website/docs/observability/sentry.md index 44b448a0d..255dd55cf 100644 --- a/docs/my-website/docs/observability/sentry.md +++ b/docs/my-website/docs/observability/sentry.md @@ -1,14 +1,30 @@ -# Sentry Tutorial +import Image from '@theme/IdealImage'; + +# Sentry - Log LLM Exceptions [Sentry](https://sentry.io/) provides error monitoring for production. LiteLLM can add breadcrumbs and send exceptions to Sentry with this integration -This works on normal, async and streaming completion calls +Track exceptions for: +- litellm.completion() - completion()for 100+ LLMs +- litellm.acompletion() - async completion() +- Streaming completion() & acompletion() calls -### usage + + +## Usage + +### Set SENTRY_DSN & callback + +```python +import litellm, os +os.environ["SENTRY_DSN"] = "your-sentry-url" +litellm.failure_callback=["sentry"] +``` + +### Sentry callback with completion ```python import litellm from litellm import completion -litellm.set_verbose = True litellm.input_callback=["sentry"] # adds sentry breadcrumbing litellm.failure_callback=["sentry"] # [OPTIONAL] if you want litellm to capture -> send exception to sentry diff --git a/docs/my-website/img/sentry.png b/docs/my-website/img/sentry.png new file mode 100644 index 000000000..8851aef50 Binary files /dev/null and b/docs/my-website/img/sentry.png differ