Skip to content

Commit

Permalink
Code update to add sentry (#173)
Browse files Browse the repository at this point in the history
* Code update to add sentry

* Minor update to the code

* update to pyproject.toml

* update to pyproject

* update to puproject

* minor update

* changes to pyproject

* minor update
  • Loading branch information
ADIMANV authored Sep 20, 2024
1 parent 9ceef72 commit e2ef506
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
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

0 comments on commit e2ef506

Please sign in to comment.