Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions config/config.exs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
use Mix.Config
import Config

import_config "#{Mix.env()}.exs"
import_config "#{config_env()}.exs"
2 changes: 1 addition & 1 deletion config/dev.exs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
use Mix.Config
import Config
2 changes: 1 addition & 1 deletion config/prod.exs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
use Mix.Config
import Config
2 changes: 1 addition & 1 deletion config/test.exs
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 2 additions & 2 deletions lib/fast_counter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions lib/instruments.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
)

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/macro_helpers.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion lib/probe/definitions.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
Expand Down
2 changes: 1 addition & 1 deletion lib/probe/runner.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions lib/rate_tracker.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/sysmon/emitter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 6 additions & 6 deletions lib/sysmon/receiver/log.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,35 @@ 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
end

@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
2 changes: 1 addition & 1 deletion lib/sysmon/reporter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down Expand Up @@ -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

Expand Down
16 changes: 8 additions & 8 deletions mix.lock
Original file line number Diff line number Diff line change
@@ -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"},
Expand Down
Loading