dd-trace
Version:
Datadog APM tracing client for JavaScript
1 lines • 29.2 kB
JavaScript
(()=>{"use strict";var e={"./@opentelemetry/resources/build/esm/detectors/platform/node/machine-id/execAsync.js":function(e,t,r){r.d(t,{q:()=>o});let n=require("child_process");var o=require("util").promisify(n.exec)},"./@opentelemetry/resources/build/esm/detectors/platform/node/machine-id/getMachineId-bsd.js":function(e,t,r){r.d(t,{D:()=>u});var n=r("fs"),o=r("./@opentelemetry/resources/build/esm/detectors/platform/node/machine-id/execAsync.js"),i=r("@opentelemetry/api"),a=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){var c=[i,u];if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,n=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],n=0}finally{r=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}};function u(){var e,t,r,u;return e=this,t=void 0,r=void 0,u=function(){var e,t;return a(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,n.promises.readFile("/etc/hostid",{encoding:"utf8"})];case 1:return[2,r.sent().trim()];case 2:return e=r.sent(),i.diag.debug("error reading machine id: "+e),[3,3];case 3:return r.trys.push([3,5,,6]),[4,(0,o.q)("kenv -q smbios.system.uuid")];case 4:return[2,r.sent().stdout.trim()];case 5:return t=r.sent(),i.diag.debug("error reading machine id: "+t),[3,6];case 6:return[2,""]}})},new(r||(r=Promise))(function(n,o){function i(e){try{c(u.next(e))}catch(e){o(e)}}function a(e){try{c(u.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(i,a)}c((u=u.apply(e,t||[])).next())})}},"./@opentelemetry/resources/build/esm/detectors/platform/node/machine-id/getMachineId-darwin.js":function(e,t,r){r.d(t,{D:()=>a});var n=r("./@opentelemetry/resources/build/esm/detectors/platform/node/machine-id/execAsync.js"),o=r("@opentelemetry/api"),i=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){var c=[i,u];if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,n=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],n=0}finally{r=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}};function a(){var e,t,r,a;return e=this,t=void 0,r=void 0,a=function(){var e,t,r;return i(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,(0,n.q)('ioreg -rd1 -c "IOPlatformExpertDevice"')];case 1:if(!(e=i.sent().stdout.split("\n").find(function(e){return e.includes("IOPlatformUUID")})))return[2,""];if(2===(t=e.split('" = "')).length)return[2,t[1].slice(0,-1)];return[3,3];case 2:return r=i.sent(),o.diag.debug("error reading machine id: "+r),[3,3];case 3:return[2,""]}})},new(r||(r=Promise))(function(n,o){function i(e){try{c(a.next(e))}catch(e){o(e)}}function u(e){try{c(a.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(i,u)}c((a=a.apply(e,t||[])).next())})}},"./@opentelemetry/resources/build/esm/detectors/platform/node/machine-id/getMachineId-linux.js":function(e,t,r){r.d(t,{D:()=>u});var n=r("fs"),o=r("@opentelemetry/api"),i=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){var c=[i,u];if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,n=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],n=0}finally{r=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}},a=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};function u(){var e,t,r,u;return e=this,t=void 0,r=void 0,u=function(){var e,t,r,u,c,s,l;return i(this,function(i){switch(i.label){case 0:e=["/etc/machine-id","/var/lib/dbus/machine-id"],i.label=1;case 1:i.trys.push([1,8,9,10]),r=(t=a(e)).next(),i.label=2;case 2:if(r.done)return[3,7];u=r.value,i.label=3;case 3:return i.trys.push([3,5,,6]),[4,n.promises.readFile(u,{encoding:"utf8"})];case 4:return[2,i.sent().trim()];case 5:return c=i.sent(),o.diag.debug("error reading machine id: "+c),[3,6];case 6:return r=t.next(),[3,2];case 7:return[3,10];case 8:return s={error:i.sent()},[3,10];case 9:try{r&&!r.done&&(l=t.return)&&l.call(t)}finally{if(s)throw s.error}return[7];case 10:return[2,""]}})},new(r||(r=Promise))(function(n,o){function i(e){try{c(u.next(e))}catch(e){o(e)}}function a(e){try{c(u.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(i,a)}c((u=u.apply(e,t||[])).next())})}},"./@opentelemetry/resources/build/esm/detectors/platform/node/machine-id/getMachineId-unsupported.js":function(e,t,r){r.d(t,{D:()=>i});var n=r("@opentelemetry/api"),o=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){var c=[i,u];if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,n=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],n=0}finally{r=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}};function i(){var e,t,r,i;return e=this,t=void 0,r=void 0,i=function(){return o(this,function(e){return n.diag.debug("could not read machine-id: unsupported platform"),[2,""]})},new(r||(r=Promise))(function(n,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function u(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,u)}c((i=i.apply(e,t||[])).next())})}},"./@opentelemetry/resources/build/esm/detectors/platform/node/machine-id/getMachineId-win.js":function(e,t,r){r.d(t,{D:()=>u});var n=r("process"),o=r("./@opentelemetry/resources/build/esm/detectors/platform/node/machine-id/execAsync.js"),i=r("@opentelemetry/api"),a=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){var c=[i,u];if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,n=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],n=0}finally{r=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}};function u(){var e,t,r,u;return e=this,t=void 0,r=void 0,u=function(){var e,t,r,u;return a(this,function(a){switch(a.label){case 0:e="QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",t="%windir%\\System32\\REG.exe","ia32"===n.arch&&"PROCESSOR_ARCHITEW6432"in n.env&&(t="%windir%\\sysnative\\cmd.exe /c "+t),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,(0,o.q)(t+" "+e)];case 2:if(2===(r=a.sent().stdout.split("REG_SZ")).length)return[2,r[1].trim()];return[3,4];case 3:return u=a.sent(),i.diag.debug("error reading machine id: "+u),[3,4];case 4:return[2,""]}})},new(r||(r=Promise))(function(n,o){function i(e){try{c(u.next(e))}catch(e){o(e)}}function a(e){try{c(u.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(i,a)}c((u=u.apply(e,t||[])).next())})}},"@opentelemetry/api":function(e){e.exports=require("@opentelemetry/api")},fs:function(e){e.exports=require("fs")},process:function(e){e.exports=require("process")}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{r.r(n),r.d(n,{envDetector:()=>N,envDetectorSync:()=>C,hostDetector:()=>X,Resource:()=>h,osDetector:()=>G,detectResources:()=>Z,osDetectorSync:()=>B,browserDetectorSync:()=>R,processDetectorSync:()=>V,detectResourcesSync:()=>J,browserDetector:()=>b,processDetector:()=>H,defaultServiceName:()=>d,hostDetectorSync:()=>D,serviceInstanceIdDetectorSync:()=>Y});var e,t,o,i,a=r("@opentelemetry/api"),u="process.runtime.name",c="process.runtime.version",s="process.runtime.description",l="service.name",E="telemetry.sdk.name",_="telemetry.sdk.language",T="telemetry.sdk.version",f=((t={})[E]="opentelemetry",t[u]="node",t[_]="nodejs",t[T]="1.30.1",t);function d(){return"unknown_service:"+process.argv0}var p=function(){return(p=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},O=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){var c=[i,u];if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,n=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],n=0}finally{r=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}},y=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},h=function(){function e(e,t){var r,n=this;this._attributes=e,this.asyncAttributesPending=null!=t,this._syncAttributes=null!=(r=this._attributes)?r:{},this._asyncAttributesPromise=null==t?void 0:t.then(function(e){return n._attributes=Object.assign({},n._attributes,e),n.asyncAttributesPending=!1,e},function(e){return a.diag.debug("a resource's async attributes promise rejected: %s",e),n.asyncAttributesPending=!1,{}})}return e.empty=function(){return e.EMPTY},e.default=function(){var t;return new e(((t={})[l]=d(),t[_]=f[_],t[E]=f[E],t[T]=f[T],t))},Object.defineProperty(e.prototype,"attributes",{get:function(){var e;return this.asyncAttributesPending&&a.diag.error("Accessing resource attributes before async attributes settled"),null!=(e=this._attributes)?e:{}},enumerable:!1,configurable:!0}),e.prototype.waitForAsyncAttributes=function(){var e,t,r,n;return e=this,t=void 0,r=void 0,n=function(){return O(this,function(e){switch(e.label){case 0:if(!this.asyncAttributesPending)return[3,2];return[4,this._asyncAttributesPromise];case 1:e.sent(),e.label=2;case 2:return[2]}})},new(r||(r=Promise))(function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function u(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,u)}c((n=n.apply(e,t||[])).next())})},e.prototype.merge=function(t){var r,n=this;if(!t)return this;var o=p(p({},this._syncAttributes),null!=(r=t._syncAttributes)?r:t.attributes);return this._asyncAttributesPromise||t._asyncAttributesPromise?new e(o,Promise.all([this._asyncAttributesPromise,t._asyncAttributesPromise]).then(function(e){var r,o=y(e,2),i=o[0],a=o[1];return p(p(p(p({},n._syncAttributes),i),null!=(r=t._syncAttributes)?r:t.attributes),a)})):new e(o)},e.EMPTY=new e({}),e}(),L=function(){return(L=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},R=new(function(){function e(){}return e.prototype.detect=function(e){if("undefined"==typeof navigator||(null==(n=null==(r=global.process)?void 0:r.versions)?void 0:n.node)!==void 0||(null==(o=global.Bun)?void 0:o.version)!==void 0)return h.empty();var t,r,n,o,i=((t={})[u]="browser",t[s]="Web Browser",t[c]=navigator.userAgent,t);return this._getResourceAttributes(i,e)},e.prototype._getResourceAttributes=function(e,t){return""===e[c]?(a.diag.debug("BrowserDetector failed: Unable to find required browser resources. "),h.empty()):new h(L({},e))},e}()),b=new(function(){function e(){}return e.prototype.detect=function(e){return Promise.resolve(R.detect(e))},e}());(e=o||(o={})).AlwaysOff="always_off",e.AlwaysOn="always_on",e.ParentBasedAlwaysOff="parentbased_always_off",e.ParentBasedAlwaysOn="parentbased_always_on",e.ParentBasedTraceIdRatio="parentbased_traceidratio",e.TraceIdRatio="traceidratio";var v=["OTEL_SDK_DISABLED"],P=["OTEL_BSP_EXPORT_TIMEOUT","OTEL_BSP_MAX_EXPORT_BATCH_SIZE","OTEL_BSP_MAX_QUEUE_SIZE","OTEL_BSP_SCHEDULE_DELAY","OTEL_BLRP_EXPORT_TIMEOUT","OTEL_BLRP_MAX_EXPORT_BATCH_SIZE","OTEL_BLRP_MAX_QUEUE_SIZE","OTEL_BLRP_SCHEDULE_DELAY","OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_EVENT_COUNT_LIMIT","OTEL_SPAN_LINK_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT","OTEL_EXPORTER_OTLP_TIMEOUT","OTEL_EXPORTER_OTLP_TRACES_TIMEOUT","OTEL_EXPORTER_OTLP_METRICS_TIMEOUT","OTEL_EXPORTER_OTLP_LOGS_TIMEOUT","OTEL_EXPORTER_JAEGER_AGENT_PORT"],A=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS","OTEL_SEMCONV_STABILITY_OPT_IN"],m=1/0,I={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:"",ECS_CONTAINER_METADATA_URI_V4:"",ECS_CONTAINER_METADATA_URI:"",HOSTNAME:"",KUBERNETES_SERVICE_HOST:"",NAMESPACE:"",OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:"",OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:"",OTEL_EXPORTER_JAEGER_PASSWORD:"",OTEL_EXPORTER_JAEGER_USER:"",OTEL_EXPORTER_OTLP_ENDPOINT:"",OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:"",OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:"",OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:"",OTEL_EXPORTER_OTLP_HEADERS:"",OTEL_EXPORTER_OTLP_TRACES_HEADERS:"",OTEL_EXPORTER_OTLP_METRICS_HEADERS:"",OTEL_EXPORTER_OTLP_LOGS_HEADERS:"",OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:"http://localhost:9411/api/v2/spans",OTEL_LOG_LEVEL:a.DiagLogLevel.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:["tracecontext","baggage"],OTEL_RESOURCE_ATTRIBUTES:"",OTEL_SERVICE_NAME:"",OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:m,OTEL_ATTRIBUTE_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:m,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:128,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:m,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:128,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:128,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:o.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:"",OTEL_LOGS_EXPORTER:"",OTEL_EXPORTER_OTLP_INSECURE:"",OTEL_EXPORTER_OTLP_TRACES_INSECURE:"",OTEL_EXPORTER_OTLP_METRICS_INSECURE:"",OTEL_EXPORTER_OTLP_LOGS_INSECURE:"",OTEL_EXPORTER_OTLP_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_COMPRESSION:"",OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:"",OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:"",OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:"",OTEL_EXPORTER_OTLP_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:"cumulative",OTEL_SEMCONV_STABILITY_OPT_IN:[]},S={ALL:a.DiagLogLevel.ALL,VERBOSE:a.DiagLogLevel.VERBOSE,DEBUG:a.DiagLogLevel.DEBUG,INFO:a.DiagLogLevel.INFO,WARN:a.DiagLogLevel.WARN,ERROR:a.DiagLogLevel.ERROR,NONE:a.DiagLogLevel.NONE},g=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},w=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},C=new(function(){function e(){this._MAX_LENGTH=255,this._COMMA_SEPARATOR=",",this._LABEL_KEY_VALUE_SPLITTER="=",this._ERROR_MESSAGE_INVALID_CHARS="should be a ASCII string with a length greater than 0 and not exceed "+this._MAX_LENGTH+" characters.",this._ERROR_MESSAGE_INVALID_VALUE="should be a ASCII string with a length not exceed "+this._MAX_LENGTH+" characters."}return e.prototype.detect=function(e){var t,r={},n=(t=function(e){var t={};for(var r in I)if("OTEL_LOG_LEVEL"===r)!function(e,t,r){var n=r[e];if("string"==typeof n){var o=S[n.toUpperCase()];null!=o&&(t[e]=o)}}(r,t,e);else if(v.indexOf(r)>-1)!function(e,t,r){if(void 0!==r[e]){var n=String(r[e]);t[e]="true"===n.toLowerCase()}}(r,t,e);else if(P.indexOf(r)>-1)!function(e,t,r,n,o){if(void 0===n&&(n=-1/0),void 0===o&&(o=1/0),void 0!==r[e]){var i=Number(r[e]);isNaN(i)||(i<n?t[e]=n:i>o?t[e]=o:t[e]=i)}}(r,t,e);else if(A.indexOf(r)>-1)!function(e,t,r,n){void 0===n&&(n=",");var o=r[e];"string"==typeof o&&(t[e]=o.split(n).map(function(e){return e.trim()}))}(r,t,e);else{var n=e[r];null!=n&&(t[r]=String(n))}return t}(process.env),Object.assign({},I,t)),o=n.OTEL_RESOURCE_ATTRIBUTES,i=n.OTEL_SERVICE_NAME;if(o)try{var u=this._parseResourceAttributes(o);Object.assign(r,u)}catch(e){a.diag.debug("EnvDetector failed: "+e.message)}return i&&(r[l]=i),new h(r)},e.prototype._parseResourceAttributes=function(e){if(!e)return{};var t,r,n={},o=e.split(this._COMMA_SEPARATOR,-1);try{for(var i=g(o),a=i.next();!a.done;a=i.next()){var u=a.value.split(this._LABEL_KEY_VALUE_SPLITTER,-1);if(2===u.length){var c=w(u,2),s=c[0],l=c[1];if(s=s.trim(),l=l.trim().split(/^"|"$/).join(""),!this._isValidAndNotEmpty(s))throw Error("Attribute key "+this._ERROR_MESSAGE_INVALID_CHARS);if(!this._isValid(l))throw Error("Attribute value "+this._ERROR_MESSAGE_INVALID_VALUE);n[s]=decodeURIComponent(l)}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return n},e.prototype._isValid=function(e){return e.length<=this._MAX_LENGTH&&this._isBaggageOctetString(e)},e.prototype._isBaggageOctetString=function(e){for(var t=0;t<e.length;t++){var r=e.charCodeAt(t);if(r<33||44===r||59===r||92===r||r>126)return!1}return!0},e.prototype._isValidAndNotEmpty=function(e){return e.length>0&&this._isValid(e)},e}()),N=new(function(){function e(){}return e.prototype.detect=function(e){return Promise.resolve(C.detect(e))},e}());let M=require("os");var U=function(e){switch(e){case"arm":return"arm32";case"ppc":return"ppc32";case"x64":return"amd64";default:return e}},x=function(e){switch(e){case"sunos":return"solaris";case"win32":return"windows";default:return e}};switch(r("process").platform){case"darwin":i=r("./@opentelemetry/resources/build/esm/detectors/platform/node/machine-id/getMachineId-darwin.js").D;break;case"linux":i=r("./@opentelemetry/resources/build/esm/detectors/platform/node/machine-id/getMachineId-linux.js").D;break;case"freebsd":i=r("./@opentelemetry/resources/build/esm/detectors/platform/node/machine-id/getMachineId-bsd.js").D;break;case"win32":i=r("./@opentelemetry/resources/build/esm/detectors/platform/node/machine-id/getMachineId-win.js").D;break;default:i=r("./@opentelemetry/resources/build/esm/detectors/platform/node/machine-id/getMachineId-unsupported.js").D}var D=new(function(){function e(){}return e.prototype.detect=function(e){var t;return new h(((t={})["host.name"]=(0,M.hostname)(),t["host.arch"]=U((0,M.arch)()),t),this._getAsyncAttributes())},e.prototype._getAsyncAttributes=function(){return i().then(function(e){var t={};return e&&(t["host.id"]=e),t})},e}()),X=new(function(){function e(){}return e.prototype.detect=function(e){return Promise.resolve(D.detect(e))},e}()),B=new(function(){function e(){}return e.prototype.detect=function(e){var t;return new h(((t={})["os.type"]=x((0,M.platform)()),t["os.version"]=(0,M.release)(),t))},e}()),G=new(function(){function e(){}return e.prototype.detect=function(e){return Promise.resolve(B.detect(e))},e}()),k=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},j=function(e,t,r){if(r||2==arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))},V=new(function(){function e(){}return e.prototype.detect=function(e){var t,r=((t={})["process.pid"]=process.pid,t["process.executable.name"]=process.title,t["process.executable.path"]=process.execPath,t["process.command_args"]=j(j([process.argv[0]],k(process.execArgv),!1),k(process.argv.slice(1)),!1),t[c]=process.versions.node,t[u]="nodejs",t[s]="Node.js",t);process.argv.length>1&&(r["process.command"]=process.argv[1]);try{var n=M.userInfo();r["process.owner"]=n.username}catch(e){a.diag.debug("error obtaining process owner: "+e)}return new h(r)},e}()),H=new(function(){function e(){}return e.prototype.detect=function(e){return Promise.resolve(V.detect(e))},e}());let F=require("crypto");var Y=new(function(){function e(){}return e.prototype.detect=function(e){var t;return new h(((t={})["service.instance.id"]=(0,F.randomUUID)(),t))},e}()),K=function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function u(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,u)}c((n=n.apply(e,t||[])).next())})},q=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){var c=[i,u];if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,n=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],n=0}finally{r=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}},Z=function(e){return void 0===e&&(e={}),K(void 0,void 0,void 0,function(){var t;return q(this,function(r){switch(r.label){case 0:return[4,Promise.all((e.detectors||[]).map(function(t){return K(void 0,void 0,void 0,function(){var r,n;return q(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,t.detect(e)];case 1:return r=o.sent(),a.diag.debug(t.constructor.name+" found resource.",r),[2,r];case 2:return n=o.sent(),a.diag.debug(t.constructor.name+" failed: "+n.message),[2,h.empty()];case 3:return[2]}})})}))];case 1:return W(t=r.sent()),[2,t.reduce(function(e,t){return e.merge(t)},h.empty())]}})})},J=function(e){void 0===e&&(e={});var t,r=(null!=(t=e.detectors)?t:[]).map(function(t){try{var r,n=t.detect(e);return(r=null!==n&&"object"==typeof n&&"function"==typeof n.then?new h({},K(void 0,void 0,void 0,function(){var e,t;return q(this,function(r){switch(r.label){case 0:return[4,n];case 1:return e=r.sent(),[4,null==(t=e.waitForAsyncAttributes)?void 0:t.call(e)];case 2:return r.sent(),[2,e.attributes]}})})):n).waitForAsyncAttributes?r.waitForAsyncAttributes().then(function(){return a.diag.debug(t.constructor.name+" found resource.",r)}):a.diag.debug(t.constructor.name+" found resource.",r),r}catch(e){return a.diag.error(t.constructor.name+" failed: "+e.message),h.empty()}}),n=r.reduce(function(e,t){return e.merge(t)},h.empty());return n.waitForAsyncAttributes&&n.waitForAsyncAttributes().then(function(){W(r)}),n},W=function(e){e.forEach(function(e){if(Object.keys(e.attributes).length>0){var t=JSON.stringify(e.attributes,null,4);a.diag.verbose(t)}})}})(),module.exports=n})();