-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #72 from otakulan/feature/tgh/prometheus-metrics
Add prometheus metrics via PromEx
- Loading branch information
Showing
9 changed files
with
102 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
defmodule Lanpartyseating.PromEx do | ||
use PromEx, otp_app: :lanpartyseating | ||
|
||
alias PromEx.Plugins | ||
|
||
@impl true | ||
def plugins do | ||
[ | ||
# PromEx built in plugins | ||
Plugins.Application, | ||
Plugins.Beam, | ||
{Plugins.Phoenix, router: LanpartyseatingWeb.Router, endpoint: LanpartyseatingWeb.Endpoint}, | ||
Plugins.Ecto, | ||
# Plugins.Oban, | ||
Plugins.PhoenixLiveView, | ||
# Plugins.Absinthe, | ||
# Plugins.Broadway, | ||
|
||
# Add your own PromEx metrics plugins | ||
# Lanpartyseating.Users.PromExPlugin | ||
] | ||
end | ||
|
||
@impl true | ||
def dashboard_assigns do | ||
[ | ||
datasource_id: System.get_env("GRAFANA_DATASOURCE_ID") || "prometheus", | ||
default_selected_interval: "30s" | ||
] | ||
end | ||
|
||
@impl true | ||
def dashboards do | ||
[ | ||
# PromEx built in Grafana dashboards | ||
{:prom_ex, "application.json"}, | ||
{:prom_ex, "beam.json"}, | ||
{:prom_ex, "phoenix.json"}, | ||
{:prom_ex, "ecto.json"}, | ||
# {:prom_ex, "oban.json"}, | ||
{:prom_ex, "phoenix_live_view.json"}, | ||
# {:prom_ex, "absinthe.json"}, | ||
# {:prom_ex, "broadway.json"}, | ||
|
||
# Add your dashboard definitions here with the format: {:otp_app, "path_in_priv"} | ||
# {:lanpartyseating, "/grafana_dashboards/user_metrics.json"} | ||
] | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters