dd-trace
Version:
Datadog APM tracing client for JavaScript
1 lines • 11.2 kB
JavaScript
(()=>{"use strict";var t={"./opentracing/lib/binary_carrier.js":function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){this.buffer=t}},"./opentracing/lib/constants.js":function(t,e){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"},"./opentracing/lib/ext/tags.js":function(t,e){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"},"./opentracing/lib/functions.js":function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0});var r=n("./opentracing/lib/constants.js"),o=n("./opentracing/lib/reference.js"),i=n("./opentracing/lib/span.js");e.childOf=function(t){return t instanceof i.default&&(t=t.context()),new o.default(r.REFERENCE_CHILD_OF,t)},e.followsFrom=function(t){return t instanceof i.default&&(t=t.context()),new o.default(r.REFERENCE_FOLLOWS_FROM,t)}},"./opentracing/lib/global_tracer.js":function(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return(r=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])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n("./opentracing/lib/tracer.js"),a=new i.default,c=null,s=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.startSpan=function(){var t=c||a;return t.startSpan.apply(t,arguments)},e.prototype.inject=function(){var t=c||a;return t.inject.apply(t,arguments)},e.prototype.extract=function(){var t=c||a;return t.extract.apply(t,arguments)},e}(i.default));e.initGlobalTracer=function(t){c=t},e.globalTracer=function(){return s}},"./opentracing/lib/index.js":function(t,e,n){function r(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}Object.defineProperty(e,"__esModule",{value:!0}),e.BinaryCarrier=n("./opentracing/lib/binary_carrier.js").default,e.Tags=n("./opentracing/lib/ext/tags.js");var o=n("./opentracing/lib/noop.js");e.Reference=n("./opentracing/lib/reference.js").default,e.Span=n("./opentracing/lib/span.js").default,e.SpanContext=n("./opentracing/lib/span_context.js").default,e.Tracer=n("./opentracing/lib/tracer.js").Tracer,e.MockTracer=n("./opentracing/lib/mock_tracer/index.js").MockTracer,r(n("./opentracing/lib/global_tracer.js")),r(n("./opentracing/lib/constants.js")),r(n("./opentracing/lib/functions.js")),o.initialize()},"./opentracing/lib/mock_tracer/index.js":function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.MockContext=n("./opentracing/lib/mock_tracer/mock_context.js").default,e.MockSpan=n("./opentracing/lib/mock_tracer/mock_span.js").default,e.MockTracer=n("./opentracing/lib/mock_tracer/mock_tracer.js").default},"./opentracing/lib/mock_tracer/mock_context.js":function(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return(r=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])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){function e(e){var n=t.call(this)||this;return n._span=e,n}return o(e,t),e.prototype.span=function(){return this._span},e}(n("./opentracing/lib/span_context.js").SpanContext);e.MockContext=i,e.default=i},"./opentracing/lib/mock_tracer/mock_report.js":function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=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=n,e.default=n},"./opentracing/lib/mock_tracer/mock_span.js":function(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return(r=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])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n("./opentracing/lib/index.js"),a=n("./opentracing/lib/mock_tracer/mock_context.js"),c=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 o(e,t),e.prototype._context=function(){return new a.default(this)},e.prototype._setOperationName=function(t){this._operationName=t},e.prototype._addTags=function(t){for(var e=Object.keys(t),n=0;n<e.length;n++){var r=e[n];this._tags[r]=t[r]}},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(0xffffffff*Math.random()|0).toString(16)).substr(-8)+("00000000"+Math.abs(0xffffffff*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}(i.Span);e.MockSpan=c,e.default=c},"./opentracing/lib/mock_tracer/mock_tracer.js":function(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return(r=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])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n("./opentracing/lib/index.js"),a=n("./opentracing/lib/mock_tracer/mock_report.js"),c=n("./opentracing/lib/mock_tracer/mock_span.js"),s=function(t){function e(){var e=t.call(this)||this;return e._spans=[],e}return o(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=Error().stack,n},e.prototype._inject=function(t,e,n){throw Error("NOT YET IMPLEMENTED")},e.prototype._extract=function(t,e){throw Error("NOT YET IMPLEMENTED")},e.prototype._allocSpan=function(){return new c.default(this)},e.prototype.clear=function(){this._spans=[]},e.prototype.report=function(){return new a.default(this._spans)},e}(i.Tracer);e.MockTracer=s,e.default=s},"./opentracing/lib/noop.js":function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0});var r=n("./opentracing/lib/span.js"),o=n("./opentracing/lib/span_context.js"),i=n("./opentracing/lib/tracer.js");e.tracer=null,e.spanContext=null,e.span=null,e.initialize=function(){e.tracer=new i.default,e.span=new r.default,e.spanContext=new o.default}},"./opentracing/lib/reference.js":function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0});var r=n("./opentracing/lib/span.js");e.default=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}()},"./opentracing/lib/span.js":function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0});var r=n("./opentracing/lib/noop.js"),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){var n;return this._addTags(((n={})[t]=e,n)),this},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},"./opentracing/lib/span_context.js":function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(){}return t.prototype.toTraceId=function(){return""},t.prototype.toSpanId=function(){return""},t}();e.SpanContext=n,e.default=n},"./opentracing/lib/tracer.js":function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0});var r=n("./opentracing/lib/functions.js"),o=n("./opentracing/lib/noop.js"),i=n("./opentracing/lib/span.js"),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}},e={},n=function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={exports:{}};return t[r].call(i.exports,i,i.exports,n),i.exports}("./opentracing/lib/index.js");module.exports=n})();