Skip to content

Commit e852d9f

Browse files
Bump sentry-sdk from 1.9.0 to 1.9.4 (#204)
* Bump sentry-sdk from 1.9.0 to 1.9.4 Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.9.0 to 1.9.4. - [Release notes](https://github.com/getsentry/sentry-python/releases) - [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md) - [Commits](getsentry/sentry-python@1.9.0...1.9.4) --- updated-dependencies: - dependency-name: sentry-sdk dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * Use new FastAPI integration method * Control Sentry traces sample rate with env variable Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Graham Beckley <[email protected]>
1 parent 3f62f43 commit e852d9f

File tree

4 files changed

+36
-12
lines changed

4 files changed

+36
-12
lines changed

jbi/app.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
import sentry_sdk
99
from fastapi import FastAPI, Request
1010
from fastapi.staticfiles import StaticFiles
11-
from sentry_sdk.integrations.asgi import SentryAsgiMiddleware
11+
from sentry_sdk.integrations.fastapi import FastApiIntegration
12+
from sentry_sdk.integrations.starlette import StarletteIntegration
1213

1314
from jbi.environment import get_settings
1415
from jbi.log import format_request_summary_fields
@@ -18,6 +19,15 @@
1819

1920
settings = get_settings()
2021

22+
sentry_sdk.init(
23+
dsn=settings.sentry_dsn,
24+
integrations=[
25+
StarletteIntegration(),
26+
FastApiIntegration(),
27+
],
28+
traces_sample_rate=settings.sentry_traces_sample_rate,
29+
)
30+
2131

2232
app = FastAPI(
2333
title="Jira Bugzilla Integration (JBI)",
@@ -29,11 +39,6 @@
2939
app.include_router(router)
3040
app.mount("/static", StaticFiles(directory=SRC_DIR / "static"), name="static")
3141

32-
sentry_sdk.init( # pylint: disable=abstract-class-instantiated # noqa: E0110
33-
dsn=settings.sentry_dsn
34-
)
35-
app.add_middleware(SentryAsgiMiddleware)
36-
3742

3843
@app.middleware("http")
3944
async def request_summary(request: Request, call_next):

jbi/environment.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ class Settings(BaseSettings):
4646

4747
# Sentry
4848
sentry_dsn: Optional[SentryDsn]
49+
sentry_traces_sample_rate: float = 1.0
4950

5051
class Config:
5152
"""Pydantic configuration"""

poetry.lock

Lines changed: 23 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ atlassian-python-api = { git = "https://github.com/atlassian-api/atlassian-pytho
1515
dockerflow = "2022.7.0"
1616
Jinja2 = "^3.1.2"
1717
pydantic-yaml = {extras = ["pyyaml","ruamel"], version = "^0.8.0"}
18-
sentry-sdk = "^1.9.0"
18+
sentry-sdk = "^1.9.4"
1919
backoff = "^2.1.2"
2020
statsd = "^3.3.0"
2121

0 commit comments

Comments
 (0)