Skip to content

derive jason encoder for request - #3182

Merged
aerosol merged 3 commits into
plausible:masterfrom
ruslandoga:request-jason-encoder
Jul 24, 2023
Merged

aerosol merged 3 commits into
plausible:masterfrom
ruslandoga:request-jason-encoder

Conversation

@ruslandoga

@ruslandoga ruslandoga commented Jul 24, 2023 •

Copy link
Copy Markdown
Contributor

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

bundlemon Bot commented Jul 24, 2023 •

Copy link
Copy Markdown

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

Comment thread lib/sentry_filter.ex

def before_send(%{extra: %{request: %Plausible.Ingestion.Request{}}} = event) do
%{event | fingerprint: ["ingestion_request"]}
end

Copy link
Copy Markdown
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...

@ruslandoga ruslandoga Jul 24, 2023 •

Copy link
Copy Markdown
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

@ruslandoga ruslandoga mentioned this pull request Jul 24, 2023
@ruslandoga
ruslandoga force-pushed the request-jason-encoder branch from a595f74 to c185887 Compare July 24, 2023 11:19

@max_url_size 2_000

@primary_key false

Copy link
Copy Markdown
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 force-pushed the request-jason-encoder branch from c185887 to 0e99d0d Compare July 24, 2023 11:31
@ruslandoga
ruslandoga force-pushed the request-jason-encoder branch from 0e99d0d to f05ba78 Compare July 24, 2023 11:33
@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
Copy Markdown
Member

Choose a reason for hiding this comment

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

beautiful :)

@aerosol aerosol left a comment

Copy link
Copy Markdown
Member

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
@aerosol

aerosol commented Jul 24, 2023

Copy link
Copy Markdown
Member

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.

2 participants