File tree Expand file tree Collapse file tree 3 files changed +21
-1
lines changed
Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 44 Changelog
55=========
66
7+ - :release: `1.2.0 <20th February 2023> `
8+ - :feature: `5 ` Add Sentry.io
9+
710- :release: `1.1.0 <13th February 2023> `
811- :feature: `2 ` Bump fastapi from 0.90.1 to 0.91.0
912
Original file line number Diff line number Diff line change 11[project ]
22name = " api.letsbuilda.dev"
33description = " Public API for our projects"
4- version = " 1.1 .0"
4+ version = " 1.2 .0"
55authors = [
66 {
name =
" Bradley Reynolds" ,
email =
" [email protected] " },
77]
@@ -12,6 +12,7 @@ dependencies = [
1212 " fastapi==0.92.0" ,
1313 " uvicorn[standard]==0.20.0" ,
1414 " imsosorry==1.2.0" ,
15+ " sentry-sdk[fastapi]==1.15.0" ,
1516]
1617
1718[project .urls ]
Original file line number Diff line number Diff line change 11"""API server definition"""
22
3+ from os import getenv
4+
5+ import sentry_sdk
36from fastapi import APIRouter , FastAPI
47from imsosorry import uwuify
58
811
912from . import __version__
1013
14+ release_prefix = getenv ("API_SENTRY_RELEASE_PREFIX" , "api" )
15+ git_sha = getenv ("GIT_SHA" , "development" )
16+ sentry_sdk .init (
17+ dsn = getenv ("API_SENTRY_DSN" ),
18+ environment = getenv ("API_SENTRY_ENV" ),
19+ send_default_pii = True ,
20+ traces_sample_rate = 1.0 ,
21+ _experiments = {
22+ "profiles_sample_rate" : 1.0 ,
23+ },
24+ release = f"{ release_prefix } @{ git_sha } " ,
25+ )
26+
1127
1228class TextModel (BaseModel ):
1329 """Generic model for accepting arbitrary plain-text input"""
You can’t perform that action at this time.
0 commit comments