Skip to content

Commit 5441301

Browse files
authored
Merge pull request #421 from letscolife/chore-elixir-1-15-compatible
elixir 1.15 and OTP 26 compatibility
2 parents e393cd9 + c1fd003 commit 5441301

29 files changed

+231
-83
lines changed

.github/workflows/elixir.yml

+13-1
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,19 @@ jobs:
1212
unit_test:
1313
name: Unit Tests - Elixir ${{matrix.elixir}} / OTP ${{matrix.otp}}
1414
runs-on: ubuntu-20.04
15+
continue-on-error: true
1516

1617
strategy:
1718
matrix:
1819
include:
20+
- elixir: '1.15'
21+
otp: '26'
22+
- elixir: '1.15'
23+
otp: '25'
1924
- elixir: '1.14'
2025
otp: '26'
26+
- elixir: '1.13'
27+
otp: '25'
2128
- elixir: '1.12'
2229
otp: '24'
2330
- elixir: '1.11'
@@ -71,13 +78,18 @@ jobs:
7178
7279
integration_test:
7380
name: Integration Tests - Elixir ${{matrix.elixir}} / OTP ${{matrix.otp}}
74-
runs-on: ubuntu-20.04
81+
runs-on: ubuntu-latest
82+
continue-on-error: true
7583

7684
strategy:
7785
matrix:
7886
include:
87+
- elixir: '1.15'
88+
otp: '26'
7989
- elixir: '1.14'
8090
otp: '26'
91+
- elixir: '1.13'
92+
otp: '25'
8193
- elixir: '1.12'
8294
otp: '24'
8395

config/config.exs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
use Mix.Config
1+
import Config
2+
3+
config :logger, handle_sasl_reports: true
24

35
if Mix.env() == :test, do: import_config("test.exs")
46
if File.exists?("config/secret.exs"), do: import_config("secret.exs")

config/test.exs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
use Mix.Config
1+
import Config
22

3-
config :logger, level: :warn
3+
config :logger, level: :warning
44

55
config :new_relic_agent,
66
app_name: "ElixirAgentTest",

examples/apps/ecto_example/config/config.exs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use Mix.Config
1+
import Config
22

33
config :ecto_example,
44
http_port: 4001,

examples/apps/ecto_example/mix.exs

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ defmodule EctoExample.MixProject do
2929
{:new_relic_agent, path: "../../../"},
3030
{:test_support, in_umbrella: true},
3131
{:plug_cowboy, "~> 2.0"},
32-
{:ecto_sql, "~> 3.4"},
32+
{:ecto_sql, "~> 3.9"},
3333
{:postgrex, ">= 0.0.0"},
3434
{:myxql, ">= 0.0.0"},
3535
{:ecto_sqlite3, ">= 0.0.0"}

examples/apps/ecto_example/test/ecto_example_test.exs

+4-4
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ defmodule EctoExampleTest do
6464
assert TestSupport.find_metric(
6565
metrics,
6666
"Datastore/statement/SQLite3/counts/select",
67-
6
67+
4
6868
)
6969

7070
assert TestSupport.find_metric(
@@ -97,19 +97,19 @@ defmodule EctoExampleTest do
9797
assert TestSupport.find_metric(
9898
metrics,
9999
"Datastore/SQLite3/allWeb",
100-
13
100+
11
101101
)
102102

103103
assert TestSupport.find_metric(
104104
metrics,
105105
"Datastore/allWeb",
106-
37
106+
35
107107
)
108108

109109
assert TestSupport.find_metric(
110110
metrics,
111111
"Datastore/all",
112-
37
112+
35
113113
)
114114
end
115115

examples/apps/phx_example/config/config.exs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use Mix.Config
1+
import Config
22

33
config :phx_example, PhxExampleWeb.Endpoint,
44
url: [host: "localhost"],
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use Mix.Config
1+
import Config
22

33
config :redix_example,
44
http_port: 4003
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use Mix.Config
1+
import Config
22

33
config :w3c_trace_context_validation,
44
http_port: 4002

examples/config/config.exs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use Mix.Config
1+
import Config
22

33
config :logger, level: :debug
44

@@ -8,6 +8,8 @@ config :new_relic_agent,
88
license_key: "license_key",
99
trusted_account_key: "trusted_account_key"
1010

11-
import_config "../apps/*/config/config.exs"
11+
for config <- "../apps/*/config/config.exs" |> Path.expand(__DIR__) |> Path.wildcard() do
12+
import_config config
13+
end
1214

1315
if File.exists?("../../config/secret.exs"), do: import_config("secret.exs")

examples/mix.lock

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
%{
22
"castore": {:hex, :castore, "0.1.9", "eb08a94c12ebff92a92d844c6ccd90728dc7662aab9bdc8b3b785ba653c499d5", [:mix], [], "hexpm", "99c3a38ad9c0bab03fee1418c98390da1a31f3b85e317db5840d51a1443d26c8"},
3+
"cc_precompiler": {:hex, :cc_precompiler, "0.1.9", "e8d3364f310da6ce6463c3dd20cf90ae7bbecbf6c5203b98bf9b48035592649b", [:mix], [{:elixir_make, "~> 0.7", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "9dcab3d0f3038621f1601f13539e7a9ee99843862e66ad62827b0c42b2f58a54"},
34
"certifi": {:hex, :certifi, "2.5.3", "70bdd7e7188c804f3a30ee0e7c99655bc35d8ac41c23e12325f36ab449b70651", [:rebar3], [{:parse_trans, "~>3.3", [hex: :parse_trans, repo: "hexpm", optional: false]}], "hexpm", "ed516acb3929b101208a9d700062d520f3953da3b6b918d866106ffa980e1c10"},
45
"connection": {:hex, :connection, "1.1.0", "ff2a49c4b75b6fb3e674bfc5536451607270aac754ffd1bdfe175abe4a6d7a68", [:mix], [], "hexpm", "722c1eb0a418fbe91ba7bd59a47e28008a189d47e37e0e7bb85585a016b2869c"},
56
"cowboy": {:hex, :cowboy, "2.8.0", "f3dc62e35797ecd9ac1b50db74611193c29815401e53bac9a5c0577bd7bc667d", [:rebar3], [{:cowlib, "~> 2.9.1", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "~> 1.7.1", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "4643e4fba74ac96d4d152c75803de6fad0b3fa5df354c71afdd6cbeeb15fac8a"},
@@ -9,9 +10,9 @@
910
"decimal": {:hex, :decimal, "2.1.1", "5611dca5d4b2c3dd497dec8f68751f1f1a54755e8ed2a966c2633cf885973ad6", [:mix], [], "hexpm", "53cfe5f497ed0e7771ae1a475575603d77425099ba5faef9394932b35020ffcc"},
1011
"ecto": {:hex, :ecto, "3.11.1", "4b4972b717e7ca83d30121b12998f5fcdc62ba0ed4f20fd390f16f3270d85c3e", [:mix], [{:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "ebd3d3772cd0dfcd8d772659e41ed527c28b2a8bde4b00fe03e0463da0f1983b"},
1112
"ecto_sql": {:hex, :ecto_sql, "3.11.1", "e9abf28ae27ef3916b43545f9578b4750956ccea444853606472089e7d169470", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.11.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.6.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.16.0 or ~> 0.17.0 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1 or ~> 2.2", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "ce14063ab3514424276e7e360108ad6c2308f6d88164a076aac8a387e1fea634"},
12-
"ecto_sqlite3": {:hex, :ecto_sqlite3, "0.6.1", "3ad4efed19b637b810c8ca755fa0fd520fff4898a9e59c2cb57b51f0fe486a81", [:mix], [{:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:ecto, "~> 3.5", [hex: :ecto, repo: "hexpm", optional: false]}, {:ecto_sql, "~> 3.6", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:exqlite, "~> 0.5", [hex: :exqlite, repo: "hexpm", optional: false]}], "hexpm", "65796e14f5e685afce28b712287df5f4ee02471f8471097591b7fe83c1e4597d"},
13-
"elixir_make": {:hex, :elixir_make, "0.6.2", "7dffacd77dec4c37b39af867cedaabb0b59f6a871f89722c25b28fcd4bd70530", [:mix], [], "hexpm", "03e49eadda22526a7e5279d53321d1cced6552f344ba4e03e619063de75348d9"},
14-
"exqlite": {:hex, :exqlite, "0.5.7", "e78c1256cb47eba4d679e60dbd25249fb004fcfac2ddab9c7fc57c89e20faad4", [:make, :mix], [{:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:elixir_make, "~> 0.6", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "f0322f6f59989a024a808f2ed2b7e42deab0164e40ea47c338ae042a673a1e80"},
13+
"ecto_sqlite3": {:hex, :ecto_sqlite3, "0.14.0", "8710aa6de137a9c428fc86306b574777e9d545534b0259030a325948d43fc740", [:mix], [{:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:ecto, "~> 3.11", [hex: :ecto, repo: "hexpm", optional: false]}, {:ecto_sql, "~> 3.11", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:exqlite, "~> 0.9", [hex: :exqlite, repo: "hexpm", optional: false]}], "hexpm", "4f69e5df5bdf8b98d80797b1a88b1d24b13ad9f187a553241c2aa6cb7447a672"},
14+
"elixir_make": {:hex, :elixir_make, "0.7.7", "7128c60c2476019ed978210c245badf08b03dbec4f24d05790ef791da11aa17c", [:mix], [{:castore, "~> 0.1 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}], "hexpm", "5bc19fff950fad52bbe5f211b12db9ec82c6b34a9647da0c2224b8b8464c7e6c"},
15+
"exqlite": {:hex, :exqlite, "0.17.0", "865ab503debde7913ffa02b58838ab92885165978f4c88d8169ee8688c655d1e", [:make, :mix], [{:cc_precompiler, "~> 0.1", [hex: :cc_precompiler, repo: "hexpm", optional: false]}, {:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:elixir_make, "~> 0.7", [hex: :elixir_make, repo: "hexpm", optional: false]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "719fa7986fed242839629a907d60f774000c1d2dc03ba6ba05fcd30579f2ab45"},
1516
"hackney": {:hex, :hackney, "1.17.0", "717ea195fd2f898d9fe9f1ce0afcc2621a41ecfe137fae57e7fe6e9484b9aa99", [:rebar3], [{:certifi, "~>2.5", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~>6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~>1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~>1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "~>3.3", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~>1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "64c22225f1ea8855f584720c0e5b3cd14095703af1c9fbc845ba042811dc671c"},
1617
"httpoison": {:hex, :httpoison, "1.8.0", "6b85dea15820b7804ef607ff78406ab449dd78bed923a49c7160e1886e987a3d", [:mix], [{:hackney, "~> 1.17", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm", "28089eaa98cf90c66265b6b5ad87c59a3729bea2e74e9d08f9b51eb9729b3c3a"},
1718
"idna": {:hex, :idna, "6.1.1", "8a63070e9f7d0c62eb9d9fcb360a7de382448200fbbd1b106cc96d3d8099df8d", [:rebar3], [{:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "92376eb7894412ed19ac475e4a86f7b413c1b9fbb5bd16dccd57934157944cea"},
@@ -30,7 +31,7 @@
3031
"postgrex": {:hex, :postgrex, "0.17.4", "5777781f80f53b7c431a001c8dad83ee167bcebcf3a793e3906efff680ab62b3", [:mix], [{:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "6458f7d5b70652bc81c3ea759f91736c16a31be000f306d3c64bcdfe9a18b3cc"},
3132
"ranch": {:hex, :ranch, "1.7.1", "6b1fab51b49196860b733a49c07604465a47bdb78aa10c1c16a3d199f7f8c881", [:rebar3], [], "hexpm", "451d8527787df716d99dc36162fca05934915db0b6141bbdac2ea8d3c7afc7d7"},
3233
"redix": {:hex, :redix, "1.0.0", "4f310341744ffceab3031394450a4e603d4d1001a697c3f18ae57ae776cbd3fb", [:mix], [{:castore, "~> 0.1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "8c8d9b33b5491737adcd5bb9e0f43b85212a384ac0042f64c156113518266ecb"},
33-
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.6", "cf344f5692c82d2cd7554f5ec8fd961548d4fd09e7d22f5b62482e5aeaebd4b0", [:make, :mix, :rebar3], [], "hexpm", "bdb0d2471f453c88ff3908e7686f86f9be327d065cc1ec16fa4540197ea04680"},
34+
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.7", "354c321cf377240c7b8716899e182ce4890c5938111a1296add3ec74cf1715df", [:make, :mix, :rebar3], [], "hexpm", "fe4c190e8f37401d30167c8c405eda19469f34577987c76dde613e838bbc67f8"},
3435
"telemetry": {:hex, :telemetry, "0.4.3", "a06428a514bdbc63293cd9a6263aad00ddeb66f608163bdec7c8995784080818", [:rebar3], [], "hexpm", "eb72b8365ffda5bed68a620d1da88525e326cb82a75ee61354fc24b844768041"},
3536
"unicode_util_compat": {:hex, :unicode_util_compat, "0.7.0", "bc84380c9ab48177092f43ac89e4dfa2c6d62b40b8bd132b1059ecc7232f9a78", [:rebar3], [], "hexpm", "25eee6d67df61960cf6a794239566599b09e17e668d3700247bc498638152521"},
3637
}

lib/new_relic/conditional_compile.ex

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
defmodule NewRelic.ConditionalCompile do
2+
@moduledoc false
3+
4+
defmacro before_elixir_version(version, code) do
5+
if Version.compare(System.version(), version) == :lt do
6+
quote do
7+
unquote(code)
8+
end
9+
end
10+
end
11+
12+
defmacro after_elixir_version(version, code) do
13+
if Version.compare(System.version(), version) != :lt do
14+
quote do
15+
unquote(code)
16+
end
17+
end
18+
end
19+
end

lib/new_relic/error/logger_handler.ex

+16-13
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,33 @@
11
defmodule NewRelic.Error.LoggerHandler do
22
@moduledoc false
33

4-
# http://erlang.org/doc/man/logger.html
5-
64
def add_handler() do
7-
:logger.remove_handler(:new_relic)
8-
:logger.add_handler(:new_relic, NewRelic.Error.LoggerHandler, %{})
5+
Logger.add_translator({__MODULE__, :translator})
96
end
107

118
def remove_handler() do
12-
:logger.remove_handler(:new_relic)
9+
Logger.remove_translator({__MODULE__, :translator})
1310
end
1411

15-
def log(
16-
%{
17-
meta: %{error_logger: %{tag: :error_report, type: :crash_report}},
18-
msg: {:report, %{report: [report | _]}}
19-
},
20-
_config
21-
) do
12+
def translator(_level, _message, _timestamp, {_, [report | _]}) when is_list(report) do
2213
if NewRelic.Transaction.Sidecar.tracking?() do
2314
NewRelic.Error.Reporter.report_error(:transaction, report)
2415
else
2516
NewRelic.Error.Reporter.report_error(:process, report)
2617
end
18+
19+
:none
20+
end
21+
22+
def translator(_level, :error, _timestamp, {_, %{args: _, function: _}} = metadata) do
23+
if NewRelic.Transaction.Sidecar.tracking?() do
24+
NewRelic.Error.MetadataReporter.report_error(:transaction, metadata)
25+
else
26+
NewRelic.Error.MetadataReporter.report_error(:process, metadata)
27+
end
28+
29+
:none
2730
end
2831

29-
def log(_log, _config), do: :ignore
32+
def translator(_level, _message, _timestamp, _metadata), do: :none
3033
end
+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
defmodule NewRelic.Error.MetadataReporter do
2+
@moduledoc false
3+
4+
alias NewRelic.Util
5+
alias NewRelic.Harvest.Collector
6+
7+
import NewRelic.ConditionalCompile
8+
9+
# Before elixir 1.15, ignore terminating errors so they don't get reported twice
10+
before_elixir_version("1.15.0", def(report_error(_, {{_, :terminating}, _}), do: nil))
11+
12+
def report_error(:transaction, {_cause, metadata}) do
13+
kind = :error
14+
{_exception_type, reason, stacktrace, _expected} = parse_reason(metadata.reason)
15+
process_name = parse_process_name(metadata[:registered_name], stacktrace)
16+
17+
NewRelic.add_attributes(process: process_name)
18+
19+
NewRelic.Transaction.Reporter.error(%{
20+
kind: kind,
21+
reason: reason,
22+
stack: stacktrace
23+
})
24+
end
25+
26+
def report_error(:process, {_cause, metadata}) do
27+
{exception_type, reason, stacktrace, expected} = parse_reason(metadata.reason)
28+
29+
process_name = parse_process_name(metadata[:registered_name], stacktrace)
30+
automatic_attributes = NewRelic.Config.automatic_attributes()
31+
formatted_stacktrace = Util.Error.format_stacktrace(stacktrace, nil)
32+
33+
Collector.ErrorTrace.Harvester.report_error(%NewRelic.Error.Trace{
34+
timestamp: System.system_time(:millisecond) / 1_000,
35+
error_type: exception_type,
36+
message: reason,
37+
expected: expected,
38+
stack_trace: formatted_stacktrace,
39+
transaction_name: "OtherTransaction/Elixir/ElixirProcess//#{process_name}",
40+
user_attributes:
41+
Map.merge(automatic_attributes, %{
42+
process: process_name
43+
})
44+
})
45+
46+
Collector.TransactionErrorEvent.Harvester.report_error(%NewRelic.Error.Event{
47+
timestamp: System.system_time(:millisecond) / 1_000,
48+
error_class: exception_type,
49+
error_message: reason,
50+
expected: expected,
51+
transaction_name: "OtherTransaction/Elixir/ElixirProcess//#{process_name}",
52+
user_attributes:
53+
Map.merge(automatic_attributes, %{
54+
process: process_name,
55+
stacktrace: Enum.join(formatted_stacktrace, "\n")
56+
})
57+
})
58+
59+
unless expected do
60+
NewRelic.report_metric({:supportability, :error_event}, error_count: 1)
61+
NewRelic.report_metric(:error, error_count: 1)
62+
end
63+
end
64+
65+
defp parse_reason({exception, stacktrace}) do
66+
type = parse_type(exception)
67+
expected = parse_error_expected(exception)
68+
message = Map.get(exception, :message)
69+
reason = "(#{type}) #{message}"
70+
71+
{type, reason, stacktrace, expected}
72+
end
73+
74+
defp parse_type(%type{}) do
75+
type
76+
|> Module.split()
77+
|> Enum.join(".")
78+
end
79+
80+
defp parse_process_name([], [{module, _f, _a, _} | _]), do: inspect(module)
81+
defp parse_process_name([], _stacktrace), do: "UnknownProcess"
82+
defp parse_process_name(registered_name, _stacktrace), do: inspect(registered_name)
83+
84+
defp parse_error_expected(%{expected: true}), do: true
85+
defp parse_error_expected(_), do: false
86+
end

lib/new_relic/harvest/harvest_cycle.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ defmodule NewRelic.Harvest.HarvestCycle do
5252

5353
receive do
5454
{:DOWN, _ref, _, ^harvester, _reason} ->
55-
NewRelic.log(:warn, "Completed shutdown #{inspect(harvest_cycle)}")
55+
NewRelic.log(:warning, "Completed shutdown #{inspect(harvest_cycle)}")
5656
end
5757
end
5858
end

lib/new_relic/logger.ex

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ defmodule NewRelic.Logger do
2323

2424
# API
2525

26-
@levels [:debug, :info, :warn, :error]
26+
@levels [:debug, :info, :warning, :error]
2727
def log(level, message) when level in @levels do
2828
GenServer.cast(__MODULE__, {:log, level, message})
2929
end
@@ -83,7 +83,7 @@ defmodule NewRelic.Logger do
8383
def formatted(level, message), do: [formatted(level), @sep, timestamp(), @sep, message, "\n"]
8484
def formatted(:debug), do: "[DEBUG]"
8585
def formatted(:info), do: "[INFO]"
86-
def formatted(:warn), do: "[WARN]"
86+
def formatted(:warning), do: "[WARN]"
8787
def formatted(:error), do: "[ERROR]"
8888

8989
def timestamp do

lib/new_relic/tracer/macro.ex

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ defmodule NewRelic.Tracer.Macro do
4848
|> Enum.map(&"`#{&1}`")
4949
|> Enum.join(", ")
5050

51-
Logger.warn(
51+
Logger.warning(
5252
"[New Relic] Unable to trace `#{inspect(module)}.#{name}/#{length(args)}` " <>
5353
"due to additional function-level clauses: #{found} -- please remove @trace"
5454
)
@@ -81,7 +81,7 @@ defmodule NewRelic.Tracer.Macro do
8181
end
8282

8383
def trace_deprecated?({_, category: :datastore}, module, name) do
84-
Logger.warn(
84+
Logger.warning(
8585
"[New Relic] Trace `:datastore` deprecated in favor of automatic ecto instrumentation. " <>
8686
"Please remove @trace from #{inspect(module)}.#{name}"
8787
)

0 commit comments

Comments
 (0)