Wire up prom_ex with built-in Application, Beam, Phoenix, PhoenixLiveView,
and Ecto plugins, plus a custom plugin that exposes the existing
app-specific telemetry (packet pipeline, spatial PubSub, repo pool,
postgres stats, insert optimizer) as Prometheus metrics.
Mount PromEx.Plug at /metrics — internal-only, intended to be scraped
by the cluster's external Prometheus through the kube-apiserver pod
proxy. K8s pod template now carries prometheus.io/{scrape,port,path}
annotations so the existing kubernetes-pods scrape job picks it up
automatically.
PromEx is disabled in the test environment.
Also harden the packet cleanup and partition manager tests with
Repo.delete_all setup hooks so they aren't poisoned by residual rows
committed outside a sandbox transaction in earlier runs (which were
inflating delete counts and triggering ATTACH PARTITION check_violation
errors against packets_default).
151 lines
4.4 KiB
Elixir
151 lines
4.4 KiB
Elixir
defmodule Aprsme.MixProject do
|
|
use Mix.Project
|
|
|
|
def project do
|
|
[
|
|
app: :aprsme,
|
|
version: "0.2.0",
|
|
elixir: "~> 1.17",
|
|
archives: [],
|
|
compilers: Mix.compilers(),
|
|
elixirc_paths: elixirc_paths(Mix.env()),
|
|
start_permanent: Mix.env() == :prod,
|
|
aliases: aliases(),
|
|
deps: deps(),
|
|
listeners: [Phoenix.CodeReloader],
|
|
test_coverage: [
|
|
summary: [threshold: 87],
|
|
ignore_modules: [
|
|
# Test support and fixture modules — not production code.
|
|
Aprsme.AccountsFixtures,
|
|
Aprsme.MockHelpers,
|
|
Aprsme.PacketsFixtures,
|
|
Aprsme.Support.FakeSensitiveStruct,
|
|
AprsmeWeb.ChannelCase,
|
|
AprsmeWeb.ConnCase,
|
|
AprsmeWeb.TestHelpers,
|
|
# Macro-generated/template-only modules with no testable logic.
|
|
Aprsme.PostgresTypes,
|
|
AprsmeWeb.ErrorHTML,
|
|
AprsmeWeb.Layouts,
|
|
AprsmeWeb.PageHTML,
|
|
# Generated protocol implementations.
|
|
Inspect.Aprsme.Accounts.User
|
|
]
|
|
],
|
|
dialyzer: [
|
|
ignore_warnings: ".dialyzer_ignore.exs",
|
|
flags: [:error_handling, :underspecs, :unmatched_returns],
|
|
plt_file:
|
|
{:no_warn,
|
|
"_build/dev/dialyxir_erlang-#{:erlang.system_info(:otp_release)}_elixir-#{System.version()}_deps-dev.plt"}
|
|
],
|
|
releases: [
|
|
aprsme: [
|
|
steps: [:assemble]
|
|
]
|
|
]
|
|
]
|
|
end
|
|
|
|
def cli do
|
|
[
|
|
preferred_cli_env: [
|
|
coveralls: :test,
|
|
"coveralls.detail": :test,
|
|
"coveralls.post": :test,
|
|
"coveralls.html": :test
|
|
]
|
|
]
|
|
end
|
|
|
|
# Configuration for the OTP application.
|
|
#
|
|
# Type `mix help compile.app` for more information.
|
|
def application do
|
|
[
|
|
mod: {Aprsme.Application, []},
|
|
extra_applications: [:logger, :runtime_tools, :os_mon]
|
|
]
|
|
end
|
|
|
|
# Specifies which paths to compile per environment.
|
|
defp elixirc_paths(:test), do: ["lib", "test/support"]
|
|
defp elixirc_paths(_), do: ["lib"]
|
|
|
|
# Specifies your project dependencies.
|
|
#
|
|
# Type `mix help deps` for examples and options.
|
|
defp deps do
|
|
[
|
|
{:tidewave, "~> 0.5", only: :dev},
|
|
{:error_tracker, "~> 0.8"},
|
|
{:bcrypt_elixir, "~> 3.0"},
|
|
{:ecto_sql, "~> 3.13"},
|
|
{:geo, "~> 4.1"},
|
|
{:geo_postgis, "~> 3.4"},
|
|
{:gen_stage, "~> 1.2"},
|
|
{:gettext, "~> 1.0"},
|
|
{:jason, "~> 1.4"},
|
|
{:libcluster, "~> 3.3"},
|
|
{:phoenix, "~> 1.8", override: true},
|
|
{:phoenix_ecto, "~> 4.4"},
|
|
{:phoenix_html, "~> 4.3.0"},
|
|
{:phoenix_live_dashboard, "~> 0.8"},
|
|
{:phoenix_live_reload, "~> 1.2", only: :dev},
|
|
{:phoenix_live_view, "~> 1.1.26"},
|
|
{:postgrex, ">= 0.0.0"},
|
|
{:swoosh, "~> 1.23"},
|
|
{:telemetry_metrics, "~> 1.0"},
|
|
{:telemetry_poller, "~> 1.0"},
|
|
{:prom_ex, "~> 1.11"},
|
|
aprs_dep(),
|
|
{:esbuild, "~> 0.10", runtime: Mix.env() == :dev},
|
|
{:tailwind, "~> 0.4.0", runtime: Mix.env() == :dev},
|
|
{:bandit, "~> 1.5"},
|
|
{:req, "~> 0.5"},
|
|
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
|
|
{:dialyxir, "~> 1.0", only: :dev, runtime: false},
|
|
{:lazy_html, ">= 0.1.0", only: :test},
|
|
{:mix_test_watch, "~> 1.1", only: [:dev, :test]},
|
|
{:stream_data, "~> 1.3", only: [:dev, :test]},
|
|
{:mox, "~> 1.2", only: :test},
|
|
{:styler, "~> 1.10", only: :dev, runtime: false},
|
|
{:hammer, "~> 7.0"}
|
|
]
|
|
end
|
|
|
|
# Aliases are shortcuts or tasks specific to the current project.
|
|
# For example, to install project dependencies and perform other setup tasks, run:
|
|
#
|
|
# $ mix setup
|
|
#
|
|
# See the documentation for `Mix` for more info on aliases.
|
|
defp aliases do
|
|
[
|
|
setup: ["deps.get", "ecto.setup"],
|
|
compile: ["compile"],
|
|
"ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"],
|
|
"ecto.reset": ["ecto.drop", "ecto.setup"],
|
|
test: ["ecto.create --quiet", "ecto.migrate --quiet", "test"],
|
|
"test.cover": ["cmd MIX_TEST_COVERAGE=1 mix test --cover"],
|
|
"assets.deploy": [
|
|
"tailwind default --minify",
|
|
"esbuild vendor",
|
|
"esbuild vendor_css",
|
|
"esbuild core_js",
|
|
"esbuild map_js",
|
|
"esbuild chart_js",
|
|
"esbuild date_adapter",
|
|
"esbuild default --minify",
|
|
"phx.digest"
|
|
]
|
|
]
|
|
end
|
|
|
|
defp aprs_dep do
|
|
{:aprs, github: "aprsme/aprs", branch: "main"}
|
|
end
|
|
|
|
# Copy Gleam BEAM files to the release
|
|
end
|