Added basic prometheus config
This commit is contained in:
parent
2767f6cc37
commit
721fece9ba
4 changed files with 9 additions and 12 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue