Provide analytics on Front-end
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
31
lib/service/front_end_analytics/sentry.ex
Normal file
31
lib/service/front_end_analytics/sentry.ex
Normal file
@@ -0,0 +1,31 @@
|
||||
defmodule Mobilizon.Service.FrontEndAnalytics.Sentry do
|
||||
@moduledoc """
|
||||
Sentry analytics provider
|
||||
"""
|
||||
|
||||
alias Mobilizon.Service.FrontEndAnalytics
|
||||
@behaviour FrontEndAnalytics
|
||||
|
||||
@impl FrontEndAnalytics
|
||||
def id, do: "sentry"
|
||||
|
||||
@doc """
|
||||
Whether the service is enabled
|
||||
"""
|
||||
@impl FrontEndAnalytics
|
||||
def enabled? do
|
||||
:mobilizon
|
||||
|> Application.get_env(__MODULE__, [])
|
||||
|> Keyword.get(:enabled, false)
|
||||
end
|
||||
|
||||
@doc """
|
||||
The configuration for the service
|
||||
"""
|
||||
@impl FrontEndAnalytics
|
||||
def configuration do
|
||||
:mobilizon
|
||||
|> Application.get_env(__MODULE__, [])
|
||||
|> Keyword.drop([:enabled])
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user