Move missing_block_range_count and missing_block_count out of prose

Being in metadata will allow it to be graphed by tools.
pull/1214/head
Luke Imhoff 6 years ago
parent 1af8f89001
commit 2569d2595e
  1. 3
      apps/block_scout_web/config/config.exs
  2. 3
      apps/ethereum_jsonrpc/config/config.exs
  3. 3
      apps/explorer/config/config.exs
  4. 3
      apps/indexer/config/config.exs
  5. 28
      apps/indexer/lib/indexer/block/catchup/bound_interval_supervisor.ex
  6. 7
      apps/indexer/lib/indexer/block/catchup/fetcher.ex
  7. 11
      config/config.exs

@ -49,7 +49,8 @@ config :logger, :block_scout_web,
# keep synced with `config/config.exs`
format: "$dateT$time $metadata[$level] $message\n",
metadata:
~w(application fetcher request_id first_block_number last_block_number block_number step count error_count)a,
~w(application fetcher request_id first_block_number last_block_number missing_block_range_count missing_block_count
block_number step count error_count)a,
metadata_filter: [application: :block_scout_web]
config :spandex_phoenix, tracer: BlockScoutWeb.Tracer

@ -18,7 +18,8 @@ config :logger, :ethereum_jsonrpc,
# keep synced with `config/config.exs`
format: "$dateT$time $metadata[$level] $message\n",
metadata:
~w(application fetcher request_id first_block_number last_block_number block_number step count error_count)a,
~w(application fetcher request_id first_block_number last_block_number missing_block_range_count missing_block_count
block_number step count error_count)a,
metadata_filter: [application: :ethereum_jsonrpc]
# Import environment specific config. This must remain at the bottom

@ -51,7 +51,8 @@ config :logger, :explorer,
# keep synced with `config/config.exs`
format: "$dateT$time $metadata[$level] $message\n",
metadata:
~w(application fetcher request_id first_block_number last_block_number block_number step count error_count)a,
~w(application fetcher request_id first_block_number last_block_number missing_block_range_count missing_block_count
block_number step count error_count)a,
metadata_filter: [application: :explorer]
config :spandex_ecto, SpandexEcto.EctoLogger,

@ -20,7 +20,8 @@ config :logger, :indexer,
# keep synced with `config/config.exs`
format: "$dateT$time $metadata[$level] $message\n",
metadata:
~w(application fetcher request_id first_block_number last_block_number block_number step count error_count)a,
~w(application fetcher request_id first_block_number last_block_number missing_block_range_count missing_block_count
block_number step count error_count)a,
metadata_filter: [application: :indexer]
# Import environment specific config. This must remain at the bottom

@ -195,21 +195,20 @@ defmodule Indexer.Block.Catchup.BoundIntervalSupervisor do
new_bound_interval =
case missing_block_count do
0 ->
Logger.info(fn -> "Index already caught up." end, first_block_number: first_block_number, last_block_number: 0)
Logger.info("Index already caught up.",
first_block_number: first_block_number,
last_block_number: 0,
missing_block_count: 0
)
BoundInterval.increase(bound_interval)
_ ->
Logger.info(
fn ->
[
"Index had to catch up ",
to_string(missing_block_count),
" blocks."
]
end,
"Index had to catch up.",
first_block_number: first_block_number,
last_block_number: 0
last_block_number: 0,
missing_block_count: missing_block_count
)
BoundInterval.decrease(bound_interval)
@ -239,15 +238,10 @@ defmodule Indexer.Block.Catchup.BoundIntervalSupervisor do
Process.demonitor(ref, [:flush])
Logger.info(
fn ->
[
"Index had to catch up ",
to_string(missing_block_count),
" blocks, but the sequence was shrunk to save memory, so retrying immediately."
]
end,
"Index had to catch up, but the sequence was shrunk to save memory, so retrying immediately.",
first_block_number: first_block_number,
last_block_number: 0
last_block_number: 0,
missing_block_count: missing_block_count
)
send(self(), :catchup_index)

@ -82,9 +82,10 @@ defmodule Indexer.Block.Catchup.Fetcher do
|> Stream.map(&Enum.count/1)
|> Enum.sum()
Logger.debug(fn ->
[to_string(missing_block_count), " missed blocks in ", to_string(range_count), " ranges"]
end)
Logger.debug(fn -> "Missed blocks in ranges." end,
missing_block_range_count: range_count,
missing_block_count: missing_block_count
)
shrunk =
case missing_block_count do

@ -32,20 +32,25 @@ config :logger,
config :logger, :console,
# Use same format for all loggers, even though the level should only ever be `:error` for `:error` backend
format: "$dateT$time $metadata[$level] $message\n",
metadata: ~w(application fetcher request_id first_block_number last_block_number block_number step count error_count)a
metadata:
~w(application fetcher request_id first_block_number last_block_number missing_block_range_count missing_block_count
block_number step count error_count)a
config :logger, :ecto,
# Use same format for all loggers, even though the level should only ever be `:error` for `:error` backend
format: "$dateT$time $metadata[$level] $message\n",
metadata:
~w(application fetcher request_id first_block_number last_block_number block_number step count error_count)a,
~w(application fetcher request_id first_block_number last_block_number missing_block_range_count missing_block_count
block_number step count error_count)a,
metadata_filter: [application: :ecto]
config :logger, :error,
# Use same format for all loggers, even though the level should only ever be `:error` for `:error` backend
format: "$dateT$time $metadata[$level] $message\n",
level: :error,
metadata: ~w(application fetcher request_id first_block_number last_block_number block_number step count error_count)a
metadata:
~w(application fetcher request_id first_block_number last_block_number missing_block_range_count missing_block_count
block_number step count error_count)a
# Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above.

Loading…
Cancel
Save