[#53] Accept more than one metric type

This commit is contained in:
Felipe Ripoll 2018-08-22 13:26:05 -06:00
parent b98979ecf7
commit 2ef2c1175a
2 changed files with 4 additions and 3 deletions

View File

@ -34,7 +34,8 @@ config :poa_backend,
config :poa_backend,
:metrics,
[
:ethereum_metrics
:ethereum_metrics,
:networking_metrics
]
# here we have to define the relationship between receivers and metric types. The format is {receiver_id, [metric_type]}.
@ -42,7 +43,7 @@ config :poa_backend,
config :poa_backend,
:subscriptions,
[
{:dashboard_receiver, [:ethereum_metrics]}
{:dashboard_receiver, [:ethereum_metrics, :networking_metrics]}
]
# here we define the configuration for the Authorisation endpoint

View File

@ -12,7 +12,7 @@ defmodule POABackend.Metrics.Supervisor do
metrics = Application.get_env(:poa_backend, :metrics)
children = for metric <- metrics do
worker(POABackend.Metric, [metric])
worker(POABackend.Metric, [metric], id: metric)
end
opts = [strategy: :one_for_one]