Skip to content

Commit

Permalink
[#53] Accept more than one metric type
Browse files Browse the repository at this point in the history
  • Loading branch information
ferigis committed Aug 22, 2018
1 parent b98979e commit 2ef2c11
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions config/prod.exs
Expand Up @@ -34,15 +34,16 @@ 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]}.
# one receiver can subscribe to multiple metric types
config :poa_backend,
:subscriptions,
[
{:dashboard_receiver, [:ethereum_metrics]}
{:dashboard_receiver, [:ethereum_metrics, :networking_metrics]}
]

# here we define the configuration for the Authorisation endpoint
Expand Down
2 changes: 1 addition & 1 deletion lib/poa_backend/metrics/supervisor.ex
Expand Up @@ -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]
Expand Down

0 comments on commit 2ef2c11

Please sign in to comment.