Skip to content
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

derive jason encoder for request #3182

Merged
merged 3 commits into from
Jul 24, 2023

Conversation

ruslandoga
Copy link
Contributor

@ruslandoga ruslandoga commented Jul 24, 2023

Changes

Continuing from #3180

Tests

  • Automated tests have been added

Changelog

  • Entry has been added to changelog

Documentation

  • This change does not need a documentation update

Dark mode

  • This PR does not change the UI

@bundlemon
Copy link

bundlemon bot commented Jul 24, 2023

BundleMon

Unchanged files (7)
Status Path Size Limits
static/css/app.css
492.34KB -
static/js/dashboard.js
319KB -
static/js/app.js
40.11KB -
static/js/embed.host.js
5.58KB -
static/js/embed.content.js
5.08KB -
tracker/js/plausible.js
742B -
static/js/applyTheme.js
314B -

No change in files bundle size

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

@@ -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
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll need to try that out...

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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:

Screenshot 2023-07-24 at 18 38 51

@@ -27,6 +27,7 @@ defmodule Plausible.Ingestion.Request do

@max_url_size 2_000

@primary_key false
Copy link
Contributor Author

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.

@ruslandoga ruslandoga requested a review from aerosol July 24, 2023 11:33
@ruslandoga ruslandoga marked this pull request as ready for review July 24, 2023 11:33
test "enforces fingerprint for ingestion request" do
event =
Sentry.Event.create_event(
message: "oof",
Copy link
Member

Choose a reason for hiding this comment

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

beautiful :)

Copy link
Member

@aerosol aerosol left a comment

Choose a reason for hiding this comment

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

excellent ♥️

@aerosol aerosol merged commit f3a1a9d into plausible:master Jul 24, 2023
2 of 5 checks passed
@aerosol
Copy link
Member

aerosol commented Jul 24, 2023

Great work!

@ruslandoga ruslandoga deleted the request-jason-encoder branch July 24, 2023 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants