lightstep-tracer
Version:
> ❗ **This instrumentation is no longer recommended**. Please review [documentation on setting up and configuring the OpenTelemetry Node.js Launcher](https://github.com/lightstep/otel-launcher-node) or [OpenTelemetry JS (Browser)](https://github.com/open-
1 lines • 10.3 kB
JavaScript
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.opentracing=e():t.opentracing=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=1)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(2),o=function(){function t(){}return t.prototype.context=function(){return this._context()},t.prototype.tracer=function(){return this._tracer()},t.prototype.setOperationName=function(t){return this._setOperationName(t),this},t.prototype.setBaggageItem=function(t,e){return this._setBaggageItem(t,e),this},t.prototype.getBaggageItem=function(t){return this._getBaggageItem(t)},t.prototype.setTag=function(t,e){return this._addTags((n={},n[t]=e,n)),this;var n},t.prototype.addTags=function(t){return this._addTags(t),this},t.prototype.log=function(t,e){return this._log(t,e),this},t.prototype.logEvent=function(t,e){return this._log({event:t,payload:e})},t.prototype.finish=function(t){this._finish(t)},t.prototype._context=function(){return r.spanContext},t.prototype._tracer=function(){return r.tracer},t.prototype._setOperationName=function(t){},t.prototype._setBaggageItem=function(t,e){},t.prototype._getBaggageItem=function(t){},t.prototype._addTags=function(t){},t.prototype._log=function(t,e){},t.prototype._finish=function(t){},t}();e.Span=o,e.default=o},function(t,e,n){"use strict";function r(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}Object.defineProperty(e,"__esModule",{value:!0});var o=n(10);e.BinaryCarrier=o.default;var i=n(11);e.Tags=i;var a=n(2),u=n(6);e.Reference=u.default;var s=n(0);e.Span=s.default;var c=n(7);e.SpanContext=c.default;var p=n(3);e.Tracer=p.Tracer;var f=n(13);e.MockTracer=f.MockTracer,r(n(12)),r(n(4)),r(n(5)),a.initialize()},function(t,e,n){"use strict";function r(){e.tracer=new a.default,e.span=new o.default,e.spanContext=new i.default}Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),i=n(7),a=n(3);e.tracer=null,e.spanContext=null,e.span=null,e.initialize=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(5),o=n(2),i=n(0),a=function(){function t(){}return t.prototype.startSpan=function(t,e){if(void 0===e&&(e={}),e.childOf){var n=r.childOf(e.childOf);e.references?e.references.push(n):e.references=[n],delete e.childOf}return this._startSpan(t,e)},t.prototype.inject=function(t,e,n){return t instanceof i.default&&(t=t.context()),this._inject(t,e,n)},t.prototype.extract=function(t,e){return this._extract(t,e)},t.prototype._startSpan=function(t,e){return o.span},t.prototype._inject=function(t,e,n){},t.prototype._extract=function(t,e){return o.spanContext},t}();e.Tracer=a,e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FORMAT_BINARY="binary",e.FORMAT_TEXT_MAP="text_map",e.FORMAT_HTTP_HEADERS="http_headers",e.REFERENCE_CHILD_OF="child_of",e.REFERENCE_FOLLOWS_FROM="follows_from"},function(t,e,n){"use strict";function r(t){return t instanceof u.default&&(t=t.context()),new a.default(i.REFERENCE_CHILD_OF,t)}function o(t){return t instanceof u.default&&(t=t.context()),new a.default(i.REFERENCE_FOLLOWS_FROM,t)}Object.defineProperty(e,"__esModule",{value:!0});var i=n(4),a=n(6),u=n(0);e.childOf=r,e.followsFrom=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=function(){function t(t,e){this._type=t,this._referencedContext=e instanceof r.default?e.context():e}return t.prototype.type=function(){return this._type},t.prototype.referencedContext=function(){return this._referencedContext},t}();e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){}return t}();e.SpanContext=r,e.default=r},function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=n(1),i=function(t){function e(e){var n=t.call(this)||this;return n._span=e,n}return r(e,t),e.prototype.span=function(){return this._span},e}(o.SpanContext);e.MockContext=i,e.default=i},function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=n(1),i=n(8),a=function(t){function e(e){var n=t.call(this)||this;return n._mockTracer=e,n._uuid=n._generateUUID(),n._startMs=Date.now(),n._finishMs=0,n._operationName="",n._tags={},n._logs=[],n}return r(e,t),e.prototype._context=function(){return new i.default(this)},e.prototype._setOperationName=function(t){this._operationName=t},e.prototype._addTags=function(t){for(var e=Object.keys(t),n=0,r=e;n<r.length;n++){var o=r[n];this._tags[o]=t[o]}},e.prototype._log=function(t,e){this._logs.push({fields:t,timestamp:e})},e.prototype._finish=function(t){this._finishMs=t||Date.now()},e.prototype.uuid=function(){return this._uuid},e.prototype.operationName=function(){return this._operationName},e.prototype.durationMs=function(){return this._finishMs-this._startMs},e.prototype.tags=function(){return this._tags},e.prototype.tracer=function(){return this._mockTracer},e.prototype._generateUUID=function(){return""+("00000000"+Math.abs(4294967295*Math.random()|0).toString(16)).substr(-8)+("00000000"+Math.abs(4294967295*Math.random()|0).toString(16)).substr(-8)},e.prototype.addReference=function(t){},e.prototype.debug=function(){var t={uuid:this._uuid,operation:this._operationName,millis:[this._finishMs-this._startMs,this._startMs,this._finishMs]};return Object.keys(this._tags).length&&(t.tags=this._tags),t},e}(o.Span);e.MockSpan=a,e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t){this.buffer=t}return t}();e.default=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SPAN_KIND="span.kind",e.SPAN_KIND_RPC_CLIENT="client",e.SPAN_KIND_RPC_SERVER="server",e.SPAN_KIND_MESSAGING_PRODUCER="producer",e.SPAN_KIND_MESSAGING_CONSUMER="consumer",e.ERROR="error",e.COMPONENT="component",e.SAMPLING_PRIORITY="sampling.priority",e.PEER_SERVICE="peer.service",e.PEER_HOSTNAME="peer.hostname",e.PEER_ADDRESS="peer.address",e.PEER_HOST_IPV4="peer.ipv4",e.PEER_HOST_IPV6="peer.ipv6",e.PEER_PORT="peer.port",e.HTTP_URL="http.url",e.HTTP_METHOD="http.method",e.HTTP_STATUS_CODE="http.status_code",e.MESSAGE_BUS_DESTINATION="message_bus.destination",e.DB_INSTANCE="db.instance",e.DB_STATEMENT="db.statement",e.DB_TYPE="db.type",e.DB_USER="db.user"},function(t,e,n){"use strict";function r(t){s=t}function o(){return p}var i=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var a=n(3),u=new a.default,s=null,c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.startSpan=function(){var t=s||u;return t.startSpan.apply(t,arguments)},e.prototype.inject=function(){var t=s||u;return t.inject.apply(t,arguments)},e.prototype.extract=function(){var t=s||u;return t.extract.apply(t,arguments)},e}(a.default),p=new c;e.initGlobalTracer=r,e.globalTracer=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(8);e.MockContext=r.default;var o=n(9);e.MockSpan=o.default;var i=n(15);e.MockTracer=i.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t){var e=this;this.spans=t,this.spansByUUID={},this.spansByTag={},this.debugSpans=[],this.unfinishedSpans=[],t.forEach(function(t){0===t._finishMs&&e.unfinishedSpans.push(t),e.spansByUUID[t.uuid()]=t,e.debugSpans.push(t.debug());var n=t.tags();Object.keys(n).forEach(function(r){var o=n[r];e.spansByTag[r]=e.spansByTag[r]||{},e.spansByTag[r][o]=e.spansByTag[r][o]||[],e.spansByTag[r][o].push(t)})})}return t.prototype.firstSpanWithTagValue=function(t,e){var n=this.spansByTag[t];if(!n)return null;var r=n[e];return r?r[0]:null},t}();e.MockReport=r,e.default=r},function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=n(1),i=n(14),a=n(9),u=function(t){function e(){var e=t.call(this)||this;return e._spans=[],e}return r(e,t),e.prototype._startSpan=function(t,e){var n=this._allocSpan();if(n.setOperationName(t),this._spans.push(n),e.references)for(var r=0,o=e.references;r<o.length;r++){var i=o[r];n.addReference(i)}return n._startStack=(new Error).stack,n},e.prototype._inject=function(t,e,n){throw new Error("NOT YET IMPLEMENTED")},e.prototype._extract=function(t,e){throw new Error("NOT YET IMPLEMENTED")},e.prototype._allocSpan=function(){return new a.default(this)},e.prototype.clear=function(){this._spans=[]},e.prototype.report=function(){return new i.default(this._spans)},e}(o.Tracer);e.MockTracer=u,e.default=u}])});