Skip to content

Instantly share code, notes, and snippets.

@bolinocroustibat
Created August 7, 2020 05:41
Show Gist options
  • Save bolinocroustibat/3ec52cb919c7fe0e5921fc27d356085e to your computer and use it in GitHub Desktop.
Save bolinocroustibat/3ec52cb919c7fe0e5921fc27d356085e to your computer and use it in GitHub Desktop.
import sentry_sdk
from sentry_sdk.integrations.aws_lambda import AwsLambdaIntegration
import toml
config = toml.load("./pyproject.toml")
# Sentry error logging
app_name = config["tool"]["poetry"]["name"]
version = config["tool"]["poetry"]["version"]
sentry_sdk.init(
dsn=os.environ["SENTRY_DSN"],
integrations=[AwsLambdaIntegration()],
environment=os.environ["STAGE_NAME"],
release=f"{app_name}@{version}",
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment