sentry-javascript
sentry-javascript copied to clipboard
Using sentry hub doesn't send release health and performance metrics
Environment
SaaS (https://sentry.io/)
Version
- @sentry/browser => 6.3.5
- @sentry/react => 6.15.0
Steps to Reproduce
Description
We are using Sentry Hub because we have more than one project on each page with each using a different Sentry project. The errors for each project are reported properly but some metrics are missing
Steps
- Create a react sentry project
- Use the Sentry hub + Browser client to initialize Sentry and capture errors instead of using
Sentry.initie.
import {
BrowserClient,
Hub,
reactRouterV5Instrumentation,
defaultIntegrations,
} from '@sentry/react';
import { Integrations } from '@sentry/tracing';
const client = new BrowserClient({
dsn: sentryDSN,
release: appName,
environment: ENV,
integrations: [
...defaultIntegrations,
new Integrations.BrowserTracing({
routingInstrumentation: reactRouterV5Instrumentation(
appBrowserHistory
),
}),
],
tracesSampleRate: 0.2,
});
const SentryHub = new Hub(client);
- Use hub to send errors
SentryHub.captureException(error)
Expected Result
- Should send the errors to the specified project => this works
- Should report deploys if tracking deploys is setup => this works
- Should send
Crash Free Sessions,ApdexandReleasesinformation => Not sent - Should send performance metrics => Not sent
Actual Result
- Performance metrics not sent
- Release Health metrics not sent
Routing to @getsentry/team-web-frontend for triage. ⏲️
Transferring this to the JS SDK repo. This is a known issue, backlogging.
Hi, the same problem, I want to know when can it be fixed? Now I can't get Web Vitals using sentry hub, it can be achieved using sentry init. Thanks for open source, looking forward to your reply!
@AbhiPrasad Do you have an idea of when this will be worked on? Would like to inform my team about this
@AbhiPrasad Any update on this?
@dennisja, there have been lots of changes since this error was initially published. I would recommend you try upgrading to the newest version (atm, it is 7.1.1).
We didn't intentionally try to solve this problem, but it could have been a nice side effect of various changes we did. Solving this properly is on our long term roadmap to be solved late this year.
Hello @vladanpaunovic Thanks for the reply. I updated one of the apps to the latest version (7.1.1) and haven't noticed any changes in either release health or performance metrics.
Are there any expected changes to any of the metrics after the upgrade?
Hi! I'm in the same situation as everyone, two clients of Sentry on the same page.
I was able to make release health work (adoption/crash-free rate) on a module-federated component by calling manually on its Sentry initialization:
hub.run((currentHub) => {
currentHub.withScope(() => {
currentHub.startSession();
currentHub.captureSession();
});
});
I've noticed that the autoSessionTracking option that's supposed to be true by default wasn't working; even if I set it true by hand, it won't track sessions, so, calling by hand made it work.
Does anyone know if this approach can cause some side effects? Is it the correct way to do it?
@allyssonsantos The only side-effect is that the current session on the scope will be terminated (if there is one) and replaced with a new one.
It looks like it is not related to multiple hubs or clients but any SDK initialization. I'm using the latest 7.13.0 SDK.
For me, only Release Health is not sent.
For me as well, I don't seem to get any Release Health on my react app although the release and source map are configured.
I also have a react-native app that does have a working Release Health, when I compared the two SDK initialization there was no difference to demonstrate why this happens
@ODVault do you have a release value configured?
This issue has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!
"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀
any update about this issue?
Hi, no update, this remains backlogged and we're still waiting on a responds RE
@ODVault do you have a release value configured?
This issue has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!
"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀