-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[Question/Bug] Can't report Transactions on multiple instances with different DSNs #4185
Comments
Could you turn on
|
@AbhiPrasad - Without setting
Added it, I don't see any logs what so ever..
|
@AbhiPrasad - ? |
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 label it "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
@AbhiPrasad - do you have any insights? |
+1 on this issue. |
Hey sorry for the delay on this, we've been busy working on the new major version so this fell out of sight. It's important to note that in order to get tracing working, you'll have to import // If you're using one of our integration packages, like `@sentry/angular`,
// substitute its name for `@sentry/browser` here
import * as Sentry from "@sentry/browser";
// If taking advantage of automatic instrumentation (highly recommended)
import { BrowserTracing } from "@sentry/tracing";
// Or, if only manually tracing
// import * as _ from "@sentry/tracing"
// Note: You MUST import the package in some way for tracing to work At the current moment, All of this will be addressed as part of the upcoming major bump #4240 (along with some bundle size savings!), but it's important to note that this is all about implicit behaviour from automatic instrumentation. Manual instrumentation should work fine though. If you import the side effect: const hub1 = new Sentry.Hub(...);
const hub2 = new Sentry.Hub(...);
// do whatever you want with the transaction, record any child spans you want
const transactionFromHub1 = hub1.startTransaction(...);
// have multiple transactions going on
const transactionFromHub2 = hub2.startTransaction(...);
// can be sent to a different dsn
transactionFromHub2.finish();
// can be sent to a different dsn
transactionFromHub1.finish(); |
Hey @AbhiPrasad, thx for the reply it's better late than never :) Can it be because I have a ** Edit ** |
The solution you offered is not complete, if I remove What works for me is if I use Look at the code below please
This component throws an error for transaction is undefined (finish of undefined)
This component doesn't reports transactions for the a Sentry Hub:
|
https://codesandbox.io/s/hub-tracing-test-j90xw?file=/src/index.js I made a quick codesandbox with the example you put - I was able to use Perhaps you need to change your tracing import to |
|
Maybe you should try Sentry.BrowserClient + Sentry.Hub +Sentry.makeMain(hub), |
Package + Version
@sentry/browser
@sentry/node
raven-js
raven-node
(raven for node)@sentry/react
Version:
Description
My client consists of a platform with a global Sentry (using
Sentry.init
) and micro services that each has its own Sentry Hub with a different DSN (usingnew Sentry.Hub
).When I try and use transactions, I see that only the global Sentry can send transactions, and all of my micro services transactions reporting are "failing silently" (I don't see any request on the Network Tab).
I also tried to reproduce it on the same app and I encountered the issue.
Is it by design? Can I make it work somehow?
This component reports transactions for the global/main Sentry:
This component doesn't reports transactions for the a Sentry Hub:
P.S
I can report exceptions via the Hub (i.e using
newHub.captureException(...)
is being reported successfully).P.S 2 🎮 😉
I don't think a solution involving
makeMain
each time I want to report a transaction is valid, because I have many micro services that can report at the same time...The text was updated successfully, but these errors were encountered: