Skip to content

Commit

Permalink
Update sentry sample
Browse files Browse the repository at this point in the history
  • Loading branch information
cretz committed Dec 2, 2022
1 parent 4b89477 commit 673ce72
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 7 deletions.
76 changes: 71 additions & 5 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 13 additions & 1 deletion sentry/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
# Sentry Sample

This sample shows how to configure [Sentry](https://sentry.io) to intercept & capture errors from the Temporal SDK.
This sample shows how to configure [Sentry](https://sentry.io) to intercept and capture errors from the Temporal SDK.

For this sample, the optional `sentry` dependency group must be included. To include, run:

poetry install --with sentry

To run, first see [README.md](../README.md) for prerequisites. Set `SENTRY_DSN` environment variable to the Sentry DSN.
Then, run the following from this directory to start the worker:

poetry run python worker.py

This will start the worker. Then, in another terminal, run the following to execute the workflow:

poetry run python starter.py

The workflow should complete with the hello result. If you alter the workflow or the activity to raise an
`ApplicationError` instead, it should appear in Sentry.
2 changes: 1 addition & 1 deletion sentry/interceptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from typing import Any, Optional, Type

import sentry_sdk
from temporalio import workflow, activity
from temporalio import activity, workflow
from temporalio.worker import (
ActivityInboundInterceptor,
ExecuteActivityInput,
Expand Down

0 comments on commit 673ce72

Please sign in to comment.