Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code update to add sentry #173

Merged
merged 8 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ dependencies = [
"structlog >= 23.2.0",
"urllib3 >= 2.0.2",
"xarray >= 2023.11.0",
"zarr >= 2.16.1"
"zarr >= 2.16.1",
"sentry-sdk >= 2.1.1"
]

[project.optional-dependencies]
Expand Down
12 changes: 12 additions & 0 deletions src/nwp_consumer/cmd/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@

import dask
import dask.distributed
import sentry_sdk
import structlog
import os
from docopt import docopt

from nwp_consumer import internal
Expand All @@ -58,6 +60,16 @@

log = structlog.getLogger()

#sentry
sentry_sdk.init(
dsn=os.getenv("SENTRY_DSN"),
environment=os.getenv("ENVIRONMENT", "local"),
traces_sample_rate=1
)

sentry_sdk.set_tag("app_name", "nwp_consumer")
sentry_sdk.set_tag("version", __version__)


def run(argv: list[str]) -> tuple[list[pathlib.Path], list[pathlib.Path]]:
"""Run the CLI.
Expand Down
Loading