Log warning when m/meta parameter used in ingestion (#5478)

* Log warning when m/meta parameter used in ingestion

This parameter was added in October 2020 and then renamed 2 days later: 40900c7653 and 0b6e645b44

We are hoping we may be able to remove it which this logging will help with.

* Log only domain
This commit is contained in:
Karl-Aksel Puulmann 2025-06-10 11:01:25 +03:00 committed by GitHub
parent 05e87c258d
commit d4bec6d9e3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 0 deletions

View File

@ -24,6 +24,7 @@ defmodule Plausible.Ingestion.Request do
use Ecto.Schema
use Plausible
require Logger
alias Ecto.Changeset
@max_url_size 2_000
@ -230,6 +231,13 @@ defmodule Plausible.Ingestion.Request do
|> Enum.take(@max_props)
|> Map.new()
# Temporary instrumentation to see if `m`/`meta` field was used.
if request_body["m"] || request_body["meta"] do
Logger.warning(
"Ingestion: request body contains meta field. domain=#{request_body["d"] || request_body["domain"]}"
)
end
changeset
|> Changeset.put_change(:props, props)
|> validate_props()