Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.
TypeScript analyticsanalytics-dashboardclickhouseelixirgoogle-analyticsmarketingopen-source-analyticsphoenixplausible-analyticspostgresqlprivacyprivacy-friendlyself-hostedsimple-analyticsstatisticstailwindcssweb-analyticswebsite-analyticswebsite-statswebsite-tracking
Better Sentry tracking
Uku Taht7982c236c191
diff --git a/Dockerfile b/Dockerfileindex eba9f48597..09a26ce7a4 100644--- a/Dockerfile+++ b/Dockerfile@@ -41,7 +41,9 @@ COPY lib ./libRUN npm run deploy --prefix ./assets && \npm run deploy --prefix ./tracker && \mix phx.digest priv/static && \- mix download_country_database+ mix download_country_database && \+# https://hexdocs.pm/sentry/Sentry.Sources.html#module-source-code-storage+ mix sentry_recompileWORKDIR /appCOPY rel reldiff --git a/config/runtime.exs b/config/runtime.exsindex c9bbb52dac..62b92f4717 100644--- a/config/runtime.exs+++ b/config/runtime.exs@@ -112,7 +112,9 @@ config :sentry,environment_name: env,included_environments: ["prod", "staging"],release: app_version,- tags: %{app_version: app_version}+ tags: %{app_version: app_version},+ enable_source_code_context: true,+ root_source_code_path: [File.cwd!()]config :plausible, :paddle, vendor_auth_code: paddle_auth_codediff --git a/lib/plausible/application.ex b/lib/plausible/application.exindex 6b2a6b01d0..423f9383a9 100644--- a/lib/plausible/application.ex+++ b/lib/plausible/application.ex@@ -21,7 +21,7 @@ defmodule Plausible.Application do]opts = [strategy: :one_for_one, name: Plausible.Supervisor]- {:ok, _} = Logger.add_backend(Sentry.LoggerBackend)+ Logger.add_backend(Sentry.LoggerBackend)setup_cache_stats()Application.put_env(:plausible, :server_start, Timex.now())Supervisor.start_link(children, opts)diff --git a/lib/plausible_web/endpoint.ex b/lib/plausible_web/endpoint.exindex 8bd1555f9b..31a618fd6f 100644--- a/lib/plausible_web/endpoint.ex+++ b/lib/plausible_web/endpoint.ex@@ -1,6 +1,6 @@defmodule PlausibleWeb.Endpoint do- use Phoenix.Endpoint, otp_app: :plausibleuse Sentry.PlugCapture+ use Phoenix.Endpoint, otp_app: :plausible# Serve at "/" the static files from "priv/static" directory.#diff --git a/lib/plausible_web/plugs/auth_plug.ex b/lib/plausible_web/plugs/auth_plug.exindex f4ffda03bd..ee116a8f12 100644--- a/lib/plausible_web/plugs/auth_plug.ex+++ b/lib/plausible_web/plugs/auth_plug.ex@@ -20,7 +20,7 @@ defmodule PlausibleWeb.AuthPlug do)if user do- Sentry.Context.set_user_context(%{id: user.id, name: user.name})+ Sentry.Context.set_user_context(%{id: user.id, name: user.name, email: user.email})assign(conn, :current_user, user)elseconndiff --git a/mix.exs b/mix.exsindex 905e46ce72..122793bc0c 100644--- a/mix.exs+++ b/mix.exs@@ -102,7 +102,8 @@ defmodule Plausible.MixProject do["ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"],"ecto.reset": ["ecto.drop", "ecto.setup"],- test: ["ecto.create --quiet", "ecto.migrate", "test", "clean_clickhouse"]+ test: ["ecto.create --quiet", "ecto.migrate", "test", "clean_clickhouse"],+ sentry_recompile: ["compile", "deps.compile sentry --force"]]endend