-
Notifications
You must be signed in to change notification settings - Fork 65
Posthog api #578
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
Posthog api #578
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
5 Skipped Deployments
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #578 +/- ##
==========================================
- Coverage 89.38% 89.00% -0.38%
==========================================
Files 150 154 +4
Lines 9933 10245 +312
Branches 1035 1142 +107
==========================================
+ Hits 8879 9119 +240
- Misses 1054 1126 +72 ☔ View full report in Codecov by Sentry. |
📦 Next.js Bundle Analysis for @blobscan/webThis analysis was generated by the Next.js Bundle Analysis action. 🤖
|
Page | Size (compressed) |
---|---|
global |
332.79 KB (🔴 +87.17 KB) |
Details
The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.
Any third party scripts you have added directly to your app using the <script>
tag are not accounted for in this analysis
If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!
New Pages Added
The following pages were added to the bundle from the code in this PR:
Page | Size (compressed) | First Load | % of Budget (350 KB ) |
---|---|---|---|
/block_neighbor |
251 B |
333.04 KB | 95.15% |
/stats |
347.54 KB |
680.33 KB | 194.38% |
Eight Pages Changed Size
The following pages changed size from the code in this PR compared to its base branch:
Page | Size (compressed) | First Load | % of Budget (350 KB ) |
---|---|---|---|
/ |
351.81 KB |
684.6 KB | 195.60% (🟢 -5.01%) |
/address/[address] |
26.94 KB |
359.73 KB | 102.78% (🟢 -4.80%) |
/blob/[hash] |
27.62 KB |
360.41 KB | 102.98% (🟢 -4.24%) |
/blobs |
76.51 KB |
409.3 KB | 116.94% (🟡 +12.49%) |
/block/[id] |
14.3 KB |
347.09 KB | 99.17% (🟢 -4.16%) |
/blocks |
74.21 KB |
407 KB | 116.29% (🟡 +12.47%) |
/tx/[hash] |
16.3 KB |
349.09 KB | 99.74% (🟡 +0.87%) |
/txs |
73.71 KB |
406.5 KB | 116.14% (🟡 +10.47%) |
Details
Only the gzipped size is provided here based on an expert tip.
First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link
is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.
Any third party scripts you have added directly to your app using the <script>
tag are not accounted for in this analysis
The "Budget %" column shows what percentage of your performance budget the First Load total takes up. For example, if your budget was 100kb, and a given page's first load size was 10kb, it would be 10% of your budget. You can also see how much this has increased or decreased compared to the base branch of your PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this. If you see "+/- <0.01%" it means that there was a change in bundle size, but it is a trivial enough amount that it can be ignored.
Co-authored-by: Pablo Castellano <[email protected]>
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.
some last changes and we're ready to merge
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.
LGTM! 👌
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.
Nice job.
We should move the posthog setup from the api
package to the rest-api-server
app instead.
The api
is consumed by both the web and the REST API apps. So we're basically setting up twice for the web
* feat: Add PostHog integration for API request tracking * chore: added changeset * feat: Add posthog to trpc/api * feat: PostHog is now optional * chore: Remove unnecessary include in tsconfig.json * Update .changeset/brave-pants-divide.md Co-authored-by: Pablo Castellano <[email protected]> * chore: Use a random UUID for the PostHog distinctId * feat: Add posthog-js to the frontend * refactor: Update posthog.capture to use getIP function * chore: Rename POSTHOG_KEY to POSTHOG_ID * docs: Added posthog .env docs * refactor: Update PostHog host URL in environment configuration * chore: Remove PostHog changeset * Adds NEXT_PUBLIC_POSTHOG_ID and NEXT_PUBLIC_POSTHOG_HOST to env --------- Co-authored-by: Pablo Castellano <[email protected]>
Checklist
Description
Added PostHog for API request tracking
Related Issue
#571