Files
firezone/elixir/apps/api/mix.exs
Jamil 6be7cf6b45 feat(portal): Add Sentry reporting (#8013)
This adds https://github.com/getsentry/sentry-elixir to the portal for
automatic process crash and exception trace reporting.

It also configures Logger reporting for the `warning` level and higher,
and sets the data scrubbing rules to allow all Logger metadata keys
(`logger_metadata.*` in the Sentry project settings).

Lastly, it configures automatic HTTP error reporting by tying into the
`api` and `web` endpoint modules with a custom `plug` middleware so we
get automatic reporting of unsuccessful Phoenix responses.

It is expected this will be noisy when we first deploy and we'll need to
tune it down a bit. This is the same approach used with other Sentry
platforms.
2025-02-04 18:35:52 +00:00

88 lines
2.2 KiB
Elixir

defmodule API.MixProject do
use Mix.Project
def project do
[
app: :api,
version: version(),
build_path: "../../_build",
config_path: "../../config/config.exs",
deps_path: "../../deps",
lockfile: "../../mix.lock",
elixir: "~> 1.14",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,
test_coverage: [tool: ExCoveralls],
preferred_cli_env: [
coveralls: :test,
"coveralls.detail": :test,
"coveralls.post": :test,
"coveralls.html": :test
],
aliases: aliases(),
deps: deps()
]
end
def application do
[
mod: {API.Application, []},
extra_applications: [
:logger,
:runtime_tools
]
]
end
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
defp deps do
[
# Umbrella deps
{:domain, in_umbrella: true},
# Phoenix deps
{:phoenix, "~> 1.7.0"},
{:phoenix_ecto, "~> 4.4"},
{:plug_cowboy, "~> 2.7"},
# Observability deps
{:telemetry_metrics, "~> 1.0"},
{:telemetry_poller, "~> 1.0"},
{:opentelemetry_telemetry, "~> 1.1.1", override: true},
{:opentelemetry_cowboy, "~> 1.0"},
{:opentelemetry_phoenix, "~> 2.0"},
{:sentry, "~> 10.0"},
{:hackney, "~> 1.19"},
# Other deps
{:jason, "~> 1.2"},
{:remote_ip, "~> 1.1"},
{:open_api_spex, "~> 3.21.2"},
{:ymlr, "~> 5.0"},
# Test deps
{:credo, "~> 1.5", only: [:dev, :test], runtime: false},
{:dialyxir, "~> 1.1", only: [:dev], runtime: false},
{:junit_formatter, "~> 3.3", only: [:test]},
{:mix_audit, "~> 2.1", only: [:dev, :test]},
{:sobelow, "~> 0.12", only: [:dev, :test]}
]
end
defp aliases do
[
"ecto.seed": ["ecto.create", "ecto.migrate", "run ../domain/priv/repo/seeds.exs"],
"ecto.setup": ["ecto.create", "ecto.migrate"],
"ecto.reset": ["ecto.drop", "ecto.setup"],
test: ["ecto.create --quiet", "ecto.migrate", "test"]
]
end
defp version do
sha = System.get_env("GIT_SHA", "dev") |> String.trim()
"0.1.0+#{sha}"
end
end