-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Feature request: Sentry integration #1596
Comments
Hey @dsferruzza. I see the convenience of the Sentry integration. We've had a similar request on gitter chat and the recommendation was to use a log collector(logstash/fluentd) to send the logs to Sentry from there. That being said we've just refined our logging(#1604). We could see how that plays out with A PR would be welcomed :). I haven't used |
Hi! Using a custom log collector that sends errors to Sentry could indeed work, and provide value. But from my perspective, the main point of having a native integration is to be able to provide more context in Sentry errors (for example, which user was authenticated, or maybe what queries did PostgREST already send to the database). For example, a year ago I developed a tiny tool called Sentry Process which allows you to run any CLI process and report to Sentry if it does not exit with code 0. It works, it saved my ass in situations where I had to operate a closed-source binary that did not integrate Sentry natively, but reports are very poor because they can only leverage external outputs whereas internal context is unreachable (no stacktraces, …). That being said, Does this make sense to you? |
@dsferruzza I'm interested to know if you ever found a solution for this. I'm using Supabase so I don't have a traditional server between my app and postgres. I landed here searching for a way to add some tracing or error logging since supabase uses postgrest as a primary interface for the db. |
Unfortunately no, I do not have a solution 😐 |
I would also welcome integration with Sentry! |
This seems like a really cool feature to have on PostgREST, let's make this happen 🚀. @steve-chavez Here's my initial implementation proposal: ImplementationI am thinking of adding a configuration say TestingSince, we don't have any sentry test DSN, I am thinking of testing this feature via a mock DSN. We can do this in our Let me know your thoughts! |
@taimoorzaeem Is it possible to do the sentry integration using the observation module as described on #3140 (comment) ? (this one is for OTel, but same idea applies). We need to ensure this new logging is out of the fast path so performance is not impacted, plus adding sentry support this way would be more maintainable. |
Additionally, it seems that Sentry now uses OpenTelemetry under the hood? https://docs.sentry.io/platforms/javascript/guides/node/opentelemetry/ So maybe adding OpenTelemetry would also solve this? Or does native sentry integration (with raven-haskell) has other features? 🤔 Maybe someone that has more knowledge of Sentry can comment. |
I think that only applies to tracing, but not necessarily to error logging. I use Sentry, but I still don't have a clue.. so I might be wrong :) |
Yes, I think it would be possible, but I can't know for sure until I begin the implementation (issues come up unexpectedly). I guess we can start working on Sentry once #3140 get merged.
Agreed. |
Cool, then I guess we're fine in adding dedicated support for Sentry.
This config sounds good. I was thinking of adding a prefix, but can't think of a good one.
@taimoorzaeem Hm, waiting on #3140 shouldn't be needed. You can add a Sentry module and integrate it with AppState. |
@steve-chavez Without a "real" sentry DSN, I couldn't figure out a way to test this feature where we can be absolutely sure that the logs are being sent to sentry. |
Maybe we can test it at the Github CI level? Not sure if this would help https://github.com/getsentry/sentry-github-actions-app (Idea would be to add a secret on the repo, then check the output of a CI job that links to sentry) |
@steve-chavez Yes, this could work if we can have Sentry for PostgREST by signing up here? https://sentry.io/for/open-source/ |
Hi!
There are some cases where PostgREST can return a HTTP 500 response, for example when a stored procedure raises an exception (on purpose or not). In general (in apps I develop), I tend to deal with these unhandled exceptions by adding an integration to Sentry: it is an open source and SaaS product that ingests exception events (augmented by the integration to provide more context), aggregates them and notifies maintainers. (In my opinion, it is almost inconceivable to operate a real-world production system without this kind of tools; it is so useful 💜.)
Do you think this could be relevant to integrate Sentry in PostgREST, so that, if a Sentry DSN was provided in PostgREST's configuration, any failure (either from PostgreSQL or PostgREST itself) would be sent to Sentry?
Additional notes:
The text was updated successfully, but these errors were encountered: