From 7c88fa0bcfaf4f440e64383a6dc4668ca44be19a Mon Sep 17 00:00:00 2001 From: Nick Krichevsky Date: Wed, 1 Jul 2026 13:07:34 +0000 Subject: [PATCH 1/3] Fix compiler warnings --- config/config.exs | 4 ++-- config/dev.exs | 2 +- config/prod.exs | 2 +- config/test.exs | 2 +- lib/fast_counter.ex | 4 ++-- lib/instruments.ex | 8 ++++---- lib/macro_helpers.ex | 2 +- lib/probe/definitions.ex | 2 +- lib/probe/runner.ex | 2 +- lib/rate_tracker.ex | 4 ++-- lib/sysmon/emitter.ex | 2 +- lib/sysmon/receiver/log.ex | 12 ++++++------ lib/sysmon/reporter.ex | 2 +- 13 files changed, 24 insertions(+), 24 deletions(-) diff --git a/config/config.exs b/config/config.exs index 8233fe9..d1186fe 100644 --- a/config/config.exs +++ b/config/config.exs @@ -1,3 +1,3 @@ -use Mix.Config +import Config -import_config "#{Mix.env()}.exs" +import_config "#{config_env()}.exs" diff --git a/config/dev.exs b/config/dev.exs index d2d855e..becde76 100644 --- a/config/dev.exs +++ b/config/dev.exs @@ -1 +1 @@ -use Mix.Config +import Config diff --git a/config/prod.exs b/config/prod.exs index d2d855e..becde76 100644 --- a/config/prod.exs +++ b/config/prod.exs @@ -1 +1 @@ -use Mix.Config +import Config diff --git a/config/test.exs b/config/test.exs index 0231c27..d530754 100644 --- a/config/test.exs +++ b/config/test.exs @@ -1,4 +1,4 @@ -use Mix.Config +import Config # setting the statsd port to something other than the default # in test so we don't conflict in the build env. diff --git a/lib/fast_counter.ex b/lib/fast_counter.ex index b780002..12b5d24 100644 --- a/lib/fast_counter.ex +++ b/lib/fast_counter.ex @@ -10,12 +10,12 @@ defmodule Instruments.FastCounter do @table_prefix :instruments_counters @max_tables 128 - @report_interval_ms Application.get_env( + @report_interval_ms Application.compile_env( :instruments, :fast_counter_report_interval, 10_000 ) - @report_jitter_range_ms Application.get_env( + @report_jitter_range_ms Application.compile_env( :instruments, :fast_counter_report_jitter_range, -500..500 diff --git a/lib/instruments.ex b/lib/instruments.ex index 3ca7f94..9e57638 100644 --- a/lib/instruments.ex +++ b/lib/instruments.ex @@ -57,8 +57,8 @@ defmodule Instruments do require Logger - @metrics_module Application.get_env(:instruments, :reporter_module, Instruments.Statix) - @statsd_port Application.get_env(:instruments, :statsd_port, 8125) + @metrics_module Application.compile_env(:instruments, :reporter_module, Instruments.Statix) + @statsd_port Application.compile_env(:instruments, :statsd_port, 8125) defmacro __using__(_opts) do quote do @@ -266,7 +266,7 @@ defmodule Instruments do ) Application.get_env(:instruments, :warn_on_memory_stats_unsupported?, true) -> - Logger.warn( + Logger.warning( "[Instruments] not collecting memory metrics because :mseg_alloc is not enabled" ) @@ -276,7 +276,7 @@ defmodule Instruments do rescue ErlangError -> if Application.get_env(:instruments, :warn_on_memory_stats_unsupported?, true) do - Logger.warn( + Logger.warning( "[Instruments] not collecting memory metrics because :erlang.memory is unsupported (some allocator disabled?)" ) end diff --git a/lib/macro_helpers.ex b/lib/macro_helpers.ex index 804f68f..db47327 100644 --- a/lib/macro_helpers.ex +++ b/lib/macro_helpers.ex @@ -5,7 +5,7 @@ defmodule Instruments.MacroHelpers do @safe_metric_types [:increment, :decrement, :gauge, :event, :set] - @metrics_module Application.get_env(:instruments, :reporter_module, Instruments.Statix) + @metrics_module Application.compile_env(:instruments, :reporter_module, Instruments.Statix) def build_metric_macro(:measure, caller, metrics_module, key_ast, options_ast, function) do key = to_iolist(key_ast, caller) diff --git a/lib/probe/definitions.ex b/lib/probe/definitions.ex index 66450be..a2bf906 100644 --- a/lib/probe/definitions.ex +++ b/lib/probe/definitions.ex @@ -8,7 +8,7 @@ defmodule Instruments.Probe.Definitions do @type definition_errors :: {:error, {:probe_names_taken, [String.t()]}} @type definition_response :: {:ok, [String.t()]} | definition_errors - @probe_prefix Application.get_env(:instruments, :probe_prefix) + @probe_prefix Application.compile_env(:instruments, :probe_prefix) @table_name :probe_definitions def start_link(_ \\ []), do: GenServer.start_link(__MODULE__, [], name: __MODULE__) diff --git a/lib/probe/runner.ex b/lib/probe/runner.ex index 747c2fa..d89b09d 100644 --- a/lib/probe/runner.ex +++ b/lib/probe/runner.ex @@ -144,7 +144,7 @@ defmodule Instruments.Probe.Runner do Logger.info("Not Sending #{state.name} due to nil return") invalid -> - Logger.warn("Probe #{state.name} has returned an invalid value: #{inspect(invalid)}") + Logger.warning("Probe #{state.name} has returned an invalid value: #{inspect(invalid)}") end end diff --git a/lib/rate_tracker.ex b/lib/rate_tracker.ex index b13e368..0b597d2 100644 --- a/lib/rate_tracker.ex +++ b/lib/rate_tracker.ex @@ -11,12 +11,12 @@ defmodule Instruments.RateTracker do @table_prefix :instruments_rate_tracker @max_tables 128 - @report_interval_ms Application.get_env( + @report_interval_ms Application.compile_env( :instruments, :rate_tracker_report_interval, 10_000 ) - @report_jitter_range_ms Application.get_env( + @report_jitter_range_ms Application.compile_env( :instruments, :rate_tracker_report_jitter_range, -500..500 diff --git a/lib/sysmon/emitter.ex b/lib/sysmon/emitter.ex index de1e418..2e68d9c 100644 --- a/lib/sysmon/emitter.ex +++ b/lib/sysmon/emitter.ex @@ -76,6 +76,6 @@ defmodule Instruments.Sysmon.Emitter do end defp handle_event(%__MODULE__{}, event, data) do - Logger.warn("Emitter received unknown event #{inspect(event)} with data #{inspect(data)}") + Logger.warning("Emitter received unknown event #{inspect(event)} with data #{inspect(data)}") end end diff --git a/lib/sysmon/receiver/log.ex b/lib/sysmon/receiver/log.ex index 69d9592..f4dd7ce 100644 --- a/lib/sysmon/receiver/log.ex +++ b/lib/sysmon/receiver/log.ex @@ -9,23 +9,23 @@ defmodule Instruments.Sysmon.Receiver.Log do @impl true def handle_busy_port(pid, port) do - Logger.warn("Busy port: #{inspect(pid)} #{inspect(port)}") + Logger.warning("Busy port: #{inspect(pid)} #{inspect(port)}") end @impl true def handle_busy_dist_port(pid, port) do - Logger.warn("Busy dist port: #{inspect(pid)} #{inspect(port)}") + Logger.warning("Busy dist port: #{inspect(pid)} #{inspect(port)}") end @impl true def handle_long_gc(pid, info) do - Logger.warn("Long GC: #{inspect(pid)} #{inspect(info)}") + Logger.warning("Long GC: #{inspect(pid)} #{inspect(info)}") end @impl true def handle_long_message_queue(pid, long) do if long do - Logger.warn("Long message queue: #{inspect(pid)}") + Logger.warning("Long message queue: #{inspect(pid)}") else Logger.info("Long message queue resolved: #{inspect(pid)}") end @@ -33,11 +33,11 @@ defmodule Instruments.Sysmon.Receiver.Log do @impl true def handle_long_schedule(pid, info) do - Logger.warn("Long schedule: #{inspect(pid)} #{inspect(info)}") + Logger.warning("Long schedule: #{inspect(pid)} #{inspect(info)}") end @impl true def handle_large_heap(pid, info) do - Logger.warn("Large heap: #{inspect(pid)} #{inspect(info)}") + Logger.warning("Large heap: #{inspect(pid)} #{inspect(info)}") end end diff --git a/lib/sysmon/reporter.ex b/lib/sysmon/reporter.ex index 41828b8..7af2058 100644 --- a/lib/sysmon/reporter.ex +++ b/lib/sysmon/reporter.ex @@ -179,7 +179,7 @@ defmodule Instruments.Sysmon.Reporter do {pid, _} -> # Another process is already receiving system monitor events, log a warning - Logger.warn("Overwriting system monitor process: #{inspect(pid)}") + Logger.warning("Overwriting system monitor process: #{inspect(pid)}") end :erlang.system_monitor(our_pid, events) From 95ff7ce0450325aeb0d91c87ecc32b4c322c3b24 Mon Sep 17 00:00:00 2001 From: Nick Krichevsky Date: Wed, 1 Jul 2026 13:11:52 +0000 Subject: [PATCH 2/3] Bump deps and elixir version --- mix.exs | 6 +++--- mix.lock | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/mix.exs b/mix.exs index cd2593d..d09aedc 100644 --- a/mix.exs +++ b/mix.exs @@ -9,7 +9,7 @@ defmodule Instruments.Mixfile do app: :instruments, name: "Instruments", version: @version, - elixir: "~> 1.5", + elixir: "~> 1.15", build_embedded: Mix.env() == :prod, start_permanent: Mix.env() == :prod, elixirc_paths: compile_paths(Mix.env()), @@ -49,10 +49,10 @@ defmodule Instruments.Mixfile do defp deps do [ {:benchee, "~> 1.4", only: :dev}, - {:ex_doc, "~> 0.28", only: :dev, runtime: false}, + {:ex_doc, "~> 0.34", only: :dev, runtime: false}, {:recon, "~> 2.5.2"}, {:statix, "~> 1.8.0", hex: :discord_statix}, - {:dialyxir, "~> 1.0", only: :dev, runtime: false} + {:dialyxir, "~> 1.4", only: :dev, runtime: false} ] end diff --git a/mix.lock b/mix.lock index 3de1941..8e60cdc 100644 --- a/mix.lock +++ b/mix.lock @@ -1,15 +1,15 @@ %{ "benchee": {:hex, :benchee, "1.4.0", "9f1f96a30ac80bab94faad644b39a9031d5632e517416a8ab0a6b0ac4df124ce", [:mix], [{:deep_merge, "~> 1.0", [hex: :deep_merge, repo: "hexpm", optional: false]}, {:statistex, "~> 1.0", [hex: :statistex, repo: "hexpm", optional: false]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "299cd10dd8ce51c9ea3ddb74bb150f93d25e968f93e4c1fa31698a8e4fa5d715"}, "deep_merge": {:hex, :deep_merge, "1.0.0", "b4aa1a0d1acac393bdf38b2291af38cb1d4a52806cf7a4906f718e1feb5ee961", [:mix], [], "hexpm", "ce708e5f094b9cd4e8f2be4f00d2f4250c4095be93f8cd6d018c753894885430"}, - "dialyxir": {:hex, :dialyxir, "1.0.0", "6a1fa629f7881a9f5aaf3a78f094b2a51a0357c843871b8bc98824e7342d00a5", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "aeb06588145fac14ca08d8061a142d52753dbc2cf7f0d00fc1013f53f8654654"}, + "dialyxir": {:hex, :dialyxir, "1.4.7", "dda948fcee52962e4b6c5b4b16b2d8fa7d50d8645bbae8b8685c3f9ecb7f5f4d", [:mix], [{:erlex, ">= 0.2.8", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "b34527202e6eb8cee198efec110996c25c5898f43a4094df157f8d28f27d9efe"}, "earmark": {:hex, :earmark, "1.3.1", "73812f447f7a42358d3ba79283cfa3075a7580a3a2ed457616d6517ac3738cb9", [:mix], [], "hexpm", "000aaeff08919e95e7aea13e4af7b2b9734577b3e6a7c50ee31ee88cab6ec4fb"}, - "earmark_parser": {:hex, :earmark_parser, "1.4.26", "f4291134583f373c7d8755566122908eb9662df4c4b63caa66a0eabe06569b0a", [:mix], [], "hexpm", "48d460899f8a0c52c5470676611c01f64f3337bad0b26ddab43648428d94aabc"}, - "erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"}, - "ex_doc": {:hex, :ex_doc, "0.28.4", "001a0ea6beac2f810f1abc3dbf4b123e9593eaa5f00dd13ded024eae7c523298", [:mix], [{:earmark_parser, "~> 1.4.19", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "bf85d003dd34911d89c8ddb8bda1a958af3471a274a4c2150a9c01c78ac3f8ed"}, - "makeup": {:hex, :makeup, "1.1.0", "6b67c8bc2882a6b6a445859952a602afc1a41c2e08379ca057c0f525366fc3ca", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "0a45ed501f4a8897f580eabf99a2e5234ea3e75a4373c8a52824f6e873be57a6"}, - "makeup_elixir": {:hex, :makeup_elixir, "0.16.0", "f8c570a0d33f8039513fbccaf7108c5d750f47d8defd44088371191b76492b0b", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "28b2cbdc13960a46ae9a8858c4bebdec3c9a6d7b4b9e7f4ed1502f8159f338e7"}, - "makeup_erlang": {:hex, :makeup_erlang, "0.1.1", "3fcb7f09eb9d98dc4d208f49cc955a34218fc41ff6b84df7c75b3e6e533cc65f", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "174d0809e98a4ef0b3309256cbf97101c6ec01c4ab0b23e926a9e17df2077cbb"}, - "nimble_parsec": {:hex, :nimble_parsec, "1.2.3", "244836e6e3f1200c7f30cb56733fd808744eca61fd182f731eac4af635cc6d0b", [:mix], [], "hexpm", "c8d789e39b9131acf7b99291e93dae60ab48ef14a7ee9d58c6964f59efb570b0"}, + "earmark_parser": {:hex, :earmark_parser, "1.4.45", "cba8369ab2a1342e419bc2760eec731b17be828941dcf494045d44766227e1d5", [:mix], [], "hexpm", "d3ec045bf122965db20c0bdb420e19ee1415843135327124918473feb4b328e8"}, + "erlex": {:hex, :erlex, "0.2.9", "7debbbaa9f4f368b8cd648983e0f1d7963028508e9c59e9d4ed504e94ef52a55", [:mix], [], "hexpm", "8cfffc0ec7159e6d73de2ab28a588064de80f88b2798d5cbe4482cbbc200178b"}, + "ex_doc": {:hex, :ex_doc, "0.40.3", "4a972ffe64bc07dc605af487e98fc19b72a4185f55ca031b94c0552d6071c1d9", [:mix], [{:earmark_parser, "~> 1.4.44", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "2756e357742fecd9749b489b85d67c9ce99c465f2e75728d9e6dc8d704b973de"}, + "makeup": {:hex, :makeup, "1.2.1", "e90ac1c65589ef354378def3ba19d401e739ee7ee06fb47f94c687016e3713d1", [:mix], [{:nimble_parsec, "~> 1.4", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "d36484867b0bae0fea568d10131197a4c2e47056a6fbe84922bf6ba71c8d17ce"}, + "makeup_elixir": {:hex, :makeup_elixir, "1.0.1", "e928a4f984e795e41e3abd27bfc09f51db16ab8ba1aebdba2b3a575437efafc2", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "7284900d412a3e5cfd97fdaed4f5ed389b8f2b4cb49efc0eb3bd10e2febf9507"}, + "makeup_erlang": {:hex, :makeup_erlang, "1.1.0", "835f7e60792e08824cda445639555d7bf1bbbddb1b60b306e33cb6f6db24dc74", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "1cd6780fb1dd1a03979abaed0fe82712b0625118fd5257d3ebbf73f960c73c3c"}, + "nimble_parsec": {:hex, :nimble_parsec, "1.4.2", "8efba0122db06df95bfaa78f791344a89352ba04baedd3849593bfce4d0dc1c6", [:mix], [], "hexpm", "4b21398942dda052b403bbe1da991ccd03a053668d147d53fb8c4e0efe09c973"}, "recon": {:hex, :recon, "2.5.2", "cba53fa8db83ad968c9a652e09c3ed7ddcc4da434f27c3eaa9ca47ffb2b1ff03", [:mix, :rebar3], [], "hexpm", "2c7523c8dee91dff41f6b3d63cba2bd49eb6d2fe5bf1eec0df7f87eb5e230e1c"}, "statistex": {:hex, :statistex, "1.1.0", "7fec1eb2f580a0d2c1a05ed27396a084ab064a40cfc84246dbfb0c72a5c761e5", [:mix], [], "hexpm", "f5950ea26ad43246ba2cce54324ac394a4e7408fdcf98b8e230f503a0cba9cf5"}, "statix": {:hex, :discord_statix, "1.8.0", "11a5daa60029b39cfab2e11f7158bb1be3a426a9349731145184c3e257bd820a", [:mix], [], "hexpm", "a840f9c2f5789986830cb259e50947c5263c09eaf8c1662b9511f28e772a7acd"}, From cc1efdaa202a75853a1510df21bf733a462c8002 Mon Sep 17 00:00:00 2001 From: Nick Krichevsky Date: Wed, 1 Jul 2026 13:13:35 +0000 Subject: [PATCH 3/3] Remove 1.12 CI --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 32f5fa3..8a826fc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,8 +15,6 @@ jobs: max-parallel: 1 matrix: include: - - elixir-version: 1.12.3 - otp-version: 24.3 - elixir-version: 1.15.5 otp-version: 25.3 - elixir-version: 1.16.2