-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Replace some Sentry.capture_message
with Logger.error
for CE
#4998
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,15 +20,15 @@ defmodule PlausibleWeb.EmailView do | |
search_query = URI.encode_query(%{query: trace_id}) | ||
path = "/organizations/sentry/issues/" | ||
|
||
if is_binary(dsn) do | ||
dsn | ||
|> URI.parse() | ||
|> Map.replace(:userinfo, nil) | ||
|> Map.replace(:path, path) | ||
|> Map.replace(:query, search_query) | ||
|> URI.to_string() | ||
else | ||
"" | ||
case dsn do | ||
{endpoint_uri, _public_key, _secret_key} when is_binary(endpoint_uri) -> | ||
URI.parse(endpoint_uri) | ||
|> Map.replace(:path, path) | ||
|> Map.replace(:query, search_query) | ||
|> URI.to_string() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is something I missed in #3843, I can split it into a separate PR. With the current Sentry client version (10.2.0) and export SENTRY_DSN=https://[email protected]/6643873 this returns iex> Sentry.Config.dsn
#==> {"https://o1012425.ingest.sentry.io/api/6643873/envelope/",
#==> "7f16d5d6ee70465789e082bd09481556", nil}
iex> PlausibleWeb.EmailView.sentry_link("trace_id")
#==> "https://o1012425.ingest.sentry.io/organizations/sentry/issues/?query=trace_id" Note that the URL still doesn't seem correct. At least for the sentry.io cloud version. It probably works for Plausible's self-hosted Sentry since the ingest and dashboard domains are the same, but the hardcoded org id might still be problematic. In case its needed for context, here's the original PR: #2617 (at the time Sentry was at 8.0.6 and |
||
|
||
_ -> | ||
"" | ||
end | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,9 @@ defmodule PlausibleWeb.ErrorReportControllerTest do | |
end | ||
|
||
test "with dsn" do | ||
sample_dsn = "https://[email protected]/1" | ||
sample_dsn = | ||
Sentry.Config.validate!(dsn: "https://[email protected]/1") | ||
|> Keyword.fetch!(:dsn) | ||
|
||
assert EmailView.sentry_link("some-trace", sample_dsn) == | ||
"https://somehost.example.com/organizations/sentry/issues/?query=some-trace" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one can possibly be improved with exceptions (CE gets a more descriptive log message, Sentry gets a stacktrace):