Skip to content

Commit

Permalink
refactor: nit changes
Browse files Browse the repository at this point in the history
  • Loading branch information
avilagaston9 committed Jul 29, 2024
1 parent 27b5e28 commit eed1b17
Show file tree
Hide file tree
Showing 10 changed files with 4 additions and 23 deletions.
1 change: 0 additions & 1 deletion config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ config :sentry,
root_source_code_paths: [File.cwd!()]

config :lambda_ethereum_consensus, LambdaEthereumConsensus.PromEx,
disabled: false,
grafana: [
host: "http://localhost:3000",
# Authenticate via Basic Auth
Expand Down
1 change: 0 additions & 1 deletion lib/beacon_api/endpoint.ex
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ defmodule BeaconApi.Endpoint do
json_decoder: Phoenix.json_library()
)

# plug(BeaconApi.MetricsExporter)
plug(PromEx.Plug, prom_ex_module: LambdaEthereumConsensus.PromEx)
plug(BeaconApi.Router)
plug(Sentry.PlugContext)
Expand Down
2 changes: 0 additions & 2 deletions lib/lambda_ethereum_consensus/application.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ defmodule LambdaEthereumConsensus.Application do

@impl true
def start(_type, _args) do
# BeaconApi.MetricsExporter.setup()
# Configure sentry logger handler
Logger.add_handlers(:lambda_ethereum_consensus)
mode = get_operation_mode()
Expand Down Expand Up @@ -37,7 +36,6 @@ defmodule LambdaEthereumConsensus.Application do
CheckpointStates.new()

[
# LambdaEthereumConsensus.Telemetry,
LambdaEthereumConsensus.Store.Db,
LambdaEthereumConsensus.Store.Blocks,
LambdaEthereumConsensus.Store.BlockStates
Expand Down
7 changes: 0 additions & 7 deletions lib/lambda_ethereum_consensus/prom_ex_plugin.ex
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,13 @@ defmodule LambdaEthereumConsensus.PromExPlugin do
[
Polling.build(:periodic_measurements, 15_000, {__MODULE__, :periodic_measurements, []}, [
last_value([:db, :size, :total], unit: :byte),
last_value([:vm, :uptime, :total], unit: :millisecond),
last_value([:vm, :message_queue, :length], tags: [:process])
])
]
end

def periodic_measurements() do
message_queue_lengths()
uptime()
db_size()
end

Expand All @@ -110,11 +108,6 @@ defmodule LambdaEthereumConsensus.PromExPlugin do
:telemetry.execute([:db, :size], %{total: db_size})
end

def uptime() do
{uptime, _} = :erlang.statistics(:wall_clock)
:telemetry.execute([:vm, :uptime], %{total: uptime})
end

defp register_queue_length(name, len) do
:telemetry.execute([:vm, :message_queue], %{length: len}, %{process: inspect(name)})
end
Expand Down
2 changes: 1 addition & 1 deletion lib/libp2p_port.ex
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ defmodule LambdaEthereumConsensus.Libp2pPort do
discovery_addresses: [String.t()]
}

@sync_delay_millis 10_000
@sync_delay_millis 20_000

######################
### API
Expand Down
2 changes: 0 additions & 2 deletions metrics/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ services:
grafana-loki:
aliases:
- grafana
extra_hosts:
- "host.docker.internal:host-gateway"

# Since the Loki containers are running as user 10001 and the mounted data volume is owned by root,
# Loki would not have permissions to create the directories.
Expand Down
2 changes: 1 addition & 1 deletion metrics/grafana/provisioning/dashboards/home.json
Original file line number Diff line number Diff line change
Expand Up @@ -1589,7 +1589,7 @@
"uid": "PBFA97CFB590B2093"
},
"editorMode": "code",
"expr": "vm_uptime_total{}",
"expr": "lambda_ethereum_consensus_prom_ex_beam_stats_uptime_milliseconds_count{job=\"prom_ex\", instance=\"host.docker.internal:4000\"}",
"legendFormat": "Uptime",
"range": true,
"refId": "Uptime"
Expand Down
6 changes: 1 addition & 5 deletions metrics/prometheus/prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ global:
scrape_interval: 1s

scrape_configs:
# - job_name: "telemetry_metrics_prometheus"
# metrics_path: "/metrics"
# static_configs:
# - targets: ["host.docker.internal:9568"]
- job_name: "prometheus_ex"
- job_name: "prom_ex"
metrics_path: "/metrics"
static_configs:
- targets: ["host.docker.internal:4000"]
3 changes: 1 addition & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ defmodule LambdaEthereumConsensus.MixProject do
[
extra_applications:
extra_applications(System.get_env("EXTRA_APPLICATIONS")) ++
[:logger, :prometheus_ex, :runtime_tools, :observer],
[:logger, :runtime_tools, :observer],
mod: {LambdaEthereumConsensus.Application, []}
]
end
Expand All @@ -49,7 +49,6 @@ defmodule LambdaEthereumConsensus.MixProject do
{:rexbug, "~> 1.0"},
{:eep, git: "https://github.com/virtan/eep", branch: "master"},
{:protobuf, "~> 0.12.0"},
{:prometheus_ex, "~> 3.1"},
{:aja, "~> 0.6"},
{:logfmt_ex, "~> 0.4.2"},
{:ex2ms, "~> 1.6", runtime: false},
Expand Down
1 change: 0 additions & 1 deletion mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
"plug_crypto": {:hex, :plug_crypto, "2.1.0", "f44309c2b06d249c27c8d3f65cfe08158ade08418cf540fd4f72d4d6863abb7b", [:mix], [], "hexpm", "131216a4b030b8f8ce0f26038bc4421ae60e4bb95c5cf5395e1421437824c4fa"},
"prom_ex": {:hex, :prom_ex, "1.9.0", "63e6dda6c05cdeec1f26c48443dcc38ffd2118b3665ae8d2bd0e5b79f2aea03e", [:mix], [{:absinthe, ">= 1.6.0", [hex: :absinthe, repo: "hexpm", optional: true]}, {:broadway, ">= 1.0.2", [hex: :broadway, repo: "hexpm", optional: true]}, {:ecto, ">= 3.5.0", [hex: :ecto, repo: "hexpm", optional: true]}, {:finch, "~> 0.15", [hex: :finch, repo: "hexpm", optional: false]}, {:jason, "~> 1.2", [hex: :jason, repo: "hexpm", optional: false]}, {:oban, ">= 2.4.0", [hex: :oban, repo: "hexpm", optional: true]}, {:octo_fetch, "~> 0.3", [hex: :octo_fetch, repo: "hexpm", optional: false]}, {:phoenix, ">= 1.5.0", [hex: :phoenix, repo: "hexpm", optional: true]}, {:phoenix_live_view, ">= 0.14.0", [hex: :phoenix_live_view, repo: "hexpm", optional: true]}, {:plug, ">= 1.12.1", [hex: :plug, repo: "hexpm", optional: true]}, {:plug_cowboy, "~> 2.5", [hex: :plug_cowboy, repo: "hexpm", optional: false]}, {:telemetry, ">= 1.0.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:telemetry_metrics, "~> 0.6", [hex: :telemetry_metrics, repo: "hexpm", optional: false]}, {:telemetry_metrics_prometheus_core, "~> 1.0", [hex: :telemetry_metrics_prometheus_core, repo: "hexpm", optional: false]}, {:telemetry_poller, "~> 1.0", [hex: :telemetry_poller, repo: "hexpm", optional: false]}], "hexpm", "01f3d4f69ec93068219e686cc65e58a29c42bea5429a8ff4e2121f19db178ee6"},
"prometheus": {:hex, :prometheus, "4.11.0", "b95f8de8530f541bd95951e18e355a840003672e5eda4788c5fa6183406ba29a", [:mix, :rebar3], [{:quantile_estimator, "~> 0.2.1", [hex: :quantile_estimator, repo: "hexpm", optional: false]}], "hexpm", "719862351aabf4df7079b05dc085d2bbcbe3ac0ac3009e956671b1d5ab88247d"},
"prometheus_ex": {:hex, :prometheus_ex, "3.1.0", "98bdb1e9aea5001bc5f58752259d832447c06dd335cb246e89b497e2c4ec7de6", [:mix], [{:prometheus, "~> 4.0", [hex: :prometheus, repo: "hexpm", optional: false]}], "hexpm", "bc584d33aabae94ce75d477eb66c7178755b45a09afb7addb253d90eb66021de"},
"prometheus_plugs": {:hex, :prometheus_plugs, "1.1.5", "25933d48f8af3a5941dd7b621c889749894d8a1082a6ff7c67cc99dec26377c5", [:mix], [{:accept, "~> 0.1", [hex: :accept, repo: "hexpm", optional: false]}, {:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: false]}, {:prometheus_ex, "~> 1.1 or ~> 2.0 or ~> 3.0", [hex: :prometheus_ex, repo: "hexpm", optional: false]}, {:prometheus_process_collector, "~> 1.1", [hex: :prometheus_process_collector, repo: "hexpm", optional: true]}], "hexpm", "0273a6483ccb936d79ca19b0ab629aef0dba958697c94782bb728b920dfc6a79"},
"prometheus_process_collector": {:git, "https://github.com/lambdaclass/prometheus_process_collector", "3e5758401de9f97020bad3c29c3856777dc9a082", [branch: "update-makefile-to-support-otp-26"]},
"protobuf": {:hex, :protobuf, "0.12.0", "58c0dfea5f929b96b5aa54ec02b7130688f09d2de5ddc521d696eec2a015b223", [:mix], [{:jason, "~> 1.2", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm", "75fa6cbf262062073dd51be44dd0ab940500e18386a6c4e87d5819a58964dc45"},
Expand Down

0 comments on commit eed1b17

Please sign in to comment.