File tree Expand file tree Collapse file tree 10 files changed +34
-23
lines changed Expand file tree Collapse file tree 10 files changed +34
-23
lines changed Original file line number Diff line number Diff line change @@ -120,9 +120,8 @@ defmodule Plausible.Cache.Adapter do
120
120
{ :ok , result }
121
121
catch
122
122
:exit , { :timeout , _ } ->
123
- Sentry . capture_message (
124
- "Timeout while executing with lock on key in '#{ inspect ( cache_name ) } '" ,
125
- extra: % { key: key }
123
+ Logger . error ( "Timeout while executing with lock on key in '#{ inspect ( cache_name ) } '" ,
124
+ sentry: % { extra: % { key: key } }
126
125
)
127
126
128
127
{ :error , :timeout }
Original file line number Diff line number Diff line change @@ -93,7 +93,11 @@ defmodule Plausible.Google.HTTP do
93
93
{ :error , error }
94
94
95
95
{ :error , % { reason: _ } = e } ->
96
- Sentry . capture_message ( "Error fetching Google queries" , extra: % { error: inspect ( e ) } )
96
+ # TODO
97
+ Logger . error ( "Error fetching Google queries" ,
98
+ sentry: % { extra: % { error: inspect ( e ) } }
99
+ )
100
+
97
101
{ :error , :unknown_error }
98
102
end
99
103
end
Original file line number Diff line number Diff line change @@ -82,14 +82,14 @@ defmodule Plausible.Ingestion.Counters do
82
82
83
83
try do
84
84
{ _ , _ } = AsyncInsertRepo . insert_all ( Record , records )
85
- catch
86
- _ , thrown ->
87
- Sentry . capture_message (
88
- "Caught an error when trying to flush ingest counters." ,
89
- extra: % {
90
- number_of_records: Enum . count ( records ) ,
91
- error: inspect ( thrown )
92
- }
85
+ rescue
86
+ e ->
87
+ msg = Exception . format_error ( e , __STACKTRACE__ )
88
+
89
+ # TODO
90
+ Logger . error ( "Caught an error when trying to flush ingest counters: \n " <> msg ,
91
+ crash_reason: { e , __STACKTRACE__ } ,
92
+ extra: % { number_of_records: Enum . count ( records ) }
93
93
)
94
94
end
95
95
end
Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ defmodule Plausible.Ingestion.Event do
10
10
alias Plausible.ClickhouseEventV2
11
11
alias Plausible.Site.GateKeeper
12
12
13
+ require Logger
14
+
13
15
defstruct domain: nil ,
14
16
site: nil ,
15
17
clickhouse_event_attrs: % { } ,
@@ -467,8 +469,9 @@ defmodule Plausible.Ingestion.Event do
467
469
nil
468
470
469
471
% Device { type: type } ->
470
- Sentry . capture_message ( "Could not determine device type from UAInspector" ,
471
- extra: % { type: type }
472
+ # TODO
473
+ Logger . error ( "Could not determine device type from UAInspector" ,
474
+ sentry: % { extra: % { type: type } }
472
475
)
473
476
474
477
nil
Original file line number Diff line number Diff line change @@ -363,6 +363,7 @@ defmodule Plausible.Verification.Diagnostics do
363
363
end
364
364
365
365
def interpret ( diagnostics , url ) do
366
+ # TODO
366
367
Sentry . capture_message ( "Unhandled case for site verification" ,
367
368
extra: % {
368
369
message: inspect ( diagnostics ) ,
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ defmodule PlausibleWeb.Api.ExternalController do
43
43
end
44
44
45
45
def error ( conn , _params ) do
46
- Sentry . capture_message ( "JS snippet error" )
46
+ Logger . error ( "JS snippet error" )
47
47
send_resp ( conn , 200 , "" )
48
48
end
49
49
Original file line number Diff line number Diff line change @@ -476,7 +476,7 @@ defmodule PlausibleWeb.AuthController do
476
476
|> redirect ( external: redirect_route )
477
477
478
478
_any ->
479
- Sentry . capture_message ( "Google OAuth callback failed. Reason: #{ inspect ( params ) } " )
479
+ Logger . error ( "Google OAuth callback failed. Reason: #{ inspect ( params ) } " )
480
480
481
481
conn
482
482
|> put_flash (
Original file line number Diff line number Diff line change @@ -614,8 +614,9 @@ defmodule PlausibleWeb.Live.Sites do
614
614
615
615
{ :noreply , socket }
616
616
else
617
- Sentry . capture_message ( "Attempting to toggle pin for invalid domain." ,
618
- extra: % { domain: domain , user: socket . assigns . current_user . id }
617
+ # TODO
618
+ Logger . error ( "Attempting to toggle pin for invalid domain." ,
619
+ sentry: % { extra: % { domain: domain , user: socket . assigns . current_user . id } }
619
620
)
620
621
621
622
{ :noreply , socket }
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ defmodule PlausibleWeb.EmailView do
16
16
Calendar . strftime ( date , "%-d %b %Y" )
17
17
end
18
18
19
+ # TODO dsn() :: nil | {String.t(), String.t(), String.t()}
19
20
def sentry_link ( trace_id , dsn \\ Sentry.Config . dsn ( ) ) do
20
21
search_query = URI . encode_query ( % { query: trace_id } )
21
22
path = "/organizations/sentry/issues/"
Original file line number Diff line number Diff line change @@ -33,11 +33,13 @@ defmodule Plausible.Workers.ImportAnalytics do
33
33
:ok
34
34
35
35
{ :error , error , error_opts } ->
36
- Sentry . capture_message ( "Failed to import from #{ site_import . source } " ,
37
- extra: % {
38
- import_id: site_import . id ,
39
- site: site_import . site . domain ,
40
- error: inspect ( error )
36
+ Logger . error ( "Failed to import from #{ site_import . source } " ,
37
+ sentry: % {
38
+ extra: % {
39
+ import_id: site_import . id ,
40
+ site: site_import . site . domain ,
41
+ error: inspect ( error )
42
+ }
41
43
}
42
44
)
43
45
You can’t perform that action at this time.
0 commit comments