-
-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ecto_repo_init_status_info in umbrella apps #208
Comments
Have similar situation:
I tried doing it like this (stuff omitted for brevity): Main app defmodule MainApp.Application do
def start(_type, _args) do
children = [
# Telemetry supervisor
MainApp.Telemetry,
# Start before Ecto, to be able to capture init events
MainApp.Observability.PromEx,
MainApp.Repo
]
OpentelemetryEcto.setup(MainApp.Repo.config()[:telemetry_prefix])
end
end
defmodule MainApp.Observability.PromEx do
use PromEx, otp_app: :main_app
def plugins do
[
Plugins.Application,
Plugins.Beam,
Plugins.Ecto
]
end
def dashboards do
[
{:prom_ex, "application.json"},
{:prom_ex, "beam.json"},
{:prom_ex, "ecto.json"},
{:prom_ex, "plug_cowboy.json"},
{:prom_ex, "plug_router.json"},
{:prom_ex, "phoenix.json"}
]
end
end Admin Web defmodule AdminWeb.Application do
def start(_type, _args) do
children = [
AdminWeb.Endpoint,
# Start after the Endpoint, to avoid unnecessary error messages
AdminWeb.Observability.PromEx
]
OpentelemetryPhoenix.setup(adapter: :cowboy, endpoint_prefix: [:phoenix, :endpoint, :admin_web])
end
end
defmodule AdminWeb.Observability.PromEx do
use PromEx, otp_app: :admin_web
def plugins do
[
{Plugins.PlugRouter, routers: [AdminWeb.Router], event_prefix: [:admin_web, :router], ignore_routes: ["/metrics"]},
{Plugins.Phoenix, router: AdminWeb.Router, endpoint: AdminWeb.Endpoint},
Plugins.PhoenixLiveView
]
end
def dashboards do
[
{:prom_ex, "application.json"},
{:prom_ex, "beam.json"},
{:prom_ex, "ecto.json"},
{:prom_ex, "plug_cowboy.json"},
{:prom_ex, "plug_router.json"},
{:prom_ex, "phoenix.json"}
]
end
end User Web defmodule UserWeb.Application do
def start(_type, _args) do
children = [
UserWeb.Endpoint,
# Start after the Endpoint, to avoid unnecessary error messages
UserWeb.Observability.PromEx
]
OpentelemetryPhoenix.setup(adapter: :cowboy, endpoint_prefix: [:phoenix, :endpoint, :user_web])
end
end
defmodule UserWeb.Observability.PromEx do
use PromEx, otp_app: :user_web
def plugins do
[
{Plugins.PlugRouter, routers: [UserWeb.Router], event_prefix: [:user_web, :router], ignore_routes: ["/metrics"]},
{Plugins.Phoenix, router: UserWeb.Router, endpoint: UserWeb.Endpoint},
Plugins.PhoenixLiveView
]
end
def dashboards do
[
{:prom_ex, "application.json"},
{:prom_ex, "beam.json"},
{:prom_ex, "ecto.json"},
{:prom_ex, "plug_cowboy.json"},
{:prom_ex, "plug_router.json"},
{:prom_ex, "phoenix.json"}
]
end
end Each Any ideas what may be wrong? |
Update: the |
Is there any update on supporting this? |
We're having trouble making our Ecto repos appear in the dashboard in an umbrella application.
We have these apps:
my_app
: includesMyApp.Repo
my_app_web
: includes the Phoenix applicationWe put the prom_ex module into
my_app_web
, so that we can start it after the Phoenix endpoint. However, it seems that you are also expected to start prom_ex before the repo, so that it can getmy_app_prom_ex_ecto_repo_init_status_info
.Is there a workaround for umbrella applications that we can use? Or would we have to add two separate prom_ex modules, one for each app?
Related issue: #190
The text was updated successfully, but these errors were encountered: