Skip to content

Commit 660f8a4

Browse files
committed
docs(sentry): integration guide and CI environment configuration
- docs/SENTRY_INTEGRATION.md: comprehensive guide covering setup, environment variables, sampling rates, privacy configuration, and self-hosting considerations - cloudflare-web-deploy.yml: pass VITE_SENTRY_DSN and VITE_SENTRY_ENVIRONMENT=production to deploy workflow - prepare-tofu/action.yml: forward Sentry env vars through OpenTofu infrastructure actions - changesets for Sentry integration and improved crash page
1 parent df2693b commit 660f8a4

9 files changed

Lines changed: 581 additions & 3 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
default: minor
3+
---
4+
5+
added error page making it easier to report errors when they occur in the field
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'default': minor
3+
---
4+
5+
Add Sentry integration for error tracking and bug reporting

.github/actions/prepare-tofu/action.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,16 @@ runs:
1616
steps:
1717
- name: Setup app and build
1818
uses: ./.github/actions/setup
19-
env:
20-
VITE_IS_RELEASE_TAG: ${{ inputs.is_release_tag }}
2119
with:
2220
build: 'true'
21+
env:
22+
VITE_IS_RELEASE_TAG: ${{ inputs.is_release_tag }}
23+
VITE_SENTRY_DSN: ${{ env.VITE_SENTRY_DSN }}
24+
VITE_SENTRY_ENVIRONMENT: ${{ env.VITE_SENTRY_ENVIRONMENT }}
25+
VITE_APP_VERSION: ${{ env.VITE_APP_VERSION }}
26+
SENTRY_AUTH_TOKEN: ${{ env.SENTRY_AUTH_TOKEN }}
27+
SENTRY_ORG: ${{ env.SENTRY_ORG }}
28+
SENTRY_PROJECT: ${{ env.SENTRY_PROJECT }}
2329

2430
- name: Setup OpenTofu
2531
uses: opentofu/setup-opentofu@9d84900f3238fab8cd84ce47d658d25dd008be2f # v1.0.8

.github/workflows/cloudflare-web-deploy.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ jobs:
5656
uses: ./.github/actions/prepare-tofu
5757
with:
5858
is_release_tag: ${{ startsWith(github.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch' && inputs.git_tag != '') }}
59+
env:
60+
VITE_SENTRY_DSN: ${{ secrets.VITE_SENTRY_DSN }}
61+
VITE_SENTRY_ENVIRONMENT: production
62+
VITE_APP_VERSION: ${{ github.ref_name }}
63+
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
64+
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
65+
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
5966

6067
- name: Comment PR plan
6168
uses: dflook/tofu-plan@3f5dc358343fb58cd60f83b019e810315aa8258f # v2.2.3
@@ -82,6 +89,13 @@ jobs:
8289
uses: ./.github/actions/prepare-tofu
8390
with:
8491
is_release_tag: ${{ startsWith(github.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch' && inputs.git_tag != '') }}
92+
env:
93+
VITE_SENTRY_DSN: ${{ secrets.VITE_SENTRY_DSN }}
94+
VITE_SENTRY_ENVIRONMENT: production
95+
VITE_APP_VERSION: ${{ github.ref_name }}
96+
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
97+
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
98+
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
8599

86100
- name: Plan infrastructure
87101
run: tofu plan -input=false -no-color

Caddyfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,6 @@
1515
}
1616

1717
try_files {path} /index.html
18-
}
18+
19+
# Required for Sentry browser profiling (JS Self-Profiling API)
20+
header Document-Policy "js-profiling"

contrib/nginx/cinny.domain.tld.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ server {
2020
location / {
2121
root /opt/cinny/dist/;
2222

23+
# Required for Sentry browser profiling (JS Self-Profiling API)
24+
add_header Document-Policy "js-profiling" always;
25+
2326
rewrite ^/config.json$ /config.json break;
2427
rewrite ^/manifest.json$ /manifest.json break;
2528

0 commit comments

Comments
 (0)