Skip to content

Conversation

@tombruijn
Copy link
Member

@tombruijn tombruijn commented Jul 21, 2025

In Phoenix 1.8 the parameter filtering now uses compiled patterns. Update our implementation with the new Phoenix implementation so we can support both Phoenix 1.8 and newer, and older versions. We do this by checking if the value in
Application.get_env(:phoenix, :filter_parameters, []) is a compiled pattern.

Relevant commit in Phoenix: phoenixframework/phoenix@359539f

Fixes #1008

In Phoenix 1.18 the parameter filtering now uses compiled patterns.
Update our implementation with the new Phoenix implementation so we can
support both Phoenix 1.18 and newer, and older versions.
We do this by checking if the value in
`Application.get_env(:phoenix, :filter_parameters, [])` is a compiled
pattern.

Relevant commit in Phoenix: phoenixframework/phoenix@359539f
@tombruijn tombruijn added the bug Confirmed and unconfirmed bugs reported by us and customers. label Jul 21, 2025
@tombruijn tombruijn self-assigned this Jul 21, 2025
@tombruijn tombruijn requested a review from unflxw July 21, 2025 11:42
@tombruijn tombruijn marked this pull request as ready for review July 21, 2025 11:42
@tombruijn tombruijn changed the title Add support for Phoenix 1.18's parameter filtering Add support for Phoenix 1.8's parameter filtering Jul 21, 2025
Comment on lines +38 to +42
is_binary(k) and String.contains?(k, key_match) ->
{k, "[FILTERED]"}

is_binary(v) and String.contains?(v, value_match) ->
{k, "[FILTERED]"}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Took me a second to square how we use it (with String.contains?/2) with the reported shape of the error in the original issue. Turns out this is the :binary.cp() data type from Erlang, representing a pattern to match against. TIL!

@tombruijn tombruijn merged commit 1449b9e into main Jul 22, 2025
20 checks passed
Vitaly-A-Ivanov pushed a commit to spacebetween/appsignal-elixir that referenced this pull request Sep 3, 2025
In Phoenix 1.8 the parameter filtering now uses compiled patterns.
Update our implementation with the new Phoenix implementation so we can
support both Phoenix 1.8 and newer, and older versions.
We do this by checking if the value in
`Application.get_env(:phoenix, :filter_parameters, [])` is a compiled
pattern.

Relevant commit in Phoenix: phoenixframework/phoenix@359539f

(cherry picked from commit 1449b9e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Confirmed and unconfirmed bugs reported by us and customers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handler has failed and has been detached

2 participants