@opentelemetry/web
Advanced tools
Comparing version 0.1.1 to 0.2.0
@@ -34,3 +34,2 @@ /*! | ||
* @param scope | ||
* @private | ||
*/ | ||
@@ -37,0 +36,0 @@ private _bindFunction; |
@@ -33,3 +33,2 @@ "use strict"; | ||
* @param scope | ||
* @private | ||
*/ | ||
@@ -36,0 +35,0 @@ _bindFunction(target, scope) { |
@@ -16,4 +16,14 @@ /*! | ||
*/ | ||
import { BasePlugin } from '@opentelemetry/core'; | ||
import { BasicTracer, BasicTracerConfig } from '@opentelemetry/tracing'; | ||
/** | ||
* WebTracerConfig provides an interface for configuring a Web Tracer. | ||
*/ | ||
export interface WebTracerConfig extends BasicTracerConfig { | ||
/** | ||
* plugins to be used with tracer, they will be enabled automatically | ||
*/ | ||
plugins?: BasePlugin<unknown>[]; | ||
} | ||
/** | ||
* This class represents a web tracer with {@link StackScopeManager} | ||
@@ -24,8 +34,5 @@ */ | ||
* Constructs a new Tracer instance. | ||
* @param config Web Tracer config | ||
*/ | ||
/** | ||
* | ||
* @param {BasicTracerConfig} config Web Tracer config | ||
*/ | ||
constructor(config?: BasicTracerConfig); | ||
constructor(config?: WebTracerConfig); | ||
} |
@@ -26,7 +26,4 @@ "use strict"; | ||
* Constructs a new Tracer instance. | ||
* @param config Web Tracer config | ||
*/ | ||
/** | ||
* | ||
* @param {BasicTracerConfig} config Web Tracer config | ||
*/ | ||
constructor(config = {}) { | ||
@@ -36,4 +33,10 @@ if (typeof config.scopeManager === 'undefined') { | ||
} | ||
if (typeof config.plugins === 'undefined') { | ||
config.plugins = []; | ||
} | ||
super(Object.assign({}, { scopeManager: config.scopeManager }, config)); | ||
config.scopeManager.enable(); | ||
super(Object.assign({}, { scopeManager: config.scopeManager }, config)); | ||
for (const plugin of config.plugins) { | ||
plugin.enable([], this, this.logger, {}); | ||
} | ||
} | ||
@@ -40,0 +43,0 @@ } |
{ | ||
"name": "@opentelemetry/web", | ||
"version": "0.1.1", | ||
"version": "0.2.0", | ||
"description": "OpenTelemetry Web Tracer", | ||
@@ -9,10 +9,11 @@ "main": "build/src/index.js", | ||
"scripts": { | ||
"test:browser": "nyc karma start --single-run", | ||
"tdd": "karma start", | ||
"check": "gts check", | ||
"clean": "rimraf build/*", | ||
"codecov:browser": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../", | ||
"clean": "rimraf build/*", | ||
"check": "gts check", | ||
"compile": "tsc -p .", | ||
"fix": "gts fix", | ||
"prepare": "npm run compile" | ||
"prepare": "npm run compile", | ||
"tdd": "karma start", | ||
"test:browser": "nyc karma start --single-run", | ||
"watch": "tsc -w" | ||
}, | ||
@@ -43,12 +44,14 @@ "keywords": [ | ||
"devDependencies": { | ||
"@babel/core": "^7.6.0", | ||
"@types/mocha": "^5.2.5", | ||
"@types/node": "^12.6.8", | ||
"@types/sinon": "^7.0.13", | ||
"@types/webpack-env": "1.13.9", | ||
"@types/sinon": "^7.0.13", | ||
"@babel/core": "^7.6.0", | ||
"babel-loader": "^8.0.6", | ||
"codecov": "^3.1.0", | ||
"gts": "^1.0.0", | ||
"karma": "^4.1.0", | ||
"karma-chrome-launcher": "^2.2.0", | ||
"istanbul-instrumenter-loader": "^3.0.1", | ||
"karma": "^4.4.1", | ||
"karma-chrome-launcher": "^3.1.0", | ||
"karma-coverage-istanbul-reporter": "^2.1.0", | ||
"karma-mocha": "^1.3.0", | ||
@@ -61,7 +64,7 @@ "karma-spec-reporter": "^0.0.32", | ||
"sinon": "^7.5.0", | ||
"tslint-consistent-codestyle": "^1.16.0", | ||
"tslint-microsoft-contrib": "^6.2.0", | ||
"ts-loader": "^6.0.4", | ||
"ts-mocha": "^6.0.0", | ||
"ts-node": "^8.0.0", | ||
"tslint-consistent-codestyle": "^1.16.0", | ||
"tslint-microsoft-contrib": "^6.2.0", | ||
"typescript": "^3.6.3", | ||
@@ -73,7 +76,7 @@ "webpack": "^4.35.2", | ||
"dependencies": { | ||
"@opentelemetry/core": "^0.1.0", | ||
"@opentelemetry/scope-base": "^0.1.0", | ||
"@opentelemetry/types": "^0.1.0", | ||
"@opentelemetry/tracing": "^0.1.0" | ||
"@opentelemetry/core": "^0.2.0", | ||
"@opentelemetry/scope-base": "^0.2.0", | ||
"@opentelemetry/tracing": "^0.2.0", | ||
"@opentelemetry/types": "^0.2.0" | ||
} | ||
} | ||
} |
@@ -14,4 +14,16 @@ # OpenTelemetry Web | ||
## How does automatic tracing work? | ||
> Automatic Instrumentation is in progress, manual instrumentation only supported | ||
```js | ||
import { ConsoleSpanExporter, SimpleSpanProcessor } from '@opentelemetry/tracing'; | ||
import { WebTracer } from '@opentelemetry/web'; | ||
import { DocumentLoad } from '@opentelemetry/plugin-document-load'; | ||
const webTracer = new WebTracer({ | ||
plugins: [ | ||
new DocumentLoad() | ||
] | ||
}); | ||
webTracer.addSpanProcessor(new SimpleSpanProcessor(new ConsoleSpanExporter())); | ||
``` | ||
## Installation | ||
@@ -31,3 +43,2 @@ | ||
webTracer.withSpan(span, function () { | ||
// this === span | ||
this.addEvent('start'); | ||
@@ -34,0 +45,0 @@ }); |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
25630
288
68
0
28
+ Added@opentelemetry/base@0.2.0(transitive)
+ Added@opentelemetry/core@0.2.0(transitive)
+ Added@opentelemetry/scope-base@0.2.0(transitive)
+ Added@opentelemetry/tracing@0.2.0(transitive)
+ Added@opentelemetry/types@0.2.0(transitive)
+ Addedsemver@6.3.1(transitive)
- Removed@opentelemetry/base@0.1.1(transitive)
- Removed@opentelemetry/core@0.1.1(transitive)
- Removed@opentelemetry/scope-base@0.1.1(transitive)
- Removed@opentelemetry/tracing@0.1.1(transitive)
- Removed@opentelemetry/types@0.1.1(transitive)
Updated@opentelemetry/core@^0.2.0
Updated@opentelemetry/types@^0.2.0