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

lightstep-tracer

Package Overview
Dependencies
Maintainers
8
Versions
115
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lightstep-tracer - npm Package Compare versions

Comparing version 0.25.0 to 0.25.1-no-protobuf

5

CHANGELOG.md

@@ -7,3 +7,6 @@ # CHANGELOG

## 0.24.4
## 0.25.1
* No changes (minor bump to align with 0.25.1-no-protobuf release)
## 0.25.0
* Bug fix on `fetch` instrumentation options headers being overwritten in some cases.

@@ -10,0 +13,0 @@ * Re-build dist to fix failed page load on IE11 (#207)

3

index.d.ts

@@ -57,4 +57,3 @@

/**
* optional, specifies the transport method used for communication to the Satellite. default = proto.
* `proto` - use protobuf over HTTP(S)
* optional, specifies the transport method used for communication to the Satellite. default = thrift.
* `thrift` - use thrift

@@ -61,0 +60,0 @@ */

@@ -14,3 +14,2 @@ 'use strict';

// eslint-disable-line camelcase
var proto = require('./generated_proto/collector_pb.js');

@@ -40,9 +39,2 @@ var AuthImp = function () {

}
}, {
key: 'toProto',
value: function toProto() {
var authProto = new proto.Auth();
authProto.setAccessToken(this._accessToken);
return authProto;
}
}]);

@@ -49,0 +41,0 @@

@@ -27,5 +27,2 @@ 'use strict';

// eslint-disable-line camelcase
var proto = require('./generated_proto/collector_pb.js');
var googleProtobufTimestampPB = require('google-protobuf/google/protobuf/timestamp_pb.js');
var LogRecordImp = function () {

@@ -126,34 +123,2 @@ function LogRecordImp(logFieldKeyHardLimit, logFieldValueHardLimit, timestampMicros, fields) {

}
}, {
key: 'toProto',
value: function toProto() {
var _this2 = this;
this._clearOverLimits();
var log = new proto.Log();
var ts = new googleProtobufTimestampPB.Timestamp();
var millis = Math.floor(this._timestampMicros / 1000);
var secs = Math.floor(millis / 1000);
var nanos = millis % 1000 * 1000000;
ts.setSeconds(secs);
ts.setNanos(nanos);
log.setTimestamp(ts);
var keyValues = [];
(0, _each3.default)(this._fields, function (value, key) {
if (!key || !value) {
return;
}
var keyStr = _this2.getFieldKey(key);
var valStr = _this2.getFieldValue(value);
var keyValue = new proto.KeyValue();
keyValue.setKey(keyStr);
keyValue.setStringValue(valStr);
keyValues.push(keyValue);
});
log.setFieldsList(keyValues);
return log;
}
}]);

@@ -160,0 +125,0 @@

@@ -27,4 +27,2 @@ 'use strict';

var proto = require('./generated_proto/collector_pb.js');
var ReportImp = function () {

@@ -95,30 +93,2 @@ function ReportImp(runtime, oldestMicros, youngestMicros, spanRecords, internalLogs, counters, timestampOffsetMicros) {

}
}, {
key: 'toProto',
value: function toProto(auth) {
var spansList = [];
(0, _each3.default)(this._spanRecords, function (spanRecord) {
spansList.push(spanRecord._toProto());
});
var countsList = [];
(0, _each3.default)(this._counters, function (count) {
var metricSample = new proto.MetricsSample();
metricSample.setName(count.name);
metricSample.setIntValue(count.int64_value);
metricSample.setDoubleValue(count.double_value);
countsList.push(metricSample);
});
var internalMetrics = new proto.InternalMetrics();
internalMetrics.setCountsList(countsList);
var reportProto = new proto.ReportRequest();
reportProto.setAuth(auth.toProto());
reportProto.setReporter(this._runtime.toProto());
reportProto.setSpansList(spansList);
reportProto.setTimestampOffsetMicros(this._timestampOffsetMicros);
reportProto.setInternalMetrics(internalMetrics);
return reportProto;
}
}]);

@@ -125,0 +95,0 @@

@@ -27,6 +27,2 @@ 'use strict';

var proto = require('./generated_proto/collector_pb.js');
var converter = require('hex2dec');
var packageObject = require('../../package.json');
var RuntimeImp = function () {

@@ -62,48 +58,2 @@ function RuntimeImp(runtimeGUID, startMicros, componentName, attributes) {

}
}, {
key: 'toProto',
value: function toProto() {
var tracerVersion = new proto.KeyValue();
tracerVersion.setKey('lightstep.tracer_version');
tracerVersion.setStringValue(packageObject.version);
var tracerPlatform = new proto.KeyValue();
tracerPlatform.setKey('lightstep.tracer_platform');
tracerPlatform.setStringValue(this._attributes['lightstep.tracer_platform']);
var tracerPlatformVersion = new proto.KeyValue();
tracerPlatformVersion.setKey('lightstep.tracer_platform_version');
tracerPlatformVersion.setStringValue(this._attributes['lightstep.tracer_platform_version']);
var componentName = new proto.KeyValue();
componentName.setKey('lightstep.component_name');
componentName.setStringValue(this._componentName);
var commandLine = new proto.KeyValue();
commandLine.setKey('lightstep.command_line');
commandLine.setStringValue(this._attributes['lightstep.command_line']);
var hostname = new proto.KeyValue();
hostname.setKey('lightstep.hostname');
hostname.setStringValue(this._attributes['lightstep.hostname']);
var reporterId = converter.hexToDec(this._runtimeGUID);
var tracerTags = [];
(0, _each3.default)(this._attributes, function (val, key) {
var ttag = new proto.KeyValue();
ttag.setKey(key);
ttag.setStringValue(val);
tracerTags.push(ttag);
});
var reporterTags = [tracerVersion, tracerPlatform, componentName, commandLine, hostname, tracerPlatformVersion];
var allTags = reporterTags.concat(tracerTags);
var reporterProto = new proto.Reporter();
reporterProto.setReporterId(reporterId);
reporterProto.setTagsList(allTags);
return reporterProto;
}
}]);

@@ -110,0 +60,0 @@

@@ -51,6 +51,2 @@ 'use strict';

var converter = require('hex2dec');
var proto = require('./generated_proto/collector_pb.js');
var googleProtobufTimestampPB = require('google-protobuf/google/protobuf/timestamp_pb.js');
var SpanImp = function (_opentracing$Span) {

@@ -294,60 +290,2 @@ _inherits(SpanImp, _opentracing$Span);

}
}, {
key: '_toProto',
value: function _toProto() {
var _this3 = this;
var spanContextProto = new proto.SpanContext();
spanContextProto.setTraceId(converter.hexToDec(this.traceGUID()));
spanContextProto.setSpanId(converter.hexToDec(this.guid()));
var spanProto = new proto.Span();
spanProto.setSpanContext(spanContextProto);
spanProto.setOperationName(this._operationName);
var startTimestamp = new googleProtobufTimestampPB.Timestamp();
var startMillis = Math.floor(this._beginMicros / 1000);
var startSeconds = Math.floor(startMillis / 1000);
var startNanos = startMillis % 1000 * 1000000;
startTimestamp.setSeconds(startSeconds);
startTimestamp.setNanos(startNanos);
spanProto.setStartTimestamp(startTimestamp);
spanProto.setDurationMicros((this._endMicros - this._beginMicros).toString());
var logs = [];
(0, _each3.default)(this._log_records, function (logRecord) {
var logProto = logRecord.toProto();
_this3._tracerImp._counters['logs.keys.over_limit'] += logRecord.getNumKeysOverLimit();
_this3._tracerImp._counters['logs.values.over_limit'] += logRecord.getNumValuesOverLimit();
logs.push(logProto);
});
spanProto.setLogsList(logs);
var parentSpanGUID = undefined;
var tags = [];
(0, _each3.default)(this._tags, function (value, key) {
var strValue = coerce.toString(value);
var strKey = coerce.toString(key);
var tag = new proto.KeyValue();
if (strKey === 'parent_span_guid') {
parentSpanGUID = strValue;
}
tag.setKey(strKey);
tag.setStringValue(strValue);
tags.push(tag);
});
spanProto.setTagsList(tags);
if (parentSpanGUID !== undefined) {
var ref = new proto.Reference();
ref.setRelationship(proto.Reference.Relationship.CHILD_OF);
var parentSpanContext = new proto.SpanContext();
parentSpanContext.setSpanId(converter.hexToDec(parentSpanGUID));
ref.setSpanContext(parentSpanContext);
spanProto.setReferencesList([ref]);
}
return spanProto;
}
}]);

@@ -354,0 +292,0 @@

@@ -196,6 +196,2 @@ 'use strict';

switch (_this._options.transport) {
case 'proto':
_this._transport = new _platform_abstraction_layer.ProtoTransport(logger);
_this._info('Using protobuf over HTTP transport per user-defined option.');
break;
case 'thrift':

@@ -206,4 +202,4 @@ _this._transport = new _platform_abstraction_layer.ThriftTransport(logger);

default:
_this._transport = new _platform_abstraction_layer.ProtoTransport(logger);
_this._info('Using protobuf over HTTP transport as no user-defined option was supplied.');
_this._transport = new _platform_abstraction_layer.ThriftTransport(logger);
_this._info('Using thrift transport per user-defined option.');
}

@@ -281,3 +277,3 @@ }

this.addOption('disable_clock_skew_correction', { type: 'bool', defaultValue: false });
this.addOption('transport', { type: 'string', defaultValue: 'proto' });
this.addOption('transport', { type: 'string', defaultValue: 'thrift' });

@@ -284,0 +280,0 @@ // Non-standard, may be deprecated

@@ -12,6 +12,4 @@ 'use strict';

ThriftTransport: require('./imp/platform/browser/transport_httpthrift.js'),
ProtoTransport: require('./imp/platform/browser/transport_httpproto.js'),
thrift: require('./imp/platform/browser/thrift.js'),
crouton_thrift: require('./imp/platform/browser/crouton_thrift.js'),
proto: require('./imp/generated_proto/collector_pb.js')
crouton_thrift: require('./imp/platform/browser/crouton_thrift.js')
};

@@ -22,8 +20,6 @@ } else {

ThriftTransport: require('./imp/platform/node/transport_httpthrift.js'),
ProtoTransport: require('./imp/platform/node/transport_httpproto.js'),
// Note: THRIFT-5029 requires us to use a non-standard require
// TODO: remove non-standard require after https://github.com/apache/thrift/pull/1947 merges
thrift: require('thrift/src/thrift'),
crouton_thrift: require('./imp/platform/node/crouton_thrift.js'),
proto: require('./imp/generated_proto/collector_pb.js')
crouton_thrift: require('./imp/platform/node/crouton_thrift.js')
};

@@ -30,0 +26,0 @@ }

{
"name": "lightstep-tracer",
"version": "0.25.0",
"version": "0.25.1-no-protobuf",
"main": "index.js",

@@ -11,3 +11,4 @@ "types": "index.d.ts",

"scripts": {
"test": "rm -f test/results/*.json && node node_modules/mocha/bin/mocha -c test/unittest_node.js"
"test": "rm -f test/results/*.json && node node_modules/mocha/bin/mocha -c test/unittest_node.js",
"version": "make build && git add -A dist"
},

@@ -22,3 +23,2 @@ "license": "MIT",

"eventemitter3": "1.1.1",
"google-protobuf": "3.6.1",
"hex2dec": "1.0.1",

@@ -25,0 +25,0 @@ "source-map-support": "0.3.3",

import { crouton_thrift } from '../platform_abstraction_layer'; // eslint-disable-line camelcase
let proto = require('./generated_proto/collector_pb.js');

@@ -22,8 +21,2 @@ export default class AuthImp {

}
toProto() {
let authProto = new proto.Auth();
authProto.setAccessToken(this._accessToken);
return authProto;
}
}
import { crouton_thrift } from '../platform_abstraction_layer'; // eslint-disable-line camelcase
import _each from '../_each';
import * as coerce from './coerce'; // eslint-disable-line camelcase
let proto = require('./generated_proto/collector_pb.js');
let googleProtobufTimestampPB = require('google-protobuf/google/protobuf/timestamp_pb.js');
export default class LogRecordImp {

@@ -91,31 +88,2 @@ constructor(logFieldKeyHardLimit, logFieldValueHardLimit, timestampMicros, fields) {

}
toProto() {
this._clearOverLimits();
let log = new proto.Log();
let ts = new googleProtobufTimestampPB.Timestamp();
let millis = Math.floor(this._timestampMicros / 1000);
let secs = Math.floor(millis / 1000);
let nanos = (millis % 1000) * 1000000;
ts.setSeconds(secs);
ts.setNanos(nanos);
log.setTimestamp(ts);
let keyValues = [];
_each(this._fields, (value, key) => {
if (!key || !value) {
return;
}
let keyStr = this.getFieldKey(key);
let valStr = this.getFieldValue(value);
let keyValue = new proto.KeyValue();
keyValue.setKey(keyStr);
keyValue.setStringValue(valStr);
keyValues.push(keyValue);
});
log.setFieldsList(keyValues);
return log;
}
}
import { crouton_thrift } from '../platform_abstraction_layer'; // eslint-disable-line camelcase
import _each from '../_each'; // eslint-disable-line camelcase
import * as coerce from './coerce.js';
let proto = require('./generated_proto/collector_pb.js');

@@ -62,29 +61,2 @@ export default class ReportImp {

}
toProto(auth) {
let spansList = [];
_each(this._spanRecords, (spanRecord) => {
spansList.push(spanRecord._toProto());
});
let countsList = [];
_each(this._counters, (count) => {
let metricSample = new proto.MetricsSample();
metricSample.setName(count.name);
metricSample.setIntValue(count.int64_value);
metricSample.setDoubleValue(count.double_value);
countsList.push(metricSample);
});
let internalMetrics = new proto.InternalMetrics();
internalMetrics.setCountsList(countsList);
let reportProto = new proto.ReportRequest();
reportProto.setAuth(auth.toProto());
reportProto.setReporter(this._runtime.toProto());
reportProto.setSpansList(spansList);
reportProto.setTimestampOffsetMicros(this._timestampOffsetMicros);
reportProto.setInternalMetrics(internalMetrics);
return reportProto;
}
}
import { crouton_thrift } from '../platform_abstraction_layer'; // eslint-disable-line camelcase
import _each from '../_each'; // eslint-disable-line camelcase
import * as coerce from './coerce.js';
let proto = require('./generated_proto/collector_pb.js');
let converter = require('hex2dec');
const packageObject = require('../../package.json');

@@ -34,47 +31,2 @@ export default class RuntimeImp {

}
toProto() {
let tracerVersion = new proto.KeyValue();
tracerVersion.setKey('lightstep.tracer_version');
tracerVersion.setStringValue(packageObject.version);
let tracerPlatform = new proto.KeyValue();
tracerPlatform.setKey('lightstep.tracer_platform');
tracerPlatform.setStringValue(this._attributes['lightstep.tracer_platform']);
let tracerPlatformVersion = new proto.KeyValue();
tracerPlatformVersion.setKey('lightstep.tracer_platform_version');
tracerPlatformVersion.setStringValue(this._attributes['lightstep.tracer_platform_version']);
let componentName = new proto.KeyValue();
componentName.setKey('lightstep.component_name');
componentName.setStringValue(this._componentName);
let commandLine = new proto.KeyValue();
commandLine.setKey('lightstep.command_line');
commandLine.setStringValue(this._attributes['lightstep.command_line']);
let hostname = new proto.KeyValue();
hostname.setKey('lightstep.hostname');
hostname.setStringValue(this._attributes['lightstep.hostname']);
let reporterId = converter.hexToDec(this._runtimeGUID);
let tracerTags = [];
_each(this._attributes, (val, key) => {
let ttag = new proto.KeyValue();
ttag.setKey(key);
ttag.setStringValue(val);
tracerTags.push(ttag);
});
let reporterTags = [tracerVersion, tracerPlatform, componentName, commandLine, hostname, tracerPlatformVersion];
let allTags = reporterTags.concat(tracerTags);
let reporterProto = new proto.Reporter();
reporterProto.setReporterId(reporterId);
reporterProto.setTagsList(allTags);
return reporterProto;
}
}

@@ -8,6 +8,2 @@ import * as coerce from './coerce.js';

import util from './util/util.js';
let converter = require('hex2dec');
let proto = require('./generated_proto/collector_pb.js');
let googleProtobufTimestampPB = require('google-protobuf/google/protobuf/timestamp_pb.js');
export default class SpanImp extends opentracing.Span {

@@ -222,57 +218,2 @@

}
_toProto() {
let spanContextProto = new proto.SpanContext();
spanContextProto.setTraceId(converter.hexToDec(this.traceGUID()));
spanContextProto.setSpanId(converter.hexToDec(this.guid()));
let spanProto = new proto.Span();
spanProto.setSpanContext(spanContextProto);
spanProto.setOperationName(this._operationName);
let startTimestamp = new googleProtobufTimestampPB.Timestamp();
let startMillis = Math.floor(this._beginMicros / 1000);
let startSeconds = Math.floor(startMillis / 1000);
let startNanos = (startMillis % 1000) * 1000000;
startTimestamp.setSeconds(startSeconds);
startTimestamp.setNanos(startNanos);
spanProto.setStartTimestamp(startTimestamp);
spanProto.setDurationMicros((this._endMicros - this._beginMicros).toString());
let logs = [];
_each(this._log_records, (logRecord) => {
let logProto = logRecord.toProto();
this._tracerImp._counters['logs.keys.over_limit'] += logRecord.getNumKeysOverLimit();
this._tracerImp._counters['logs.values.over_limit'] += logRecord.getNumValuesOverLimit();
logs.push(logProto);
});
spanProto.setLogsList(logs);
let parentSpanGUID = undefined;
let tags = [];
_each(this._tags, (value, key) => {
let strValue = coerce.toString(value);
let strKey = coerce.toString(key);
let tag = new proto.KeyValue();
if (strKey === 'parent_span_guid') {
parentSpanGUID = strValue;
}
tag.setKey(strKey);
tag.setStringValue(strValue);
tags.push(tag);
});
spanProto.setTagsList(tags);
if (parentSpanGUID !== undefined) {
let ref = new proto.Reference();
ref.setRelationship(proto.Reference.Relationship.CHILD_OF);
let parentSpanContext = new proto.SpanContext();
parentSpanContext.setSpanId(converter.hexToDec(parentSpanGUID));
ref.setSpanContext(parentSpanContext);
spanProto.setReferencesList([ref]);
}
return spanProto;
}
}

@@ -11,3 +11,3 @@ //============================================================================//

import _each from '../_each';
import { Platform, ProtoTransport, ThriftTransport } from '../platform_abstraction_layer';
import { Platform, ThriftTransport } from '../platform_abstraction_layer';
import AuthImp from './auth_imp';

@@ -144,6 +144,2 @@ import RuntimeImp from './runtime_imp';

switch (this._options.transport) {
case 'proto':
this._transport = new ProtoTransport(logger);
this._info('Using protobuf over HTTP transport per user-defined option.');
break;
case 'thrift':

@@ -154,4 +150,4 @@ this._transport = new ThriftTransport(logger);

default:
this._transport = new ProtoTransport(logger);
this._info('Using protobuf over HTTP transport as no user-defined option was supplied.');
this._transport = new ThriftTransport(logger);
this._info('Using thrift transport per user-defined option.');
}

@@ -238,3 +234,3 @@ }

this.addOption('disable_clock_skew_correction', { type: 'bool', defaultValue: false });
this.addOption('transport', { type: 'string', defaultValue: 'proto' });
this.addOption('transport', { type: 'string', defaultValue: 'thrift' });

@@ -241,0 +237,0 @@ // Non-standard, may be deprecated

@@ -10,6 +10,4 @@ /* global PLATFORM_BROWSER */

ThriftTransport : require('./imp/platform/browser/transport_httpthrift.js'),
ProtoTransport : require('./imp/platform/browser/transport_httpproto.js'),
thrift : require('./imp/platform/browser/thrift.js'),
crouton_thrift : require('./imp/platform/browser/crouton_thrift.js'),
proto : require('./imp/generated_proto/collector_pb.js'),
};

@@ -20,3 +18,2 @@ } else {

ThriftTransport : require('./imp/platform/node/transport_httpthrift.js'),
ProtoTransport : require('./imp/platform/node/transport_httpproto.js'),
// Note: THRIFT-5029 requires us to use a non-standard require

@@ -26,4 +23,3 @@ // TODO: remove non-standard require after https://github.com/apache/thrift/pull/1947 merges

crouton_thrift : require('./imp/platform/node/crouton_thrift.js'),
proto : require('./imp/generated_proto/collector_pb.js'),
};
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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

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