@sentry/apm
Advanced tools
Comparing version 5.12.3 to 5.12.4
@@ -101,2 +101,3 @@ import { EventProcessor, Hub, Integration, Span, SpanContext, SpanStatus } from '@sentry/types'; | ||
private static _debounce; | ||
private readonly _emitOptionsWarning; | ||
/** | ||
@@ -103,0 +104,0 @@ * Constructor for Tracing |
@@ -5,2 +5,3 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
var global = utils_1.getGlobalObject(); | ||
var defaultTracingOrigins = ['localhost', /^\//]; | ||
/** | ||
@@ -21,3 +22,3 @@ * Tracing Integration | ||
this.name = Tracing.id; | ||
var defaultTracingOrigins = ['localhost', /^\//]; | ||
this._emitOptionsWarning = false; | ||
var defaults = { | ||
@@ -37,5 +38,5 @@ idleTimeout: 500, | ||
}; | ||
// NOTE: Logger doesn't work in contructors, as it's initialized after integrations instances | ||
if (!_options || !Array.isArray(_options.tracingOrigins) || _options.tracingOrigins.length === 0) { | ||
utils_1.logger.warn('Sentry: You need to define `tracingOrigins` in the options. Set an array of urls or patterns to trace.'); | ||
utils_1.logger.warn("Sentry: We added a reasonable default for you: " + defaultTracingOrigins); | ||
this._emitOptionsWarning = true; | ||
} | ||
@@ -49,2 +50,6 @@ Tracing.options = this._options = tslib_1.__assign({}, defaults, _options); | ||
Tracing._getCurrentHub = getCurrentHub; | ||
if (this._emitOptionsWarning) { | ||
utils_1.logger.warn('Sentry: You need to define `tracingOrigins` in the options. Set an array of urls or patterns to trace.'); | ||
utils_1.logger.warn("Sentry: We added a reasonable default for you: " + defaultTracingOrigins); | ||
} | ||
if (!Tracing._isEnabled()) { | ||
@@ -87,10 +92,10 @@ return; | ||
} | ||
if (Tracing.options.maxTransactionDuration !== 0 && | ||
Tracing._isEnabled() && | ||
event.type === 'transaction' && | ||
event.timestamp && | ||
event.start_timestamp && | ||
(event.timestamp - event.start_timestamp > Tracing.options.maxTransactionDuration || | ||
event.timestamp - event.start_timestamp < 0)) { | ||
return null; | ||
if (Tracing._isEnabled()) { | ||
var isOutdatedTransaction = event.timestamp && | ||
event.start_timestamp && | ||
(event.timestamp - event.start_timestamp > Tracing.options.maxTransactionDuration || | ||
event.timestamp - event.start_timestamp < 0); | ||
if (Tracing.options.maxTransactionDuration !== 0 && event.type === 'transaction' && isOutdatedTransaction) { | ||
return null; | ||
} | ||
} | ||
@@ -97,0 +102,0 @@ return event; |
@@ -173,3 +173,6 @@ // tslint:disable:max-classes-per-file | ||
this.setTag('http.status_code', String(httpStatus)); | ||
this.setStatus(types_1.SpanStatus.fromHttpCode(httpStatus)); | ||
var spanStatus = types_1.SpanStatus.fromHttpCode(httpStatus); | ||
if (spanStatus !== types_1.SpanStatus.UnknownError) { | ||
this.setStatus(spanStatus); | ||
} | ||
return this; | ||
@@ -241,5 +244,3 @@ }; | ||
Span.prototype.getTraceContext = function () { | ||
// JSON.parse + JSON.stringify to remove undefined values | ||
// tslint:disable-next-line: no-unsafe-any | ||
return JSON.parse(JSON.stringify({ | ||
return utils_1.dropUndefinedKeys({ | ||
data: this.data, | ||
@@ -250,7 +251,6 @@ description: this.description, | ||
span_id: this._spanId, | ||
// Undefined status will be dropped by `JSON.stringify` anyway so it's safe to read it directly like that | ||
status: this.tags.status, | ||
tags: this.tags, | ||
trace_id: this._traceId, | ||
})); | ||
}); | ||
}; | ||
@@ -261,5 +261,3 @@ /** | ||
Span.prototype.toJSON = function () { | ||
// JSON.parse + JSON.stringify to remove undefined values | ||
// tslint:disable-next-line: no-unsafe-any | ||
return JSON.parse(JSON.stringify({ | ||
return utils_1.dropUndefinedKeys({ | ||
data: this.data, | ||
@@ -276,3 +274,3 @@ description: this.description, | ||
transaction: this.transaction, | ||
})); | ||
}); | ||
}; | ||
@@ -279,0 +277,0 @@ return Span; |
@@ -101,2 +101,3 @@ import { EventProcessor, Hub, Integration, Span, SpanContext, SpanStatus } from '@sentry/types'; | ||
private static _debounce; | ||
private readonly _emitOptionsWarning; | ||
/** | ||
@@ -103,0 +104,0 @@ * Constructor for Tracing |
import * as tslib_1 from "tslib"; | ||
import { addInstrumentationHandler, getGlobalObject, isMatchingPattern, logger, supportsNativeFetch, } from '@sentry/utils'; | ||
var global = getGlobalObject(); | ||
var defaultTracingOrigins = ['localhost', /^\//]; | ||
/** | ||
@@ -19,3 +20,3 @@ * Tracing Integration | ||
this.name = Tracing.id; | ||
var defaultTracingOrigins = ['localhost', /^\//]; | ||
this._emitOptionsWarning = false; | ||
var defaults = { | ||
@@ -35,5 +36,5 @@ idleTimeout: 500, | ||
}; | ||
// NOTE: Logger doesn't work in contructors, as it's initialized after integrations instances | ||
if (!_options || !Array.isArray(_options.tracingOrigins) || _options.tracingOrigins.length === 0) { | ||
logger.warn('Sentry: You need to define `tracingOrigins` in the options. Set an array of urls or patterns to trace.'); | ||
logger.warn("Sentry: We added a reasonable default for you: " + defaultTracingOrigins); | ||
this._emitOptionsWarning = true; | ||
} | ||
@@ -47,2 +48,6 @@ Tracing.options = this._options = tslib_1.__assign({}, defaults, _options); | ||
Tracing._getCurrentHub = getCurrentHub; | ||
if (this._emitOptionsWarning) { | ||
logger.warn('Sentry: You need to define `tracingOrigins` in the options. Set an array of urls or patterns to trace.'); | ||
logger.warn("Sentry: We added a reasonable default for you: " + defaultTracingOrigins); | ||
} | ||
if (!Tracing._isEnabled()) { | ||
@@ -85,10 +90,10 @@ return; | ||
} | ||
if (Tracing.options.maxTransactionDuration !== 0 && | ||
Tracing._isEnabled() && | ||
event.type === 'transaction' && | ||
event.timestamp && | ||
event.start_timestamp && | ||
(event.timestamp - event.start_timestamp > Tracing.options.maxTransactionDuration || | ||
event.timestamp - event.start_timestamp < 0)) { | ||
return null; | ||
if (Tracing._isEnabled()) { | ||
var isOutdatedTransaction = event.timestamp && | ||
event.start_timestamp && | ||
(event.timestamp - event.start_timestamp > Tracing.options.maxTransactionDuration || | ||
event.timestamp - event.start_timestamp < 0); | ||
if (Tracing.options.maxTransactionDuration !== 0 && event.type === 'transaction' && isOutdatedTransaction) { | ||
return null; | ||
} | ||
} | ||
@@ -95,0 +100,0 @@ return event; |
@@ -5,3 +5,3 @@ // tslint:disable:max-classes-per-file | ||
import { SpanStatus } from '@sentry/types'; | ||
import { isInstanceOf, logger, timestampWithMs, uuid4 } from '@sentry/utils'; | ||
import { dropUndefinedKeys, isInstanceOf, logger, timestampWithMs, uuid4 } from '@sentry/utils'; | ||
// TODO: Should this be exported? | ||
@@ -173,3 +173,6 @@ export var TRACEPARENT_REGEXP = new RegExp('^[ \\t]*' + // whitespace | ||
this.setTag('http.status_code', String(httpStatus)); | ||
this.setStatus(SpanStatus.fromHttpCode(httpStatus)); | ||
var spanStatus = SpanStatus.fromHttpCode(httpStatus); | ||
if (spanStatus !== SpanStatus.UnknownError) { | ||
this.setStatus(spanStatus); | ||
} | ||
return this; | ||
@@ -241,5 +244,3 @@ }; | ||
Span.prototype.getTraceContext = function () { | ||
// JSON.parse + JSON.stringify to remove undefined values | ||
// tslint:disable-next-line: no-unsafe-any | ||
return JSON.parse(JSON.stringify({ | ||
return dropUndefinedKeys({ | ||
data: this.data, | ||
@@ -250,7 +251,6 @@ description: this.description, | ||
span_id: this._spanId, | ||
// Undefined status will be dropped by `JSON.stringify` anyway so it's safe to read it directly like that | ||
status: this.tags.status, | ||
tags: this.tags, | ||
trace_id: this._traceId, | ||
})); | ||
}); | ||
}; | ||
@@ -261,5 +261,3 @@ /** | ||
Span.prototype.toJSON = function () { | ||
// JSON.parse + JSON.stringify to remove undefined values | ||
// tslint:disable-next-line: no-unsafe-any | ||
return JSON.parse(JSON.stringify({ | ||
return dropUndefinedKeys({ | ||
data: this.data, | ||
@@ -276,3 +274,3 @@ description: this.description, | ||
transaction: this.transaction, | ||
})); | ||
}); | ||
}; | ||
@@ -279,0 +277,0 @@ return Span; |
{ | ||
"name": "@sentry/apm", | ||
"version": "5.12.3", | ||
"version": "5.12.4", | ||
"description": "Extensions for APM", | ||
@@ -19,7 +19,7 @@ "repository": "git://github.com/getsentry/sentry-javascript.git", | ||
"dependencies": { | ||
"@sentry/browser": "5.12.1", | ||
"@sentry/hub": "5.12.0", | ||
"@sentry/minimal": "5.12.0", | ||
"@sentry/types": "5.12.0", | ||
"@sentry/utils": "5.12.0", | ||
"@sentry/browser": "5.12.4", | ||
"@sentry/hub": "5.12.4", | ||
"@sentry/minimal": "5.12.4", | ||
"@sentry/types": "5.12.4", | ||
"@sentry/utils": "5.12.4", | ||
"tslib": "^1.9.3" | ||
@@ -26,0 +26,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
207580
2428
+ Added@sentry/browser@5.12.4(transitive)
+ Added@sentry/core@5.12.4(transitive)
+ Added@sentry/hub@5.12.4(transitive)
+ Added@sentry/minimal@5.12.4(transitive)
+ Added@sentry/types@5.12.4(transitive)
+ Added@sentry/utils@5.12.4(transitive)
- Removed@sentry/browser@5.12.1(transitive)
- Removed@sentry/core@5.12.0(transitive)
- Removed@sentry/hub@5.12.0(transitive)
- Removed@sentry/minimal@5.12.0(transitive)
- Removed@sentry/types@5.12.0(transitive)
- Removed@sentry/utils@5.12.0(transitive)
Updated@sentry/browser@5.12.4
Updated@sentry/hub@5.12.4
Updated@sentry/minimal@5.12.4
Updated@sentry/types@5.12.4
Updated@sentry/utils@5.12.4