Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Add sentry service #758

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

ENH: Add sentry service #758

wants to merge 1 commit into from

Conversation

sanand0
Copy link
Contributor

@sanand0 sanand0 commented Jul 3, 2023

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://xxx@xxx.ingest.sentry.io/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:

  1. The gramex tag set to the Gramex version (e.g. 1.92.0)
  2. The cwd tag is set to the current working directory (e.g. C:\temp\)
  3. The port tag is set to the port Gramex is running on (e.g. 9988)
  4. The user is set based on the current user object (e.g. {"id": "user@example.org", "role": "..."}

You can pass options to configure Sentry, like:

sentry:
  dsn: "https://xxx@xxx.ingest.sentry.io/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.

@sanand0 sanand0 requested a review from jaidevd July 3, 2023 03:38
@sanand0 sanand0 self-assigned this Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant