@sentry/apm
Advanced tools
Comparing version 5.10.0-beta.4 to 5.10.0-rc.0
export { Express } from './express'; | ||
export { Tracing, TracingHandlers } from './tracing'; | ||
export { Tracing } from './tracing'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -6,3 +6,2 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Tracing = tracing_1.Tracing; | ||
exports.TracingHandlers = tracing_1.TracingHandlers; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
import { EventProcessor, Hub, Integration, Span, SpanContext } from '@sentry/types'; | ||
import { EventProcessor, Hub, Integration, Span, SpanContext, SpanStatus } from '@sentry/types'; | ||
/** JSDoc */ | ||
@@ -85,2 +85,6 @@ interface TracingOptions { | ||
/** | ||
* Sets the status of the current active transaction (if there is one) | ||
*/ | ||
static setTransactionStatus(status: SpanStatus): void; | ||
/** | ||
* Starts tracking for a specifc activity | ||
@@ -96,13 +100,3 @@ */ | ||
} | ||
/** | ||
* Creates transaction from navigation changes | ||
*/ | ||
declare function historyCallback(_: { | ||
[key: string]: any; | ||
}): void; | ||
export declare const TracingHandlers: { | ||
callback: typeof historyCallback; | ||
type: string; | ||
}[]; | ||
export {}; | ||
//# sourceMappingURL=tracing.d.ts.map |
@@ -49,2 +49,6 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
if (this._options.traceXHR !== false) { | ||
utils_1.addInstrumentationHandler({ | ||
callback: xhrCallback, | ||
type: 'xhr', | ||
}); | ||
this._traceXHR(getCurrentHub); | ||
@@ -54,4 +58,15 @@ } | ||
if (this._options.traceFetch !== false) { | ||
utils_1.addInstrumentationHandler({ | ||
callback: fetchCallback, | ||
type: 'fetch', | ||
}); | ||
this._traceFetch(getCurrentHub); | ||
} | ||
// tslint:disable-next-line: no-non-null-assertion | ||
if (this._options.startTransactionOnLocationChange) { | ||
utils_1.addInstrumentationHandler({ | ||
callback: historyCallback, | ||
type: 'history', | ||
}); | ||
} | ||
if (global.location && global.location.href) { | ||
@@ -197,9 +212,6 @@ // `${global.location.href}` will be used a temp transaction name | ||
} | ||
var activeTransaction = Tracing._activeTransaction; | ||
if (activeTransaction) { | ||
// If we already have an active transaction it means one of two things | ||
// a) The user did rapid navigation changes and didn't wait until the transaction was finished | ||
// b) A activity wasn't popped correctly and therefore the transaction is stalling | ||
activeTransaction.finish(); | ||
} | ||
// If we already have an active transaction it means one of two things | ||
// a) The user did rapid navigation changes and didn't wait until the transaction was finished | ||
// b) A activity wasn't popped correctly and therefore the transaction is stalling | ||
Tracing.finishIdleTransaction(); | ||
var _getCurrentHub = Tracing._getCurrentHub; | ||
@@ -250,2 +262,11 @@ if (!_getCurrentHub) { | ||
/** | ||
* Sets the status of the current active transaction (if there is one) | ||
*/ | ||
Tracing.setTransactionStatus = function (status) { | ||
var active = Tracing._activeTransaction; | ||
if (active) { | ||
active.setStatus(status); | ||
} | ||
}; | ||
/** | ||
* Starts tracking for a specifc activity | ||
@@ -292,2 +313,5 @@ */ | ||
span_1.setData(key, spanData[key]); | ||
if (key === 'status_code') { | ||
span_1.setHttpStatus(spanData[key]); | ||
} | ||
}); | ||
@@ -339,3 +363,3 @@ } | ||
} | ||
if (handlerData.requestComplete && handlerData.xhr.__sentry_xhr_activity_id__) { | ||
if (handlerData.endTimestamp && handlerData.xhr.__sentry_xhr_activity_id__) { | ||
Tracing.popActivity(handlerData.xhr.__sentry_xhr_activity_id__, handlerData.xhr.__sentry_xhr__); | ||
@@ -359,3 +383,3 @@ return; | ||
} | ||
if (handlerData.requestComplete && handlerData.__activity) { | ||
if (handlerData.endTimestamp && handlerData.__activity) { | ||
Tracing.popActivity(handlerData.__activity, handlerData.fetchData); | ||
@@ -386,16 +410,2 @@ } | ||
} | ||
var historyHandler = { | ||
callback: historyCallback, | ||
type: 'history', | ||
}; | ||
var xhrHandler = { | ||
callback: xhrCallback, | ||
type: 'xhr', | ||
}; | ||
var fetchHandler = { | ||
callback: fetchCallback, | ||
type: 'fetch', | ||
}; | ||
// tslint:disable-next-line: variable-name | ||
exports.TracingHandlers = [historyHandler, xhrHandler, fetchHandler]; | ||
//# sourceMappingURL=tracing.js.map |
import { Hub } from '@sentry/hub'; | ||
import { Span as SpanInterface, SpanContext } from '@sentry/types'; | ||
import { Span as SpanInterface, SpanContext, SpanStatus } from '@sentry/types'; | ||
export declare const TRACEPARENT_REGEXP: RegExp; | ||
@@ -112,7 +112,7 @@ /** | ||
*/ | ||
setFailure(): this; | ||
setStatus(value: SpanStatus): this; | ||
/** | ||
* @inheritDoc | ||
*/ | ||
setSuccess(): this; | ||
setHttpStatus(httpStatus: number): this; | ||
/** | ||
@@ -119,0 +119,0 @@ * @inheritDoc |
@@ -5,3 +5,5 @@ // tslint:disable:max-classes-per-file | ||
var hub_1 = require("@sentry/hub"); | ||
var types_1 = require("@sentry/types"); | ||
var utils_1 = require("@sentry/utils"); | ||
// TODO: Should this be exported? | ||
exports.TRACEPARENT_REGEXP = new RegExp('^[ \\t]*' + // whitespace | ||
@@ -163,4 +165,4 @@ '([0-9a-f]{32})?' + // trace_id | ||
*/ | ||
Span.prototype.setFailure = function () { | ||
this.setTag('status', 'failure'); | ||
Span.prototype.setStatus = function (value) { | ||
this.setTag('status', value); | ||
return this; | ||
@@ -171,4 +173,5 @@ }; | ||
*/ | ||
Span.prototype.setSuccess = function () { | ||
this.setTag('status', 'success'); | ||
Span.prototype.setHttpStatus = function (httpStatus) { | ||
this.setTag('http.status_code', String(httpStatus)); | ||
this.setStatus(types_1.SpanStatus.fromHttpCode(httpStatus)); | ||
return this; | ||
@@ -180,3 +183,3 @@ }; | ||
Span.prototype.isSuccess = function () { | ||
return this.tags.status !== 'failure'; | ||
return this.tags.status === types_1.SpanStatus.Ok; | ||
}; | ||
@@ -216,7 +219,6 @@ /** | ||
return this._hub.captureEvent({ | ||
// TODO: Is this necessary? We already do store contextx in in applyToEvent, | ||
// so maybe we can move `getTraceContext` call there as well? | ||
contexts: { trace: this.getTraceContext() }, | ||
spans: finishedSpans, | ||
start_timestamp: this.startTimestamp, | ||
tags: this.tags, | ||
timestamp: this.timestamp, | ||
@@ -223,0 +225,0 @@ transaction: this.transaction, |
export { Express } from './express'; | ||
export { Tracing, TracingHandlers } from './tracing'; | ||
export { Tracing } from './tracing'; | ||
//# sourceMappingURL=index.d.ts.map |
export { Express } from './express'; | ||
export { Tracing, TracingHandlers } from './tracing'; | ||
export { Tracing } from './tracing'; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
import { EventProcessor, Hub, Integration, Span, SpanContext } from '@sentry/types'; | ||
import { EventProcessor, Hub, Integration, Span, SpanContext, SpanStatus } from '@sentry/types'; | ||
/** JSDoc */ | ||
@@ -85,2 +85,6 @@ interface TracingOptions { | ||
/** | ||
* Sets the status of the current active transaction (if there is one) | ||
*/ | ||
static setTransactionStatus(status: SpanStatus): void; | ||
/** | ||
* Starts tracking for a specifc activity | ||
@@ -96,13 +100,3 @@ */ | ||
} | ||
/** | ||
* Creates transaction from navigation changes | ||
*/ | ||
declare function historyCallback(_: { | ||
[key: string]: any; | ||
}): void; | ||
export declare const TracingHandlers: { | ||
callback: typeof historyCallback; | ||
type: string; | ||
}[]; | ||
export {}; | ||
//# sourceMappingURL=tracing.d.ts.map |
import * as tslib_1 from "tslib"; | ||
import { fill, getGlobalObject, isMatchingPattern, logger, supportsNativeFetch } from '@sentry/utils'; | ||
import { addInstrumentationHandler, fill, getGlobalObject, isMatchingPattern, logger, supportsNativeFetch, } from '@sentry/utils'; | ||
var global = getGlobalObject(); | ||
@@ -48,2 +48,6 @@ /** | ||
if (this._options.traceXHR !== false) { | ||
addInstrumentationHandler({ | ||
callback: xhrCallback, | ||
type: 'xhr', | ||
}); | ||
this._traceXHR(getCurrentHub); | ||
@@ -53,4 +57,15 @@ } | ||
if (this._options.traceFetch !== false) { | ||
addInstrumentationHandler({ | ||
callback: fetchCallback, | ||
type: 'fetch', | ||
}); | ||
this._traceFetch(getCurrentHub); | ||
} | ||
// tslint:disable-next-line: no-non-null-assertion | ||
if (this._options.startTransactionOnLocationChange) { | ||
addInstrumentationHandler({ | ||
callback: historyCallback, | ||
type: 'history', | ||
}); | ||
} | ||
if (global.location && global.location.href) { | ||
@@ -196,9 +211,6 @@ // `${global.location.href}` will be used a temp transaction name | ||
} | ||
var activeTransaction = Tracing._activeTransaction; | ||
if (activeTransaction) { | ||
// If we already have an active transaction it means one of two things | ||
// a) The user did rapid navigation changes and didn't wait until the transaction was finished | ||
// b) A activity wasn't popped correctly and therefore the transaction is stalling | ||
activeTransaction.finish(); | ||
} | ||
// If we already have an active transaction it means one of two things | ||
// a) The user did rapid navigation changes and didn't wait until the transaction was finished | ||
// b) A activity wasn't popped correctly and therefore the transaction is stalling | ||
Tracing.finishIdleTransaction(); | ||
var _getCurrentHub = Tracing._getCurrentHub; | ||
@@ -249,2 +261,11 @@ if (!_getCurrentHub) { | ||
/** | ||
* Sets the status of the current active transaction (if there is one) | ||
*/ | ||
Tracing.setTransactionStatus = function (status) { | ||
var active = Tracing._activeTransaction; | ||
if (active) { | ||
active.setStatus(status); | ||
} | ||
}; | ||
/** | ||
* Starts tracking for a specifc activity | ||
@@ -291,2 +312,5 @@ */ | ||
span_1.setData(key, spanData[key]); | ||
if (key === 'status_code') { | ||
span_1.setHttpStatus(spanData[key]); | ||
} | ||
}); | ||
@@ -338,3 +362,3 @@ } | ||
} | ||
if (handlerData.requestComplete && handlerData.xhr.__sentry_xhr_activity_id__) { | ||
if (handlerData.endTimestamp && handlerData.xhr.__sentry_xhr_activity_id__) { | ||
Tracing.popActivity(handlerData.xhr.__sentry_xhr_activity_id__, handlerData.xhr.__sentry_xhr__); | ||
@@ -358,3 +382,3 @@ return; | ||
} | ||
if (handlerData.requestComplete && handlerData.__activity) { | ||
if (handlerData.endTimestamp && handlerData.__activity) { | ||
Tracing.popActivity(handlerData.__activity, handlerData.fetchData); | ||
@@ -385,16 +409,2 @@ } | ||
} | ||
var historyHandler = { | ||
callback: historyCallback, | ||
type: 'history', | ||
}; | ||
var xhrHandler = { | ||
callback: xhrCallback, | ||
type: 'xhr', | ||
}; | ||
var fetchHandler = { | ||
callback: fetchCallback, | ||
type: 'fetch', | ||
}; | ||
// tslint:disable-next-line: variable-name | ||
export var TracingHandlers = [historyHandler, xhrHandler, fetchHandler]; | ||
//# sourceMappingURL=tracing.js.map |
import { Hub } from '@sentry/hub'; | ||
import { Span as SpanInterface, SpanContext } from '@sentry/types'; | ||
import { Span as SpanInterface, SpanContext, SpanStatus } from '@sentry/types'; | ||
export declare const TRACEPARENT_REGEXP: RegExp; | ||
@@ -112,7 +112,7 @@ /** | ||
*/ | ||
setFailure(): this; | ||
setStatus(value: SpanStatus): this; | ||
/** | ||
* @inheritDoc | ||
*/ | ||
setSuccess(): this; | ||
setHttpStatus(httpStatus: number): this; | ||
/** | ||
@@ -119,0 +119,0 @@ * @inheritDoc |
// tslint:disable:max-classes-per-file | ||
import * as tslib_1 from "tslib"; | ||
import { getCurrentHub, Hub } from '@sentry/hub'; | ||
import { SpanStatus } from '@sentry/types'; | ||
import { logger, timestampWithMs, uuid4 } from '@sentry/utils'; | ||
// TODO: Should this be exported? | ||
export var TRACEPARENT_REGEXP = new RegExp('^[ \\t]*' + // whitespace | ||
@@ -161,4 +163,4 @@ '([0-9a-f]{32})?' + // trace_id | ||
*/ | ||
Span.prototype.setFailure = function () { | ||
this.setTag('status', 'failure'); | ||
Span.prototype.setStatus = function (value) { | ||
this.setTag('status', value); | ||
return this; | ||
@@ -169,4 +171,5 @@ }; | ||
*/ | ||
Span.prototype.setSuccess = function () { | ||
this.setTag('status', 'success'); | ||
Span.prototype.setHttpStatus = function (httpStatus) { | ||
this.setTag('http.status_code', String(httpStatus)); | ||
this.setStatus(SpanStatus.fromHttpCode(httpStatus)); | ||
return this; | ||
@@ -178,3 +181,3 @@ }; | ||
Span.prototype.isSuccess = function () { | ||
return this.tags.status !== 'failure'; | ||
return this.tags.status === SpanStatus.Ok; | ||
}; | ||
@@ -214,7 +217,6 @@ /** | ||
return this._hub.captureEvent({ | ||
// TODO: Is this necessary? We already do store contextx in in applyToEvent, | ||
// so maybe we can move `getTraceContext` call there as well? | ||
contexts: { trace: this.getTraceContext() }, | ||
spans: finishedSpans, | ||
start_timestamp: this.startTimestamp, | ||
tags: this.tags, | ||
timestamp: this.timestamp, | ||
@@ -221,0 +223,0 @@ transaction: this.transaction, |
{ | ||
"name": "@sentry/apm", | ||
"version": "5.10.0-beta.4", | ||
"version": "5.10.0-rc.0", | ||
"description": "Extensions for APM", | ||
@@ -19,6 +19,6 @@ "repository": "git://github.com/getsentry/sentry-javascript.git", | ||
"dependencies": { | ||
"@sentry/hub": "5.10.0-beta.4", | ||
"@sentry/minimal": "5.10.0-beta.4", | ||
"@sentry/types": "5.10.0-beta.4", | ||
"@sentry/utils": "5.10.0-beta.4", | ||
"@sentry/hub": "5.10.0-rc.0", | ||
"@sentry/minimal": "5.10.0-rc.0", | ||
"@sentry/types": "5.10.0-rc.0", | ||
"@sentry/utils": "5.10.0-rc.0", | ||
"tslib": "^1.9.3" | ||
@@ -25,0 +25,0 @@ }, |
@@ -12,5 +12,5 @@ <p align="center"> | ||
[![npm version](https://img.shields.io/npm/v/@sentry/core.svg)](https://www.npmjs.com/package/@sentry/core) | ||
[![npm dm](https://img.shields.io/npm/dm/@sentry/core.svg)](https://www.npmjs.com/package/@sentry/core) | ||
[![npm dt](https://img.shields.io/npm/dt/@sentry/core.svg)](https://www.npmjs.com/package/@sentry/core) | ||
[![npm version](https://img.shields.io/npm/v/@sentry/apm.svg)](https://www.npmjs.com/package/@sentry/apm) | ||
[![npm dm](https://img.shields.io/npm/dm/@sentry/apm.svg)](https://www.npmjs.com/package/@sentry/apm) | ||
[![npm dt](https://img.shields.io/npm/dt/@sentry/apm.svg)](https://www.npmjs.com/package/@sentry/apm) | ||
[![typedoc](https://img.shields.io/badge/docs-typedoc-blue.svg)](http://getsentry.github.io/sentry-javascript/) | ||
@@ -25,5 +25,2 @@ | ||
This package contains interface definitions, base classes and utilities for building Sentry JavaScript SDKs, like | ||
`@sentry/node` or `@sentry/browser`. | ||
Please consider all classes and exported functions and interfaces `internal`. | ||
This package contains extensions to the `@sentry/hub` to enable APM related functionality. It also provides integrations for Browser and Node that provide a good experience out of the box. |
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
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
195015
2329
25
+ Added@sentry/hub@5.10.0-rc.0(transitive)
+ Added@sentry/minimal@5.10.0-rc.0(transitive)
+ Added@sentry/types@5.10.0-rc.0(transitive)
+ Added@sentry/utils@5.10.0-rc.0(transitive)
- Removed@sentry/hub@5.10.0-beta.4(transitive)
- Removed@sentry/minimal@5.10.0-beta.4(transitive)
- Removed@sentry/types@5.10.0-beta.4(transitive)
- Removed@sentry/utils@5.10.0-beta.4(transitive)
Updated@sentry/hub@5.10.0-rc.0
Updated@sentry/minimal@5.10.0-rc.0
Updated@sentry/types@5.10.0-rc.0
Updated@sentry/utils@5.10.0-rc.0