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

Feature: Add INP Support #135

Closed
amenk opened this issue Apr 15, 2024 · 3 comments
Closed

Feature: Add INP Support #135

amenk opened this issue Apr 15, 2024 · 3 comments

Comments

@amenk
Copy link
Contributor

amenk commented Apr 15, 2024

Feature: What is your use case for such a feature?

Tracking INP, see https://sentry.io/changelog/sentry-officially-supports-inp/

Feature: What is your proposed configuration entry? The new option to add? What is the behavior?

Not sure if we should add an option or enable it by default if the tracing is enabled?

What is the version of Magento and of Sentry extension you are using? Always use the latest version of the extension one before opening a bug issue.

Extension: 3.6.0
Magento: 2.4.6-p3

Draft patch

diff --git a/Block/SentryScript.php b/Block/SentryScript.php
index c35b1ef..b4ec084 100644
--- a/Block/SentryScript.php
+++ b/Block/SentryScript.php
@@ -9,7 +9,7 @@ use Magento\Framework\View\Element\Template;
 
 class SentryScript extends Template
 {
-    const CURRENT_VERSION = '7.39.0';
+    const CURRENT_VERSION = '7.110.0';
 
     /**
      * SentryScript constructor.
diff --git a/view/frontend/templates/script/sentry.phtml b/view/frontend/templates/script/sentry.phtml
index c1a7c75..c152fa0 100644
--- a/view/frontend/templates/script/sentry.phtml
+++ b/view/frontend/templates/script/sentry.phtml
@@ -35,13 +35,15 @@ if (typeof Sentry !== 'undefined') {
         environment: '<?= $block->escapeHtml(trim($block->getEnvironment())) ?>',
         integrations: [
             <?php if ($block->isTracingEnabled()): ?>
-                new Sentry.BrowserTracing(),
+                Sentry.browserTracingIntegration({
+                    enableInp: true,
+                })),
             <?php endif ?>
             <?php if ($block->useSessionReplay()): ?>
             new Sentry.Replay({
                 blockAllMedia: <?= $block->escapeHtml($block->getReplayBlockMedia() ? 'true' : 'false') ?>,
                 maskAllText: <?= $block->escapeHtml($block->getReplayMaskText() ? 'true' : 'false') ?>,
-            })
+            }),
             <?php endif ?>
         ],
         <?php if ($block->isTracingEnabled()): ?>

Shall I make a PR as is or make it configurable?

@amenk
Copy link
Contributor Author

amenk commented Jun 4, 2024

I guess it's best to make the Inp-Part configurable...

amenk added a commit to iMi-digital/magento2-sentry that referenced this issue Jun 4, 2024
@amenk
Copy link
Contributor Author

amenk commented Jun 11, 2024

@indykoning I would close this issue as #137 was merged - but I was wondering, if you plan to tag a release? or will new things stay a bit in the main branch before tagging a release?

@indykoning
Copy link
Member

It has been released in version 3.7.0 🚀

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

No branches or pull requests

2 participants