Skip to content

Commit af6e80e

Browse files
Remove config checks for params and session data
Since appsignal 2.2.13 (which includes appsignal/appsignal-elixir#771 and appsignal/appsignal-elixir#772), the app's configuration is checked whenever parameters or session data is added to the current span. This patch updates the appsignal version dependency to 2.2.13 or higher, and removes the duplicate checks from Appsignal.Plug.
1 parent 5b6b286 commit af6e80e

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

lib/appsignal_plug.ex

+2-14
Original file line numberDiff line numberDiff line change
@@ -166,33 +166,21 @@ defmodule Appsignal.Plug do
166166
end
167167

168168
defp set_params(span, conn) do
169-
set_params(span, Application.get_env(:appsignal, :config), conn)
170-
end
171-
172-
defp set_params(span, %{send_params: true}, conn) do
173169
%Plug.Conn{params: params} = Plug.Conn.fetch_query_params(conn)
174170
@span.set_sample_data(span, "params", params)
175171
end
176172

177-
defp set_params(span, _config, _conn) do
178-
span
179-
end
180-
181173
defp set_sample_data(span, conn) do
182174
@span.set_sample_data(span, "environment", Appsignal.Metadata.metadata(conn))
183175
end
184176

185-
defp set_session_data(span, conn) do
186-
set_session_data(span, Application.get_env(:appsignal, :config), conn)
187-
end
188-
189-
defp set_session_data(span, %{send_session_data: true}, %Plug.Conn{
177+
defp set_session_data(span, %Plug.Conn{
190178
private: %{plug_session: session, plug_session_fetch: :done}
191179
}) do
192180
@span.set_sample_data(span, "session_data", session)
193181
end
194182

195-
defp set_session_data(span, _config, _conn) do
183+
defp set_session_data(span, _conn) do
196184
span
197185
end
198186
end

mix.exs

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ defmodule Appsignal.Plug.MixProject do
4545

4646
[
4747
{:plug, ">= 1.1.0"},
48-
{:appsignal, ">= 2.2.10 and < 3.0.0"},
48+
{:appsignal, ">= 2.2.13 and < 3.0.0"},
4949
{:credo, "~> 1.2", only: [:dev, :test], runtime: false},
5050
{:dialyxir, "~> 1.0", only: [:dev, :test], runtime: false},
5151
{:ex_doc, "~> 0.21", only: :dev, runtime: false}

0 commit comments

Comments
 (0)