-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
derive jason encoder for request #3182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,10 @@ defmodule Plausible.SentryFilter do | |
%{event | fingerprint: ["db_connection", reason]} | ||
end | ||
|
||
def before_send(%{extra: %{request: %Plausible.Ingestion.Request{}}} = event) do | ||
%{event | fingerprint: ["ingestion_request"]} | ||
end | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll need to try that out... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sentry.capture_message("oof", extra: %{request: %Plausible.Ingestion.Request{}}) https://eh-uo.sentry.io/share/issue/1cb9ceadb737491f8f230c1ec391e0bf/ 🥲 "shared" issue doesn't include fingerprint info... Here's what I'm seeing on my dashboard: ![]() |
||
|
||
def before_send(event) do | ||
event | ||
end | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
defmodule Plausible.SentryFilterTest do | ||
use ExUnit.Case | ||
|
||
test "enforces fingerprint for ingestion request" do | ||
event = | ||
Sentry.Event.create_event( | ||
message: "oof", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. beautiful :) |
||
fingerprint: ["to be", " replaced"], | ||
extra: %{request: %Plausible.Ingestion.Request{}} | ||
) | ||
|
||
assert %Sentry.Event{fingerprint: ["ingestion_request"]} = | ||
Plausible.SentryFilter.before_send(event) | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise
{"id": null}
is added to all requests during encoding.