-
-
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
feat: APM updates #2161
feat: APM updates #2161
Conversation
cc @mitsuhiko for last commit |
packages/hub/src/hub.ts
Outdated
const span = top.scope.getSpan(); | ||
|
||
if (span) { | ||
return span.newSpan(spanContext); |
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.
Let's call this childSpan
instead of newSpan
What's the long-term plan around APM in Sentry? Is there overlap with or a plan to integrate with OpenCensus/OpenTelemetry? OpenCensus just released a prototypeJavaScript implementation and I'd love to avoid having to integrate 2-3 different tracing systems. |
@ajacques we're still in early PoC phase so there's not much I can say for certain, but we do have OC/OT in mind while working on it :) |
TODO: |
Hi guys, I found the blog post about Sentry APM. As I understand, Sentry wants to support not only error logging, but also tracing, right? Is there any plan to support "normal" Logging for better analysability of errors or do we still need tools like ELK? |
@@ -93,6 +95,10 @@ export class TransactionActivity implements Integration { | |||
if (TransactionActivity._enabled !== undefined) { | |||
return TransactionActivity._enabled; | |||
} | |||
// This happens only in test cases where the integration isn't initalized properly | |||
if (!TransactionActivity.options || isNaN(TransactionActivity.options.tracesSampleRate)) { |
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.
Remember that isNaN('')
isNaN([])
isNaN(null)
isNaN(true)
isNaN(false)
will also report false
. You can wrap the input in parseInt
to make it better, or use:
typeof TransactionActivity.options.tracesSampleRate !== 'number'
// Reason being at the time we start the inital transaction we do not have a client bound on the hub yet | ||
// therefore configureScope wouldn't be executed and we would miss setting the transaction | ||
// tslint:disable-next-line: no-unsafe-any | ||
(hub as any).getScope().setSpan(span); |
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.
sucky :(
@HazAT @kamilogorek Can the span status also be part of the trace/span context? |
Damn. So fast. |
This PR provides the new
@sentry/apm
package with a newTracing
integration.The
Tracing
integration creates Transactions for pageloads as well as navigation changes. Additionally, it will add thesentry-trace
header so if used together with an apm enabled server SDK of Sentry (Node, Python) you will get the full trace.We also hook into global XHR & fetch calls and create spans out of it that will be attached to the transaction.