Skip to content

Commit

Permalink
feat: sentry (#16)
Browse files Browse the repository at this point in the history
* build: sentry

* feat: sentry

* chore: `SENTRY_LARAVEL_DSN` null for test

* build: `sentry/react`

* build: `sentry/vite-plugin`

* feat(front): sentry

* docs: update readme

* feat: dynamic plugin options

* feat: auth token

* refactor(front): `.env` variable usage

* docs: disclaimer

* docs: change alt text

---------

Co-authored-by: Gianfranco Rocco <[email protected]>
  • Loading branch information
juantejer4 and Gianfranco Rocco authored Dec 28, 2023
1 parent fe887b6 commit fb635db
Show file tree
Hide file tree
Showing 15 changed files with 1,465 additions and 166 deletions.
9 changes: 9 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ PUSHER_PORT=443
PUSHER_SCHEME=https
PUSHER_APP_CLUSTER=mt1

SENTRY_LARAVEL_DSN=
SENTRY_TRACES_SAMPLE_RATE=1.0
SENTRY_ENVIRONMENT=

VITE_APP_NAME="${APP_NAME}"
VITE_APP_ENV="${APP_ENV}"
VITE_APP_URL="${APP_URL}"
Expand All @@ -62,3 +66,8 @@ VITE_PUSHER_HOST="${PUSHER_HOST}"
VITE_PUSHER_PORT="${PUSHER_PORT}"
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

VITE_SENTRY_DSN_PUBLIC="${SENTRY_LARAVEL_DSN}"
VITE_SENTRY_ORGANIZATION=
VITE_SENTRY_PROJECT=
VITE_SENTRY_AUTH_TOKEN=
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ yarn-error.log
/reports/
/tsconfig.tsbuildinfo
/.phpunit.cache/

# Sentry Config File
.env.sentry-build-plugin
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ This step is not necessary when you use Docker.
- Php ECS
- Rector Php
- XDebug
- Sentry
- Single Action and Clean Controllers
- Request Classes
- Strict Mode
Expand Down Expand Up @@ -252,6 +253,19 @@ Full documentation of clockwork in this [link](https://underground.works/clockwo

It is mandatory to install plugin of clockwork in your browser check this [link](https://chrome.google.com/webstore/detail/clockwork/dmggabnehkmmfmdffgajcflpdjlnoemp/related?hl=es)

## Sentry

Sentry is a developer-first error tracking and performance monitoring platform. Errors are logged both from the frontend and backend. In order to get it up and running, you need to follow these steps:

1. Create an account [here](https://sentry.io)
2. Create a project within an organization
3. Copy the DSN provided below "Configure SDK" and paste it in your `.env`'s `SENTRY_LARAVEL_DSN`
4. You can test your configuration using `sail artisan sentry:test`

**DISCLAIMER**: If you see this in your network tab, it may be due to the browser you're using. This screenshot was taken from the Arc browser, which made it seem as if something was missing, while on the Google browser the request is successful.

![Sentry request error](image.png)

## HTTP Codes References

The next list contains the HTTP codes returned by the API and the meaning in the present context:
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"laravel/framework": "^10.10",
"laravel/sanctum": "^3.3",
"laravel/tinker": "^2.8",
"sentry/sentry-laravel": "^4.1",
"spatie/laravel-query-builder": "^5.6"
},
"require-dev": {
Expand Down
Loading

0 comments on commit fb635db

Please sign in to comment.