akoutmos / prom_ex

An Elixir Prometheus metrics collection library built on top of Telemetry with accompanying Grafana dashboards
MIT License
577 stars 96 forks source link

[FEATURE] Allow customizing dashboard UID #214

Open sourcehawk opened 9 months ago

sourcehawk commented 9 months ago

Is your feature request related to a problem? Please describe.

Describe the solution you would like to see

How would you expect this feature to work

Within MyApp.PromEx module

@impl true
  def plugins do
    [
      # Injecting dashboard uid's 
      {Plugins.Application, dashboard_uid: "myapp_application"}
      {Plugins.PhoenixLiveView, dashboard_uid: "myapp_phoenix_liveview"}
      {Plugins.Ecto, dashboard_uid: "myapp_ecto"}
      {Plugins.Oban, dashboard_uid: "myapp_oban"}
      {Plugins.Beam, dashboard_uid: "myapp_beam"}
    ]
  end

Additional context

This is the main functionality that would have to be updated: https://github.com/akoutmos/prom_ex/blob/master/lib/prom_ex/dashboard_renderer.ex#L90C3-L90C3 (dashboard renderer)