Packages
prom_ex
1.12.0
1.12.0
1.11.0
1.10.0
1.9.0
1.8.0
1.7.1
1.7.0
retired
1.6.0
1.5.0
1.4.1
1.4.0
1.3.0
1.2.2
1.2.1
1.2.0
1.1.1
1.1.0
1.0.1
1.0.0
0.1.15-beta
0.1.14-beta
0.1.13-beta
0.1.12-beta
0.1.11-alpha
0.1.10-alpha
0.1.9-alpha
0.1.8-alpha
0.1.7-alpha
0.1.6-alpha
0.1.5-alpha
0.1.4-alpha
0.1.3-alpha
0.1.2-alpha
0.1.1-alpha
0.1.0-alpha
Prometheus metrics and Grafana dashboards for all of your favorite Elixir libraries
Current section
Files
Jump to
Current section
Files
mix.exs
defmodule PromEx.MixProject do
use Mix.Project
def project do
[
app: :prom_ex,
version: "1.12.0",
elixir: "~> 1.14",
name: "PromEx",
source_url: "https://github.com/akoutmos/prom_ex",
homepage_url: "https://hex.pm/packages/prom_ex",
description: "Prometheus metrics and Grafana dashboards for all of your favorite Elixir libraries",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,
test_coverage: [tool: ExCoveralls],
dialyzer: [
plt_add_apps: [
:absinthe,
:broadway,
:ecto,
:mix,
:oban,
:phoenix,
:plug,
:telemetry_metrics,
:telemetry_metrics_prometheus_core
],
plt_file: {:no_warn, "priv/plts/dialyzer.plt"}
],
package: package(),
deps: deps(),
docs: docs(),
aliases: aliases()
]
end
# Run "mix help compile.app" to learn about applications.
def application do
[
extra_applications: [:logger]
]
end
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
def cli do
[
preferred_envs: [
coveralls: :test,
"coveralls.detail": :test,
"coveralls.post": :test,
"coveralls.html": :test,
"coveralls.github": :test
]
]
end
# Run "mix help deps" to learn about dependencies.
defp deps do
[
# Required dependencies
{:jason, "~> 1.4"},
{:finch, "~> 0.18"},
{:telemetry, ">= 1.0.0"},
{:telemetry_poller, "~> 1.1"},
{:telemetry_metrics, "~> 1.0"},
{:telemetry_metrics_prometheus_core, "~> 1.2"},
{:peep, "~> 3.0 or ~> 4.0"},
{:octo_fetch, "~> 0.4"},
# Optional dependencies depending on what telemetry events the user is interested in capturing
{:phoenix, ">= 1.7.0", optional: true},
{:phoenix_live_view, ">= 0.20.0", optional: true},
{:plug, ">= 1.16.0", optional: true},
{:plug_cowboy, ">= 2.6.0", optional: true},
{:ecto, ">= 3.14.0", optional: true},
{:oban, ">= 2.10.0", optional: true},
{:absinthe, ">= 1.8.0", optional: true},
{:broadway, ">= 1.1.0", optional: true},
# PromEx development related dependencies
{:bypass, "~> 2.1", only: :test},
{:ex_doc, "~> 0.40.3", only: :dev},
{:excoveralls, "~> 0.18.2", only: :test, runtime: false},
{:doctor, "~> 0.23.0", only: :dev},
{:credo, "~> 1.7.19", only: :dev},
{:dialyxir, "~> 1.4.7", only: :dev, runtime: false}
]
end
defp docs do
[
main: "readme",
source_ref: "master",
logo: "guides/images/logo.svg",
extras: [
"README.md",
"guides/howtos/Writing PromEx Plugins.md",
"guides/howtos/Telemetry.md",
"guides/howtos/Running Multiple Agents.md",
"guides/howtos/Seeding Metrics.md",
"guides/gallery/All.md"
],
groups_for_extras: [
"How-To's": ~r/guides\/howtos\/.?/,
Grafana: ~r/guides\/gallery\/.?/
]
]
end
defp package do
[
name: "prom_ex",
files: ~w(lib guides priv/grafana_agent priv/*.eex mix.exs README.md LICENSE CHANGELOG.md),
licenses: ["MIT"],
maintainers: ["Alex Koutmos"],
links: %{
"GitHub" => "https://github.com/akoutmos/prom_ex",
"Sponsor" => "https://github.com/sponsors/akoutmos"
}
]
end
defp aliases do
[
docs: [&massage_readme/1, "docs", ©_files/1],
test: ["test --exclude mix_task:true"]
]
end
defp copy_files(_) do
# Set up directory structure
File.mkdir_p!("./doc/guides/images")
# Copy over image files
"./guides/images/"
|> File.ls!()
|> Enum.each(fn image_file ->
File.cp!("./guides/images/#{image_file}", "./doc/guides/images/#{image_file}")
end)
# Clean up previous file massaging
File.rm!("./README.md")
File.rename!("./README.md.orig", "./README.md")
end
defp massage_readme(_) do
hex_docs_friendly_header_content = """
<br>
<img align="center" width="33%" src="guides/images/logo.svg" alt="PromEx Logo" style="margin-left:33%">
<img align="center" width="70%" src="guides/images/logo_text.png" alt="PromEx Logo" style="margin-left:15%">
<br>
<div align="center">Prometheus metrics and Grafana dashboards for all of your favorite Elixir libraries</div>
<br>
--------------------
[](http://hex.pm/packages/prom_ex)
[](https://github.com/akoutmos/prom_ex/actions)
[](https://coveralls.io/github/akoutmos/prom_ex?branch=master)
[](https://elixir-lang.slack.com/archives/C01NZ0FBFSR)
[](https://github.com/sponsors/akoutmos)
"""
File.cp!("./README.md", "./README.md.orig")
readme_contents = File.read!("./README.md")
massaged_readme =
Regex.replace(
~r/<!--START-->(.|\n)*<!--END-->/,
readme_contents,
hex_docs_friendly_header_content
)
File.write!("./README.md", massaged_readme)
end
end