gramex
gramex copied to clipboard
ENH: Add sentry service
Gramex integrates with Sentry out-of-box.
First, log into Sentry, create a project and copy the DSN key.
Then, add this to gramex.yaml:
sentry:
dsn: "https://[email protected]/xxx" # paste your DSN key
When Gramex reports any errors on the console, these are automatically sent to your Sentry instance. This works with self-hosted sentry too.
Gramex adds the following information to each error:
- The
gramextag set to the Gramex version (e.g.1.92.0) - The
cwdtag is set to the current working directory (e.g.C:\temp\) - The
porttag is set to the port Gramex is running on (e.g.9988) - The
useris set based on the current user object (e.g.{"id": "[email protected]", "role": "..."}
You can pass options to configure Sentry, like:
sentry:
dsn: "https://[email protected]/xxx" # paste your DSN key
sample_rate: 0.1
server_name: my-server.example.com
environment: production
Currently, only scalar options (text, numbers, booleans) are supported, not functions.