Skip to content

Conversation

@bolinocroustibat
Copy link
Contributor

@bolinocroustibat bolinocroustibat commented Dec 8, 2025

Improve Sentry configuration with environment and sample rate

Adds environment and configurable sample rate to Sentry initialization.
Changes:

  • Add environment parameter to Sentry initialization (defaults to "unknown" if not set)
  • Add configurable SENTRY_SAMPLE_RATE for traces and profiles sampling
  • Add ENVIRONMENT and SENTRY_SAMPLE_RATE to default config
    Apply changes to both app.py and metrics.py
    This enables filtering errors by environment in Sentry and allows adjusting sampling rates per environment.

PGREST_ENDPOINT = "http://localhost:8080"
SERVER_NAME = "localhost:8005"
SCHEME = "http"
ENVIRONMENT = "local"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed, we may not need this additional variable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, changed

@bolinocroustibat bolinocroustibat merged commit 0c5ece8 into main Dec 8, 2025
4 checks passed
@bolinocroustibat bolinocroustibat deleted the sentry-environments branch December 8, 2025 14:47
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.

3 participants