Added basic prometheus config

This commit is contained in:
Kieran Eglin 2025-01-09 11:36:18 -08:00
parent 2767f6cc37
commit 721fece9ba
No known key found for this signature in database
GPG key ID: 193984967FCF432D
4 changed files with 9 additions and 12 deletions

View file

@ -100,18 +100,10 @@ config :logger, :default_formatter,
config :phoenix, :json_library, Jason
config :pinchflat, Pinchflat.PromEx,
disabled: false,
disabled: true,
manual_metrics_start_delay: :no_delay,
drop_metrics_groups: [],
metrics_server: :disabled,
grafana: [
host: System.get_env("GRAFANA_CLOUD_URL", "http://192.168.1.170:3033"),
username: System.get_env("GRAFANA_USERNAME", "admin"),
password: System.get_env("GRAFANA_PASSWORD", "admin"),
# This is an optional setting and will default to `true`
folder_name: "zero-to-graphql-using-elixir",
upload_dashboards_on_start: true
]
metrics_server: :disabled
# Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above.

View file

@ -81,3 +81,5 @@ config :phoenix_live_view, :debug_heex_annotations, true
# Disable swoosh api client as it is only required for production adapters.
config :swoosh, :api_client, false
config :pinchflat, Pinchflat.PromEx, disabled: false

View file

@ -72,6 +72,7 @@ if config_env() == :prod do
# For running PF in a subdirectory via a reverse proxy
base_route_path = System.get_env("BASE_ROUTE_PATH", "/")
enable_ipv6 = String.length(System.get_env("ENABLE_IPV6", "")) > 0
enable_prometheus = String.length(System.get_env("ENABLE_PROMETHEUS", "")) > 0
config :logger, level: String.to_existing_atom(System.get_env("LOG_LEVEL", "debug"))
@ -95,6 +96,8 @@ if config_env() == :prod do
database: db_path,
journal_mode: journal_mode
config :pinchflat, Pinchflat.PromEx, disabled: !enable_prometheus
# The secret key base is used to sign/encrypt cookies and other secrets.
# A default value is used in config/dev.exs and config/test.exs but you
# want to use a different value for prod and you most likely don't want

View file

@ -21,7 +21,7 @@ defmodule Pinchflat.PromEx do
```
def start(_type, _args) do
children = [
Pinchflat.PromEx,
Pinchflat.PromEx,P
...
]
@ -71,7 +71,7 @@ defmodule Pinchflat.PromEx do
@impl true
def dashboard_assigns do
[
datasource_id: "prometheus",
# datasource_id: "prometheus",
default_selected_interval: "30s"
]
end