Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

zipkin

Package Overview
Dependencies
Maintainers
1
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zipkin - npm Package Compare versions

Comparing version 0.11.2 to 0.12.0

2

index.d.ts

@@ -40,3 +40,3 @@ // TypeScript type definitions

createChildId(): TraceId;
letChildId<V>(callback: (traceId: TraceId) => V): V;
letId<V>(traceId: TraceId, callback: () => V): V;
setId(traceId: TraceId): void;

@@ -43,0 +43,0 @@ recordAnnotation(annotation: IAnnotation): void;

@@ -71,2 +71,7 @@ 'use strict';

}, {
key: 'letId',
value: function letId(id, callback) {
return this._ctxImpl.letContext(id, callback);
}
}, {
key: 'createRootId',

@@ -170,13 +175,2 @@ value: function createRootId() {

}, {
key: 'letChildId',
value: function letChildId(callable) {
var _this2 = this;
return this.scoped(function () {
var traceId = _this2.createChildId();
_this2.setId(traceId);
return callable(traceId);
});
}
}, {
key: 'setId',

@@ -189,3 +183,3 @@ value: function setId(traceId) {

value: function recordAnnotation(annotation) {
var _this3 = this;
var _this2 = this;

@@ -195,5 +189,5 @@ this.id.sampled.ifPresent(function (sampled) {

if (!sampled) return;
_this3.recorder.record(new Record({
traceId: _this3.id,
timestamp: now(_this3._startTimestamp, _this3._startTick),
_this2.recorder.record(new Record({
traceId: _this2.id,
timestamp: now(_this2._startTimestamp, _this2._startTick),
annotation: annotation

@@ -200,0 +194,0 @@ }));

{
"name": "zipkin",
"version": "0.11.2",
"version": "0.12.0",
"description": "The core tracer for zipkin.js",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -50,2 +50,6 @@ const {None, Some, fromNullable} = require('../option');

letId(id, callback) {
return this._ctxImpl.letContext(id, callback);
}
createRootId() {

@@ -138,10 +142,2 @@ const rootSpanId = randomTraceId();

letChildId(callable) {
return this.scoped(() => {
const traceId = this.createChildId();
this.setId(traceId);
return callable(traceId);
});
}
setId(traceId) {

@@ -148,0 +144,0 @@ this._ctxImpl.setContext(traceId);

@@ -43,2 +43,28 @@ const sinon = require('sinon');

it('should clear scope after letId', () => {
const recorder = {
record: () => {}
};
const ctxImpl = new ExplicitContext();
const tracer = new Tracer({ctxImpl, recorder});
ctxImpl.scoped(() => {
const parentId = tracer.createRootId();
const childId = tracer.createChildId();
tracer.setId(parentId);
tracer.letId(childId, () => {
expect(tracer.id).to.equal(childId);
tracer.letId(parentId, () => {
expect(tracer.id).to.equal(parentId);
});
expect(tracer.id).to.equal(childId);
});
expect(tracer.id).to.equal(parentId);
});
});
it('should make a local span', () => {

@@ -45,0 +71,0 @@ const record = sinon.spy();

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc