Skip to content

Commit

Permalink
Merge pull request #22 from raphaellaude/add-sentry
Browse files Browse the repository at this point in the history
Add sentry
  • Loading branch information
raphaellaude authored Oct 13, 2024
2 parents dc5c627 + 63c78e6 commit 1d5bc54
Show file tree
Hide file tree
Showing 8 changed files with 207 additions and 4 deletions.
2 changes: 1 addition & 1 deletion backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The path to your assets should matches that used when running the pipeline.
3. Run the server:

```bash
poetry run uvicorn main:app --reload`
poetry run uvicorn main:app --reload
```

## Deployment
Expand Down
7 changes: 7 additions & 0 deletions backend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@
from pyproj import Transformer
from barcode import EAN13
from barcode.errors import NumberOfDigitsError
import sentry_sdk

sentry_sdk.init(
dsn="https://ade1c60a5cd99ca0404fd00c38063620@o4506839635853312.ingest.us.sentry.io/4506839636180992",
traces_sample_rate=1.0,
profiles_sample_rate=0.1,
)

logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
Expand Down
75 changes: 72 additions & 3 deletions backend/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ pyproj = "^3.6.1"
pyogrio = "^0.7.2"
geopandas = "^0.14.3"
python-barcode = "^0.15.1"
sentry-sdk = {extras = ["fastapi"], version = "^2.16.0"}
numpy = "<2.0"


[build-system]
Expand Down
4 changes: 4 additions & 0 deletions pluto-hist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
<script src="https://unpkg.com/maplibre-gl@latest/dist/maplibre-gl.js"></script>
<script src="/htmx.min.js"></script>
<script src="https://unpkg.com/[email protected]"></script>
<script
src="https://js.sentry-cdn.com/e405c9bd0305a5b3d13e603b05e2c619.min.js"
crossorigin="anonymous"
></script>
<link
href="https://unpkg.com/maplibre-gl@latest/dist/maplibre-gl.css"
rel="stylesheet"
Expand Down
17 changes: 17 additions & 0 deletions pluto-hist/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@ import "./style.css";
import * as pmtiles from "pmtiles";
import data from "./data.json";
import choropleth from "./choropleth.json";
import * as Sentry from "@sentry/browser";

Sentry.init({
dsn: "https://e405c9bd0305a5b3d13e603b05e2c619@o4506839635853312.ingest.us.sentry.io/4508115982548992",
integrations: [
Sentry.browserTracingIntegration(),
Sentry.replayIntegration(),
],
// https://pluto-hist-backend-v2.fly.dev/
tracesSampleRate: 1.0,
tracePropagationTargets: [
"localhost",
/^https:\/\/pluto-hist-backend-v2\.fly\.dev/,
],
replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1.0,
});

let protocol = new pmtiles.Protocol();
maplibregl.addProtocol("pmtiles", protocol.tile);
Expand Down
103 changes: 103 additions & 0 deletions pluto-hist/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pluto-hist/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"vite": "^4.4.5"
},
"dependencies": {
"@sentry/browser": "^8.34.0",
"pmtiles": "3.0.0-alpha.2"
}
}

0 comments on commit 1d5bc54

Please sign in to comment.