|
1 |
| - |
2 |
| -# ProcessWire Sentry Integration Module |
3 |
| - |
4 | 1 |
|
| 2 | +# ProcessWire Sentry Integration Module |
5 | 3 |
|
6 |
| -This ProcessWire module integrates Sentry error tracking into your ProcessWire site, with additional support for viewing live Sentry events. |
| 4 | + |
| 5 | + |
| 6 | +This ProcessWire module integrates Sentry error tracking into your ProcessWire back-end, with additional support for front-end error tracing through the Sentry JS SDK. |
7 | 7 |
|
8 | 8 | ## 🚧 This module is not production ready
|
9 | 9 |
|
| 10 | +## Table of Contents |
| 11 | +- [Features](#features) |
| 12 | +- [Prerequisites](#prerequisites) |
| 13 | +- [Installation](#installation) |
| 14 | +- [Configuration](#configuration) |
| 15 | +- [Event Viewer](#event-viewer) |
| 16 | +- [Troubleshooting](#troubleshooting) |
| 17 | +- [Development](#development) |
| 18 | + - [Build Module Locally](#build-module-locally) |
| 19 | + - [Modify Event Viewer Locally](#modify-event-viewer-locally) |
| 20 | +- [Contributing](#contributing) |
| 21 | +- [License](#license) |
| 22 | + |
10 | 23 | ## Features
|
| 24 | +- Backend ProcessWire error tracing with Sentry |
| 25 | +- Front-end ProcessWire error tracing with Sentry JS SDK |
| 26 | +- A simple event viewer in the ProcessWire admin dashboard |
11 | 27 |
|
12 |
| -- Configure Sentry DSN, Project ID, Organization ID, and Auth Token. |
13 |
| -- Set the trace sample rate for Sentry. |
14 |
| -- View the latest events sent to Sentry in an embedded Nuxt.js application. |
| 28 | +## Prerequisites |
| 29 | +- ProcessWire 3.x |
| 30 | +- PHP 8.2 or higher |
| 31 | +- Composer |
| 32 | +- Nuxt |
15 | 33 |
|
16 |
| -## Configure |
| 34 | +## Installation |
| 35 | +1. Download the latest release of the module from the [releases page](https://github.com/ryntab/ProcessWire-Sentry/releases). |
| 36 | +2. Extract the downloaded archive and place the `ProcessWireSentry` directory in your ProcessWire project's `site/modules` directory. |
| 37 | +3. Log in to the ProcessWire admin and go to `Modules > Refresh` to refresh the module list. |
| 38 | +4. Install the `ProcessWire Sentry Integration` module. |
17 | 39 |
|
| 40 | +## Configuration |
18 | 41 | Go to the module settings in the ProcessWire admin and configure the following fields:
|
19 |
| - |
20 | 42 | - Sentry DSN: Your Sentry DSN.
|
21 | 43 | - Project ID: Your Sentry project ID.
|
22 | 44 | - Organization ID: Your Sentry organization ID.
|
23 | 45 | - Auth Token: Your Sentry auth token.
|
24 | 46 | - Trace Sample Rate: The trace sample rate for Sentry (e.g., 1.0 for 100% sampling, 0.5 for 50% sampling).
|
25 |
| -Usage |
26 | 47 |
|
27 | 48 | Once the module is installed and configured, you can view the latest events sent to Sentry directly in the ProcessWire admin interface. Navigate to the module configuration page, and the Nuxt.js application will display the events.
|
28 | 49 |
|
| 50 | +## Troubleshooting |
| 51 | +- If you encounter any issues with the module, please check the [issues](https://github.com/ryntab/ProcessWire-Sentry/issues) page to see if it has already been reported. If not, feel free to open a new issue with a detailed description of the problem. |
| 52 | +- |
29 | 53 | ## Event Viewer
|
30 | 54 |
|
31 |
| - |
| 55 | + |
| 56 | + |
| 57 | +## Development |
| 58 | + |
| 59 | +### Build Module Locally |
| 60 | +To set up this project locally or run without using a release version. Follow the instructions below. If you do not want the event-viewer, and simply want error tracing through Sentry you can safely remove the event-viewer directory. |
| 61 | + |
| 62 | + 1. Clone repository |
| 63 | + |
| 64 | + ```bash |
| 65 | + gh repo clone ryntab/ProcessWire-Sentry || https://github.com/ryntab/ProcessWire-Sentry.git |
| 66 | + ``` |
| 67 | + |
| 68 | + 3. Install Composer packages |
| 69 | + |
| 70 | + ```bash |
| 71 | + composer update |
| 72 | + ``` |
| 73 | + |
| 74 | + 4. Setup Nuxt event-viewer |
| 75 | + |
| 76 | + ```bash |
| 77 | + cd event-viewer |
| 78 | + npm run install && npm run generate |
| 79 | + ``` |
| 80 | + |
| 81 | +### Modify Event Viewer Locally. |
| 82 | +To make changes to the event-viewer Nuxt app. Follow the instructions below. |
| 83 | + 1. Clone repository |
| 84 | + |
| 85 | + ``` |
| 86 | + gh repo clone ryntab/ProcessWire-Sentry || https://github.com/ryntab/ProcessWire-Sentry.git |
| 87 | + ``` |
| 88 | +3. Navigate to event-viewer directory |
| 89 | + |
| 90 | + ``` |
| 91 | + cd event-viewer |
| 92 | + npm run install && npm run dev |
| 93 | + ``` |
| 94 | +5. In order to fetch issues from the Sentry API, an app integration token needs to be generated and your current working local environment URL needs to be whitelisted for the app integration. You will also need to set your environment variables for `SENTRY_DSN`, `SENTRY_PROJECT_ID`, `SENTRY_ORGANIZATION_ID` and `SENTRY_AUTH_TOKEN` which are loaded in the Nuxt config. |
| 95 | + |
| 96 | +
|
| 97 | + ```js |
| 98 | + runtimeConfig: { |
| 99 | + public: { |
| 100 | + SENTRY_DSN: process.env.SENTRY_DSN, |
| 101 | + SENTRY_PROJECT_ID: process.env.SENTRY_PROJECT_ID, |
| 102 | + SENTRY_ORGANIZATION_ID: process.env.SENTRY_ORGANIZATION_ID, |
| 103 | + SENTRY_AUTH_TOKEN: process.env.SENTRY_AUTH_TOKEN |
| 104 | + } |
| 105 | + } |
| 106 | + ``` |
| 107 | + |
| 108 | +## Contributing |
| 109 | +
|
| 110 | +Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request. |
0 commit comments