@vercel/otel 1.10.0 → 1.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,5 +13,5 @@ var lu=Object.create;var Cr=Object.defineProperty;var fu=Object.getOwnPropertyDe
13
13
  To resolve the conflict:`,yn(a,e))),i=c):f.diag.warn("A view or instrument with the name ",e.name,` has already been registered and is incompatible with another registered view.
14
14
  `,`Details:
15
15
  `,gn(a,e),`To resolve the conflict:
16
- `,yn(a,e))}}catch(l){n={error:l}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}return i},t}();var ma=function(){function t(e){this._backingStorages=e}return t.prototype.record=function(e,r,n,o){this._backingStorages.forEach(function(i){i.record(e,r,n,o)})},t}();E();E();var Ta=function(){function t(e,r){this._instrumentName=e,this._valueType=r,this._buffer=new Q}return t.prototype.observe=function(e,r){if(r===void 0&&(r={}),typeof e!="number"){f.diag.warn("non-number value provided to metric "+this._instrumentName+": "+e);return}this._valueType===f.ValueType.INT&&!Number.isInteger(e)&&(f.diag.warn("INT value type cannot accept a floating-point value for "+this._instrumentName+", ignoring the fractional digits."),e=Math.trunc(e),!Number.isInteger(e))||this._buffer.set(r,e)},t}();var Sa=function(){function t(){this._buffer=new Map}return t.prototype.observe=function(e,r,n){if(n===void 0&&(n={}),!!lt(e)){var o=this._buffer.get(e);if(o==null&&(o=new Q,this._buffer.set(e,o)),typeof r!="number"){f.diag.warn("non-number value provided to metric "+e._descriptor.name+": "+r);return}e._descriptor.valueType===f.ValueType.INT&&!Number.isInteger(r)&&(f.diag.warn("INT value type cannot accept a floating-point value for "+e._descriptor.name+", ignoring the fractional digits."),r=Math.trunc(r),!Number.isInteger(r))||o.set(n,r)}},t}();var An=function(t,e,r,n){function o(i){return i instanceof r?i:new r(function(s){s(i)})}return new(r||(r=Promise))(function(i,s){function u(l){try{a(n.next(l))}catch(p){s(p)}}function c(l){try{a(n.throw(l))}catch(p){s(p)}}function a(l){l.done?i(l.value):o(l.value).then(u,c)}a((n=n.apply(t,e||[])).next())})},On=function(t,e){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,s;return s={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(a){return function(l){return c([a,l])}}function c(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=a[0]&2?o.return:a[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,a[1])).done)return i;switch(o=0,i&&(a=[a[0]&2,i.value]),a[0]){case 0:case 1:i=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,o=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){r.label=a[1];break}if(a[0]===6&&r.label<i[1]){r.label=i[1],i=a;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(a);break}i[2]&&r.ops.pop(),r.trys.pop();continue}a=e.call(t,r)}catch(l){a=[6,l],o=0}finally{n=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},ga=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,i=[],s;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(u){s={error:u}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return i},ya=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,i;n<o;n++)(i||!(n in e))&&(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))},va=function(){function t(){this._callbacks=[],this._batchCallbacks=[]}return t.prototype.addCallback=function(e,r){var n=this._findCallback(e,r);n>=0||this._callbacks.push({callback:e,instrument:r})},t.prototype.removeCallback=function(e,r){var n=this._findCallback(e,r);n<0||this._callbacks.splice(n,1)},t.prototype.addBatchCallback=function(e,r){var n=new Set(r.filter(lt));if(n.size===0){f.diag.error("BatchObservableCallback is not associated with valid instruments",r);return}var o=this._findBatchCallback(e,n);o>=0||this._batchCallbacks.push({callback:e,instruments:n})},t.prototype.removeBatchCallback=function(e,r){var n=new Set(r.filter(lt)),o=this._findBatchCallback(e,n);o<0||this._batchCallbacks.splice(o,1)},t.prototype.observe=function(e,r){return An(this,void 0,void 0,function(){var n,o,i,s;return On(this,function(u){switch(u.label){case 0:return n=this._observeCallbacks(e,r),o=this._observeBatchCallbacks(e,r),[4,Zo(ya(ya([],ga(n),!1),ga(o),!1))];case 1:return i=u.sent(),s=i.filter(Jo).map(function(c){return c.reason}),[2,s]}})})},t.prototype._observeCallbacks=function(e,r){var n=this;return this._callbacks.map(function(o){var i=o.callback,s=o.instrument;return An(n,void 0,void 0,function(){var u,c;return On(this,function(a){switch(a.label){case 0:return u=new Ta(s._descriptor.name,s._descriptor.valueType),c=Promise.resolve(i(u)),r!=null&&(c=mn(c,r)),[4,c];case 1:return a.sent(),s._metricStorages.forEach(function(l){l.record(u._buffer,e)}),[2]}})})})},t.prototype._observeBatchCallbacks=function(e,r){var n=this;return this._batchCallbacks.map(function(o){var i=o.callback,s=o.instruments;return An(n,void 0,void 0,function(){var u,c;return On(this,function(a){switch(a.label){case 0:return u=new Sa,c=Promise.resolve(i(u)),r!=null&&(c=mn(c,r)),[4,c];case 1:return a.sent(),s.forEach(function(l){var p=u._buffer.get(l);p!=null&&l._metricStorages.forEach(function(d){d.record(p,e)})}),[2]}})})})},t.prototype._findCallback=function(e,r){return this._callbacks.findIndex(function(n){return n.callback===e&&n.instrument===r})},t.prototype._findBatchCallback=function(e,r){return this._batchCallbacks.findIndex(function(n){return n.callback===e&&ea(n.instruments,r)})},t}();var Yl=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Aa=function(t){Yl(e,t);function e(r,n,o,i){var s=t.call(this,r)||this;return s._attributesProcessor=o,s._deltaMetricStorage=new lr(n),s._temporalMetricStorage=new fr(n,i),s}return e.prototype.record=function(r,n,o,i){n=this._attributesProcessor.process(n,o),this._deltaMetricStorage.record(r,n,o,i)},e.prototype.collect=function(r,n){var o=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(r,this._instrumentDescriptor,o,n)},e}(cr);var Oa=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),pr=function(){function t(){}return t.Noop=function(){return $l},t}();var zl=function(t){Oa(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.process=function(r,n){return r},e}(pr);var bh=function(t){Oa(e,t);function e(r){var n=t.call(this)||this;return n._allowedAttributeNames=r,n}return e.prototype.process=function(r,n){var o=this,i={};return Object.keys(r).filter(function(s){return o._allowedAttributeNames.includes(s)}).forEach(function(s){return i[s]=r[s]}),i},e}(pr);var $l=new zl;var Ql=function(t,e,r,n){function o(i){return i instanceof r?i:new r(function(s){s(i)})}return new(r||(r=Promise))(function(i,s){function u(l){try{a(n.next(l))}catch(p){s(p)}}function c(l){try{a(n.throw(l))}catch(p){s(p)}}function a(l){l.done?i(l.value):o(l.value).then(u,c)}a((n=n.apply(t,e||[])).next())})},Zl=function(t,e){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,s;return s={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(a){return function(l){return c([a,l])}}function c(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=a[0]&2?o.return:a[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,a[1])).done)return i;switch(o=0,i&&(a=[a[0]&2,i.value]),a[0]){case 0:case 1:i=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,o=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){r.label=a[1];break}if(a[0]===6&&r.label<i[1]){r.label=i[1],i=a;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(a);break}i[2]&&r.ops.pop(),r.trys.pop();continue}a=e.call(t,r)}catch(l){a=[6,l],o=0}finally{n=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},Jl=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,i=[],s;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(u){s={error:u}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return i},Ra=function(){function t(e,r){this._meterProviderSharedState=e,this._instrumentationScope=r,this.metricStorageRegistry=new Ea,this.observableRegistry=new va,this.meter=new pa(this)}return t.prototype.registerMetricStorage=function(e){var r=this._registerMetricStorage(e,Aa);return r.length===1?r[0]:new ma(r)},t.prototype.registerAsyncMetricStorage=function(e){var r=this._registerMetricStorage(e,ha);return r},t.prototype.collect=function(e,r,n){return Ql(this,void 0,void 0,function(){var o,i,s;return Zl(this,function(u){switch(u.label){case 0:return[4,this.observableRegistry.observe(r,n?.timeoutMillis)];case 1:return o=u.sent(),i=this.metricStorageRegistry.getStorages(e),i.length===0?[2,null]:(s=i.map(function(c){return c.collect(e,r)}).filter(zo),s.length===0?[2,{errors:o}]:[2,{scopeMetrics:{scope:this._instrumentationScope,metrics:s},errors:o}])}})})},t.prototype._registerMetricStorage=function(e,r){var n=this,o=this._meterProviderSharedState.viewRegistry.findViews(e,this._instrumentationScope),i=o.map(function(c){var a=ra(c,e),l=n.metricStorageRegistry.findOrUpdateCompatibleStorage(a);if(l!=null)return l;var p=c.aggregation.createAggregator(a),d=new r(a,p,c.attributesProcessor,n._meterProviderSharedState.metricCollectors);return n.metricStorageRegistry.register(d),d});if(i.length===0){var s=this._meterProviderSharedState.selectAggregations(e.type),u=s.map(function(c){var a=Jl(c,2),l=a[0],p=a[1],d=n.metricStorageRegistry.findOrUpdateCompatibleCollectorStorage(l,e);if(d!=null)return d;var g=p.createAggregator(e),U=new r(e,g,pr.Noop(),[l]);return n.metricStorageRegistry.registerForCollector(l,U),U});i=i.concat(u)}return i},t}();var ef=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ba=function(){function t(e){this.resource=e,this.viewRegistry=new ia,this.metricCollectors=[],this.meterSharedStates=new Map}return t.prototype.getMeterSharedState=function(e){var r=Qo(e),n=this.meterSharedStates.get(r);return n==null&&(n=new Ra(this,e),this.meterSharedStates.set(r,n)),n},t.prototype.selectAggregations=function(e){var r,n,o=[];try{for(var i=ef(this.metricCollectors),s=i.next();!s.done;s=i.next()){var u=s.value;o.push([u,u.selectAggregation(e)])}}catch(c){r={error:c}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return o},t}();var La=y(C()),_r=function(t,e,r,n){function o(i){return i instanceof r?i:new r(function(s){s(i)})}return new(r||(r=Promise))(function(i,s){function u(l){try{a(n.next(l))}catch(p){s(p)}}function c(l){try{a(n.throw(l))}catch(p){s(p)}}function a(l){l.done?i(l.value):o(l.value).then(u,c)}a((n=n.apply(t,e||[])).next())})},dr=function(t,e){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,s;return s={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(a){return function(l){return c([a,l])}}function c(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=a[0]&2?o.return:a[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,a[1])).done)return i;switch(o=0,i&&(a=[a[0]&2,i.value]),a[0]){case 0:case 1:i=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,o=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){r.label=a[1];break}if(a[0]===6&&r.label<i[1]){r.label=i[1],i=a;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(a);break}i[2]&&r.ops.pop(),r.trys.pop();continue}a=e.call(t,r)}catch(l){a=[6,l],o=0}finally{n=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},tf=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,i=[],s;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(u){s={error:u}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return i},rf=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,i;n<o;n++)(i||!(n in e))&&(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))},Pa=function(){function t(e,r){this._sharedState=e,this._metricReader=r}return t.prototype.collect=function(e){return _r(this,void 0,void 0,function(){var r,n,o,i,s=this;return dr(this,function(u){switch(u.label){case 0:return r=(0,La.millisToHrTime)(Date.now()),n=[],o=[],i=Array.from(this._sharedState.meterSharedStates.values()).map(function(c){return _r(s,void 0,void 0,function(){var a;return dr(this,function(l){switch(l.label){case 0:return[4,c.collect(this,r,e)];case 1:return a=l.sent(),a?.scopeMetrics!=null&&n.push(a.scopeMetrics),a?.errors!=null&&o.push.apply(o,rf([],tf(a.errors),!1)),[2]}})})}),[4,Promise.all(i)];case 1:return u.sent(),[2,{resourceMetrics:{resource:this._sharedState.resource,scopeMetrics:n},errors:o}]}})})},t.prototype.forceFlush=function(e){return _r(this,void 0,void 0,function(){return dr(this,function(r){switch(r.label){case 0:return[4,this._metricReader.forceFlush(e)];case 1:return r.sent(),[2]}})})},t.prototype.shutdown=function(e){return _r(this,void 0,void 0,function(){return dr(this,function(r){switch(r.label){case 0:return[4,this._metricReader.shutdown(e)];case 1:return r.sent(),[2]}})})},t.prototype.selectAggregationTemporality=function(e){return this._metricReader.selectAggregationTemporality(e)},t.prototype.selectAggregation=function(e){return this._metricReader.selectAggregation(e)},t}();var Ia=function(t,e,r,n){function o(i){return i instanceof r?i:new r(function(s){s(i)})}return new(r||(r=Promise))(function(i,s){function u(l){try{a(n.next(l))}catch(p){s(p)}}function c(l){try{a(n.throw(l))}catch(p){s(p)}}function a(l){l.done?i(l.value):o(l.value).then(u,c)}a((n=n.apply(t,e||[])).next())})},Ca=function(t,e){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,s;return s={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(a){return function(l){return c([a,l])}}function c(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=a[0]&2?o.return:a[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,a[1])).done)return i;switch(o=0,i&&(a=[a[0]&2,i.value]),a[0]){case 0:case 1:i=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,o=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){r.label=a[1];break}if(a[0]===6&&r.label<i[1]){r.label=i[1],i=a;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(a);break}i[2]&&r.ops.pop(),r.trys.pop();continue}a=e.call(t,r)}catch(l){a=[6,l],o=0}finally{n=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},nf=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Rn=function(){function t(e){var r,n,o;this._shutdown=!1;var i=F.default().merge((o=e?.resource)!==null&&o!==void 0?o:F.empty());if(this._sharedState=new ba(i),e?.views!=null&&e.views.length>0)try{for(var s=nf(e.views),u=s.next();!u.done;u=s.next()){var c=u.value;this._sharedState.viewRegistry.addView(c)}}catch(a){r={error:a}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}}return t.prototype.getMeter=function(e,r,n){return r===void 0&&(r=""),n===void 0&&(n={}),this._shutdown?(f.diag.warn("A shutdown MeterProvider cannot provide a Meter"),(0,f.createNoopMeter)()):this._sharedState.getMeterSharedState({name:e,version:r,schemaUrl:n.schemaUrl}).meter},t.prototype.addMetricReader=function(e){var r=new Pa(this._sharedState,e);e.setMetricProducer(r),this._sharedState.metricCollectors.push(r)},t.prototype.shutdown=function(e){return Ia(this,void 0,void 0,function(){return Ca(this,function(r){switch(r.label){case 0:return this._shutdown?(f.diag.warn("shutdown may only be called once per MeterProvider"),[2]):(this._shutdown=!0,[4,Promise.all(this._sharedState.metricCollectors.map(function(n){return n.shutdown(e)}))]);case 1:return r.sent(),[2]}})})},t.prototype.forceFlush=function(e){return Ia(this,void 0,void 0,function(){return Ca(this,function(r){switch(r.label){case 0:return this._shutdown?(f.diag.warn("invalid attempt to force flush after MeterProvider shutdown"),[2]):[4,Promise.all(this._sharedState.metricCollectors.map(function(n){return n.forceFlush(e)}))];case 1:return r.sent(),[2]}})})},t}();var ni=y(Ee(),1),nt=y(Lt(),1),su=y(xa(),1),Le=y(C(),1);E();var lf=Symbol.for("@vercel/request-context");function $e(){return globalThis[lf]?.get()}var Pn=y(Ee(),1);function mr(t){return Object.fromEntries(Object.entries(t).filter(([e,r])=>r!==void 0))}function Da(t){return t?t.split("::").at(-1):void 0}function Ua(t=$e(),e){if(!t)return;let r=e?pf(e,t.headers):void 0;return mr({[Pn.SemanticAttributes.HTTP_HOST]:t.headers.host,[Pn.SemanticAttributes.HTTP_USER_AGENT]:t.headers["user-agent"],"http.referer":t.headers.referer,"vercel.request_id":Da(t.headers["x-vercel-id"]),"vercel.matched_path":t.headers["x-matched-path"],"vercel.edge_region":t.headers["x-vercel-edge-region"],...r})}var ff={keys(t){return[]},get(t,e){return t[e.toLocaleLowerCase()]}};function pf(t,e){if(typeof t=="function")return t(e,ff);let r={};for(let[n,o]of Object.entries(t)){let i=e[o.toLocaleLowerCase()];i!==void 0&&(r[n]=i)}return r}E();function _t(t){return(t&f.TraceFlags.SAMPLED)!==0}var Tr=class{constructor(e,r){this.processors=e;this.attributesFromHeaders=r;this.rootSpanIds=new Map;this.waitSpanEnd=new Map}forceFlush(){return Promise.all(this.processors.map(e=>e.forceFlush().catch(r=>{f.diag.error("@vercel/otel: forceFlush failed:",r)}))).then(()=>{})}shutdown(){return Promise.all(this.processors.map(e=>e.shutdown().catch(()=>{}))).then(()=>{})}onStart(e,r){let{traceId:n,spanId:o,traceFlags:i}=e.spanContext(),s=!e.parentSpanId||!this.rootSpanIds.has(n);if(s?this.rootSpanIds.set(n,{rootSpanId:o,open:[]}):this.rootSpanIds.get(n)?.open.push(e),s&&_t(i)){let u=$e(),c=Ua(u,this.attributesFromHeaders);c&&e.setAttributes(c),u&&u.waitUntil(async()=>{if(this.rootSpanIds.has(n)){let a=new Promise(p=>{this.waitSpanEnd.set(n,p)}),l;await Promise.race([a,new Promise(p=>{l=setTimeout(()=>{this.waitSpanEnd.delete(n),p(void 0)},50)})]),l&&clearTimeout(l)}return this.forceFlush()})}for(let u of this.processors)u.onStart(e,r)}onEnd(e){let{traceId:r,spanId:n,traceFlags:o}=e.spanContext(),i=_t(o),s=this.rootSpanIds.get(r),u=s?.rootSpanId===n;if(i){let c=df(e);c&&Object.assign(e.attributes,c)}if(u){if(this.rootSpanIds.delete(r),s.open.length>0){for(let c of s.open)if(!c.ended&&c.spanContext().spanId!==n)try{c.end()}catch(a){f.diag.error("@vercel/otel: onEnd failed:",a)}}}else if(s)for(let c=0;c<s.open.length;c++)s.open[c]?.spanContext().spanId===n&&s.open.splice(c,1);for(let c of this.processors)c.onEnd(e);if(u){let c=this.waitSpanEnd.get(r);c&&(this.waitSpanEnd.delete(r),c())}}},_f={[f.SpanKind.INTERNAL]:"internal",[f.SpanKind.SERVER]:"server",[f.SpanKind.CLIENT]:"client",[f.SpanKind.PRODUCER]:"producer",[f.SpanKind.CONSUMER]:"consumer"};function df(t){let{kind:e,attributes:r}=t,{"operation.name":n,"resource.name":o,"span.type":i,"next.span_type":s,"http.method":u,"http.route":c}=r;if(n)return;let a=o??(u&&typeof u=="string"&&c&&typeof c=="string"?`${u} ${c}`:c);if(t.kind===f.SpanKind.SERVER&&u&&c&&typeof u=="string"&&typeof c=="string")return{"operation.name":"web.request","resource.name":a};let l=t.instrumentationLibrary.name,p=s??i;if(p&&typeof p=="string"){let d=Ba(l,p);return c?{"operation.name":d,"resource.name":a}:{"operation.name":d}}return{"operation.name":Ba(l,e===f.SpanKind.INTERNAL?"":_f[e])}}function Ba(t,e){if(!t)return e;let r=t.replace(/[ @./]/g,"_");return r.startsWith("_")&&(r=r.slice(1)),e?`${r}.${e}`:r}var Za=y(Dn(),1);var Qa=y($a(),1);E();var Qe=class extends Qa.OTLPExporterBase{constructor(e={}){super(e),e.headers&&(this._headers=e.headers)}onShutdown(){f.diag.debug("@vercel/otel/otlp: onShutdown")}onInit(){f.diag.debug("@vercel/otel/otlp: onInit")}send(e,r,n){if(this._shutdownOnce.isCalled){f.diag.debug("@vercel/otel/otlp: Shutdown already started. Cannot send objects");return}let o=this.convert(e),i,s,u;try{({body:i,contentType:s,headers:u}=this.toMessage(o))}catch(a){f.diag.warn("@vercel/otel/otlp: no proto",a);return}let c=fetch(this.url,{method:"POST",body:i,headers:{...this._headers,...u,"Content-Type":s,"User-Agent":"OTel-OTLP-Exporter-JavaScript/0.46.0"},next:{internal:!0}}).then(a=>{f.diag.debug("@vercel/otel/otlp: onSuccess",a.status,a.statusText),r(),a.arrayBuffer().catch(()=>{})}).catch(a=>{f.diag.error("@vercel/otel/otlp: onError",a),n(a)}).finally(()=>{let a=this._sendingPromises.indexOf(c);this._sendingPromises.splice(a,1)});this._sendingPromises.push(c)}getDefaultUrl(e){throw new Error("Method not implemented.")}};var Df="v1/traces",Uf=`http://localhost:4318/${Df}`;function vr(t){return typeof t.url=="string"?t.url:Uf}var Ze=class{constructor(e={}){this.impl=new Vn(e)}export(e,r){this.impl.export(e,r)}shutdown(){return this.impl.shutdown()}forceFlush(){return this.impl.forceFlush()}},Vn=class extends Qe{convert(e){return(0,Za.createExportTraceServiceRequest)(e,{useHex:!0,useLongBits:!1})}toMessage(e){return{body:JSON.stringify(e),contentType:"application/json"}}getDefaultUrl(e){return vr(e)}};var eu=y(Dn(),1);var Qs=y($s(),1);function Zs(t){let e=new Qs.Writer;return Wf(t,e),e.finish()}function Wf(t,e){if(t.resourceSpans!=null&&t.resourceSpans.length)for(let r=0;r<t.resourceSpans.length;++r)Yf(t.resourceSpans[r],e.uint32(10).fork()).ldelim();return e}function Yf(t,e){if(t.resource!=null&&zf(t.resource,e.uint32(10).fork()).ldelim(),t.scopeSpans!=null&&t.scopeSpans.length)for(let r=0;r<t.scopeSpans.length;++r)$f(t.scopeSpans[r],e.uint32(18).fork()).ldelim();return t.schemaUrl!=null&&e.uint32(26).string(t.schemaUrl),e}function zf(t,e){if(t.attributes!=null&&t.attributes.length)for(let r=0;r<t.attributes.length;++r)et(t.attributes[r],e.uint32(10).fork()).ldelim();return t.droppedAttributesCount!=null&&e.uint32(16).uint32(t.droppedAttributesCount),e}function $f(t,e){if(t.scope!=null&&Jf(t.scope,e.uint32(10).fork()).ldelim(),t.spans!=null&&t.spans.length)for(let r=0;r<t.spans.length;++r)ep(t.spans[r],e.uint32(18).fork()).ldelim();return t.schemaUrl!=null&&e.uint32(26).string(t.schemaUrl),e}function et(t,e){return t.key!=null&&e.uint32(10).string(t.key),t.value!=null&&Js(t.value,e.uint32(18).fork()).ldelim(),e}function Js(t,e){return t.stringValue!=null&&e.uint32(10).string(t.stringValue),t.boolValue!=null&&e.uint32(16).bool(t.boolValue),t.intValue!=null&&e.uint32(24).int64(t.intValue),t.doubleValue!=null&&e.uint32(33).double(t.doubleValue),t.arrayValue!=null&&Qf(t.arrayValue,e.uint32(42).fork()).ldelim(),t.kvlistValue!=null&&Zf(t.kvlistValue,e.uint32(50).fork()).ldelim(),t.bytesValue!=null&&e.uint32(58).bytes(t.bytesValue),e}function Qf(t,e){if(t.values!=null&&t.values.length)for(let r=0;r<t.values.length;++r)Js(t.values[r],e.uint32(10).fork()).ldelim();return e}function Zf(t,e){if(t.values!=null&&t.values.length)for(let r=0;r<t.values.length;++r)et(t.values[r],e.uint32(10).fork()).ldelim();return e}function Jf(t,e){if(t.name!=null&&e.uint32(10).string(t.name),t.version!=null&&e.uint32(18).string(t.version),t.attributes!=null&&t.attributes.length)for(let r=0;r<t.attributes.length;++r)et(t.attributes[r],e.uint32(26).fork()).ldelim();return t.droppedAttributesCount!=null&&e.uint32(32).uint32(t.droppedAttributesCount),e}function ep(t,e){if(t.traceId!=null&&e.uint32(10).bytes(t.traceId),t.spanId!=null&&e.uint32(18).bytes(t.spanId),t.traceState!=null&&e.uint32(26).string(t.traceState),t.parentSpanId!=null&&e.uint32(34).bytes(t.parentSpanId),t.name!=null&&e.uint32(42).string(t.name),t.kind!=null&&e.uint32(48).int32(t.kind),t.startTimeUnixNano!=null&&e.uint32(57).fixed64(t.startTimeUnixNano),t.endTimeUnixNano!=null&&e.uint32(65).fixed64(t.endTimeUnixNano),t.attributes!=null&&t.attributes.length)for(let r=0;r<t.attributes.length;++r)et(t.attributes[r],e.uint32(74).fork()).ldelim();if(t.droppedAttributesCount!=null&&e.uint32(80).uint32(t.droppedAttributesCount),t.events!=null&&t.events.length)for(let r=0;r<t.events.length;++r)rp(t.events[r],e.uint32(90).fork()).ldelim();if(t.droppedEventsCount!=null&&e.uint32(96).uint32(t.droppedEventsCount),t.links!=null&&t.links.length)for(let r=0;r<t.links.length;++r)np(t.links[r],e.uint32(106).fork()).ldelim();return t.droppedLinksCount!=null&&e.uint32(112).uint32(t.droppedLinksCount),t.status!=null&&tp(t.status,e.uint32(122).fork()).ldelim(),e}function tp(t,e){return t.message!=null&&e.uint32(18).string(t.message),t.code!=null&&e.uint32(24).int32(t.code),e}function rp(t,e){if(t.timeUnixNano!=null&&e.uint32(9).fixed64(t.timeUnixNano),t.name!=null&&e.uint32(18).string(t.name),t.attributes!=null&&t.attributes.length)for(let r=0;r<t.attributes.length;++r)et(t.attributes[r],e.uint32(26).fork()).ldelim();return t.droppedAttributesCount!=null&&e.uint32(32).uint32(t.droppedAttributesCount),e}function np(t,e){if(t.traceId!=null&&e.uint32(10).bytes(t.traceId),t.spanId!=null&&e.uint32(18).bytes(t.spanId),t.traceState!=null&&e.uint32(26).string(t.traceState),t.attributes!=null&&t.attributes.length)for(let r=0;r<t.attributes.length;++r)et(t.attributes[r],e.uint32(34).fork()).ldelim();return t.droppedAttributesCount!=null&&e.uint32(40).uint32(t.droppedAttributesCount),e}var Be=class{constructor(e={}){this.impl=new Jn(e)}export(e,r){this.impl.export(e,r)}shutdown(){return this.impl.shutdown()}forceFlush(){return this.impl.forceFlush()}},Jn=class extends Qe{convert(e){return(0,eu.createExportTraceServiceRequest)(e,void 0)}toMessage(e){return{body:Zs(e),contentType:"application/x-protobuf",headers:{accept:"application/x-protobuf"}}}getDefaultUrl(e){return vr(e)}};E();var le=y(Ee(),1);function tu(t,e){return t.replace(/\{(?<temp1>[^{}]+)\}/g,(r,n)=>{let o=e[n];return o!==void 0?String(o):r})}var tt=class{constructor(e={}){this.instrumentationName="@vercel/otel/fetch";this.instrumentationVersion="1.0.0";this.config=e}getConfig(){return this.config}setConfig(){}setTracerProvider(e){this.tracerProvider=e}setMeterProvider(){}enable(){this.disable();let{tracerProvider:e}=this;if(!e)return;let r=e.getTracer(this.instrumentationName,this.instrumentationVersion),n=this.config.ignoreUrls??[],o=(P,B)=>{if(B?.opentelemetry?.ignore!==void 0)return B.opentelemetry.ignore;if(n.length===0)return!1;let A=P.toString();return n.some(m=>typeof m=="string"?m==="*"?!0:A.startsWith(m):m.test(A))},i=process.env.VERCEL_URL||process.env.NEXT_PUBLIC_VERCEL_URL||null,s=process.env.VERCEL_BRANCH_URL||process.env.NEXT_PUBLIC_VERCEL_BRANCH_URL||null,u=this.config.propagateContextUrls??[],c=this.config.dontPropagateContextUrls??[],a=this.config.resourceNameTemplate,{attributesFromRequestHeaders:l,attributesFromResponseHeaders:p}=this.config,d=(P,B)=>{if(B?.opentelemetry?.propagateContext)return B.opentelemetry.propagateContext;let A=P.toString();return c.length>0&&c.some(m=>typeof m=="string"?m==="*"?!0:A.startsWith(m):m.test(A))?!1:i&&P.protocol==="https:"&&(P.host===i||P.host===s||P.host===$e()?.headers.host)||!i&&P.protocol==="http:"&&P.hostname==="localhost"?!0:u.some(m=>typeof m=="string"?m==="*"?!0:A.startsWith(m):m.test(A))};process.env.NEXT_OTEL_FETCH_DISABLED="1";let g=globalThis.fetch;this.originalFetch=g;let U=async(P,B)=>{let A=B;if(A?.next?.internal)return g(P,A);let m=new Request(P instanceof Request?P.clone():P,A),ne=new URL(m.url);if(o(ne,A))return g(P,A);let St={[le.SemanticAttributes.HTTP_METHOD]:m.method,[le.SemanticAttributes.HTTP_URL]:m.url,[le.SemanticAttributes.HTTP_HOST]:ne.host,[le.SemanticAttributes.HTTP_SCHEME]:ne.protocol.replace(":",""),[le.SemanticAttributes.NET_PEER_NAME]:ne.hostname,[le.SemanticAttributes.NET_PEER_PORT]:ne.port},Pr=a?tu(a,St):op(m.url),gt=A?.opentelemetry?.spanName??`fetch ${m.method} ${m.url}`,ii=f.context.active(),x=r.startSpan(gt,{kind:f.SpanKind.CLIENT,attributes:{...St,"operation.name":`fetch.${m.method}`,"resource.name":Pr,...A?.opentelemetry?.attributes}},ii);if(!x.isRecording()||!_t(x.spanContext().traceFlags))return x.end(),g(P,A);if(d(ne,A)){let Ge=f.trace.setSpan(ii,x);f.propagation.inject(Ge,m.headers,ip)}l&&ru(x,l,m.headers);try{let Ge=Date.now(),fe=await g(P,{...A,headers:m.headers}),cu=Date.now()-Ge;return x.setAttribute(le.SemanticAttributes.HTTP_STATUS_CODE,fe.status),x.setAttribute("http.response_time",cu),p&&ru(x,p,fe.headers),fe.status>=500&&ei(x,`Status: ${fe.status} (${fe.statusText})`),fe.body?ap(fe).then(Ir=>{x.isRecording()&&(x.setAttribute(le.SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED,Ir),x.end())},Ir=>{x.isRecording()&&(ei(x,Ir),x.end())}):x.end(),fe}catch(Ge){throw ei(x,Ge),x.end(),Ge}};globalThis.fetch=U}disable(){this.originalFetch&&(globalThis.fetch=this.originalFetch)}},ip={set(t,e,r){t.set(e,r)}};function op(t){let e=t.indexOf("?");return e===-1?t:t.substring(0,e)}function ap(t){let e=0,n=t.clone().body?.getReader();if(!n)return Promise.resolve(0);let o=()=>n.read().then(({done:i,value:s})=>{if(!i)return e+=s.byteLength,o()});return o().then(()=>e)}function ei(t,e){if(e instanceof Error)t.recordException(e),t.setStatus({code:f.SpanStatusCode.ERROR,message:e.message});else{let r=String(e);t.setStatus({code:f.SpanStatusCode.ERROR,message:r})}}function ru(t,e,r){for(let[n,o]of Object.entries(e)){let i=r.get(o);i!==null&&t.setAttribute(n,i)}}E();var nu=y(C(),1),sp="00",ti="traceparent",ri="tracestate",Tt=class{fields(){return[ti,ri]}inject(e,r,n){let o=f.trace.getSpanContext(e);if(!o||(0,nu.isTracingSuppressed)(e)||!(0,f.isSpanContextValid)(o))return;let i=`${sp}-${o.traceId}-${o.spanId}-0${Number(o.traceFlags||0).toString(16)}`;n.set(r,ti,i),o.traceState&&n.set(r,ri,o.traceState.serialize())}extract(e,r,n){let o=n.get(r,ti);if(!o)return e;let i=Array.isArray(o)?o[0]:o;if(typeof i!="string")return e;let s=up(i);if(!s)return e;s.isRemote=!0;let u=n.get(r,ri);if(u){let c=Array.isArray(u)?u.join(","):u;s.traceState=(0,f.createTraceState)(typeof c=="string"?c:void 0)}return f.trace.setSpanContext(e,s)}};function up(t){let[e,r,n,o,i]=t.split("-");return!e||!r||!n||!o||e.length!==2||r.length!==32||n.length!==16||o.length!==2||e==="00"&&i?null:{traceId:r,spanId:n,traceFlags:parseInt(o,16)}}var Lr=class{constructor(e={}){this.configuration=e}start(){let e=cp(),r=(0,nt.getEnvWithoutDefaults)(),n=this.configuration,o=process.env.NEXT_RUNTIME||"nodejs",i=!!e.OTEL_SDK_DISABLED;if(r.OTEL_LOG_LEVEL&&f.diag.setLogger(new f.DiagConsoleLogger,{logLevel:r.OTEL_LOG_LEVEL}),i)return;let s=n.idGenerator??new rr,u=n.contextManager??new su.AsyncLocalStorageContextManager;u.enable(),this.contextManager=u;let c=e.OTEL_SERVICE_NAME||n.serviceName||"app",a=new F(mr({[ni.SemanticResourceAttributes.SERVICE_NAME]:c,"node.ci":process.env.CI?!0:void 0,"node.env":"production",env:process.env.VERCEL_ENV||process.env.NEXT_PUBLIC_VERCEL_ENV,"vercel.region":process.env.VERCEL_REGION,"vercel.runtime":o,"vercel.sha":process.env.VERCEL_GIT_COMMIT_SHA||process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA,"vercel.host":process.env.VERCEL_URL||process.env.NEXT_PUBLIC_VERCEL_URL||void 0,"vercel.branch_host":process.env.VERCEL_BRANCH_URL||process.env.NEXT_PUBLIC_VERCEL_BRANCH_URL||void 0,"vercel.deployment_id":process.env.VERCEL_DEPLOYMENT_ID||void 0,[ni.SemanticResourceAttributes.SERVICE_VERSION]:process.env.VERCEL_DEPLOYMENT_ID,...n.attributes})),l=n.resourceDetectors??[bo];if(n.autoDetectResources??!0){let m={detectors:l};a=a.merge(Po(m))}let d=fp(n.propagators,e),g=pp(n.traceSampler,e),U=_p(n.spanProcessors,n,e);U.length===0&&f.diag.warn("@vercel/otel: No span processors configured. No spans will be exported.");let P=n.spanLimits,B=new wo({resource:a,idGenerator:s,sampler:g,spanLimits:P});if(B.addSpanProcessor(new Tr(U,n.attributesFromHeaders)),B.register({contextManager:u,propagator:new Le.CompositePropagator({propagators:d})}),this.tracerProvider=B,n.logRecordProcessor){let m=new En({resource:a});this.loggerProvider=m,m.addLogRecordProcessor(n.logRecordProcessor),ae.logs.setGlobalLoggerProvider(m)}if(n.metricReader||n.views){let m=new Rn({resource:a,views:n.views??[]});n.metricReader&&m.addMetricReader(n.metricReader),f.metrics.setGlobalMeterProvider(m),this.meterProvider=m}let A=lp(n.instrumentations,n.instrumentationConfig);this.disableInstrumentations=(0,au.registerInstrumentations)({instrumentations:A}),f.diag.info("@vercel/otel: started",c,o)}async shutdown(){let e=[];this.tracerProvider&&e.push(this.tracerProvider.shutdown()),this.loggerProvider&&e.push(this.loggerProvider.shutdown()),this.meterProvider&&e.push(this.meterProvider.shutdown()),f.diag.info("@vercel/otel: shutting down",e.length,process.env.NEXT_RUNTIME),await Promise.all(e),this.contextManager&&this.contextManager.disable();let{disableInstrumentations:r}=this;r&&r()}};function cp(){let t=(0,nt.parseEnvironment)(process.env);return{...nt.DEFAULT_ENVIRONMENT,...t}}function lp(t,e){return(t??["auto"]).map(r=>r==="auto"?(f.diag.debug("@vercel/otel: Configure instrumentations: fetch",e?.fetch),[new tt(e?.fetch)]):r==="fetch"?(f.diag.debug("@vercel/otel: Configure instrumentations: fetch",e?.fetch),new tt(e?.fetch)):r).flat()}function fp(t,e){let r=e.OTEL_PROPAGATORS&&e.OTEL_PROPAGATORS.length>0?e.OTEL_PROPAGATORS:void 0;return(t??r??["auto"]).map(n=>{if(n==="none")return[];if(n==="auto")return f.diag.debug("@vercel/otel: Configure propagators: tracecontext, baggage"),[new Tt,new Le.W3CBaggagePropagator];if(n==="tracecontext")return f.diag.debug("@vercel/otel: Configure propagator: tracecontext"),new Tt;if(n==="baggage")return f.diag.debug("@vercel/otel: Configure propagator: baggage"),new Le.W3CBaggagePropagator;if(typeof n=="string")throw new Error(`Unknown propagator: "${n}"`);return n}).flat()}var iu="always_on",rt=1;function pp(t,e){if(t&&typeof t!="string")return t;let r=t&&t!=="auto"?t:e.OTEL_TRACES_SAMPLER||iu;switch(f.diag.debug("@vercel/otel: Configure sampler: ",r),r){case"always_on":return new X;case"always_off":return new oe;case"parentbased_always_on":return new Te({root:new X});case"parentbased_always_off":return new Te({root:new oe});case"traceidratio":return new ke(ou(e));case"parentbased_traceidratio":return new Te({root:new ke(ou(e))});default:return f.diag.error(`@vercel/otel: OTEL_TRACES_SAMPLER value "${String(e.OTEL_TRACES_SAMPLER)} invalid, defaulting to ${iu}".`),new X}}function ou(t){if(t.OTEL_TRACES_SAMPLER_ARG===void 0||t.OTEL_TRACES_SAMPLER_ARG==="")return f.diag.error(`@vercel/otel: OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${rt}.`),rt;f.diag.debug("@vercel/otel: Configure sampler probability: ",t.OTEL_TRACES_SAMPLER_ARG);let e=Number(t.OTEL_TRACES_SAMPLER_ARG);return isNaN(e)?(f.diag.error(`@vercel/otel: OTEL_TRACES_SAMPLER_ARG=${t.OTEL_TRACES_SAMPLER_ARG} was given, but it is invalid, defaulting to ${rt}.`),rt):e<0||e>1?(f.diag.error(`@vercel/otel: OTEL_TRACES_SAMPLER_ARG=${t.OTEL_TRACES_SAMPLER_ARG} was given, but it is out of range ([0..1]), defaulting to ${rt}.`),rt):e}function _p(t,e,r){return[...(t??["auto"]).map(n=>{if(n==="auto"){if(process.env.VERCEL_OTEL_ENDPOINTS){let o=process.env.VERCEL_OTEL_ENDPOINTS_PORT||"4318",i=process.env.VERCEL_OTEL_ENDPOINTS_PROTOCOL||"http/protobuf";f.diag.debug("@vercel/otel: Configure vercel otel collector on port: ",o,i);let s={url:`http://localhost:${o}/v1/traces`,headers:{}},u=i==="http/protobuf"?new Be(s):new Ze(s);return new Ke(u)}return!e.traceExporter||e.traceExporter==="auto"||r.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT||r.OTEL_EXPORTER_OTLP_ENDPOINT?new Ke(dp(r)):void 0}return n}).filter(mp),...e.traceExporter&&e.traceExporter!=="auto"?[new Ke(e.traceExporter)]:[]]}function dp(t){let e=process.env.OTEL_EXPORTER_OTLP_TRACES_PROTOCOL??process.env.OTEL_EXPORTER_OTLP_PROTOCOL??"http/protobuf",r=Ep(t),n={...Le.baggageUtils.parseKeyPairsIntoRecord(t.OTEL_EXPORTER_OTLP_HEADERS),...Le.baggageUtils.parseKeyPairsIntoRecord(t.OTEL_EXPORTER_OTLP_TRACES_HEADERS)};switch(f.diag.debug("@vercel/otel: Configure trace exporter: ",e,r,`headers: ${Object.keys(n).join(",")||"<none>"}`),e){case"http/json":return new Ze({url:r,headers:n});case"http/protobuf":return new Be({url:r,headers:n});default:return f.diag.warn(`@vercel/otel: Unsupported OTLP traces protocol: ${e}. Using http/protobuf.`),new Be}}var uu="v1/traces",hp=`http://localhost:4318/${uu}`;function Ep(t){let e=t.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT;if(e&&typeof e=="string")return e;let r=t.OTEL_EXPORTER_OTLP_ENDPOINT;return r&&typeof r=="string"?`${r}/${uu}`:hp}function mp(t){return t!=null}function mm(t){let e;t?typeof t=="string"?e={serviceName:t}:e=t:e={},new Lr(e).start()}export{tt as FetchInstrumentation,Ze as OTLPHttpJsonTraceExporter,Be as OTLPHttpProtoTraceExporter,mm as registerOTel};
16
+ `,yn(a,e))}}catch(l){n={error:l}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}return i},t}();var ma=function(){function t(e){this._backingStorages=e}return t.prototype.record=function(e,r,n,o){this._backingStorages.forEach(function(i){i.record(e,r,n,o)})},t}();E();E();var Ta=function(){function t(e,r){this._instrumentName=e,this._valueType=r,this._buffer=new Q}return t.prototype.observe=function(e,r){if(r===void 0&&(r={}),typeof e!="number"){f.diag.warn("non-number value provided to metric "+this._instrumentName+": "+e);return}this._valueType===f.ValueType.INT&&!Number.isInteger(e)&&(f.diag.warn("INT value type cannot accept a floating-point value for "+this._instrumentName+", ignoring the fractional digits."),e=Math.trunc(e),!Number.isInteger(e))||this._buffer.set(r,e)},t}();var Sa=function(){function t(){this._buffer=new Map}return t.prototype.observe=function(e,r,n){if(n===void 0&&(n={}),!!lt(e)){var o=this._buffer.get(e);if(o==null&&(o=new Q,this._buffer.set(e,o)),typeof r!="number"){f.diag.warn("non-number value provided to metric "+e._descriptor.name+": "+r);return}e._descriptor.valueType===f.ValueType.INT&&!Number.isInteger(r)&&(f.diag.warn("INT value type cannot accept a floating-point value for "+e._descriptor.name+", ignoring the fractional digits."),r=Math.trunc(r),!Number.isInteger(r))||o.set(n,r)}},t}();var An=function(t,e,r,n){function o(i){return i instanceof r?i:new r(function(s){s(i)})}return new(r||(r=Promise))(function(i,s){function u(l){try{a(n.next(l))}catch(p){s(p)}}function c(l){try{a(n.throw(l))}catch(p){s(p)}}function a(l){l.done?i(l.value):o(l.value).then(u,c)}a((n=n.apply(t,e||[])).next())})},On=function(t,e){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,s;return s={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(a){return function(l){return c([a,l])}}function c(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=a[0]&2?o.return:a[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,a[1])).done)return i;switch(o=0,i&&(a=[a[0]&2,i.value]),a[0]){case 0:case 1:i=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,o=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){r.label=a[1];break}if(a[0]===6&&r.label<i[1]){r.label=i[1],i=a;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(a);break}i[2]&&r.ops.pop(),r.trys.pop();continue}a=e.call(t,r)}catch(l){a=[6,l],o=0}finally{n=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},ga=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,i=[],s;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(u){s={error:u}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return i},ya=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,i;n<o;n++)(i||!(n in e))&&(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))},va=function(){function t(){this._callbacks=[],this._batchCallbacks=[]}return t.prototype.addCallback=function(e,r){var n=this._findCallback(e,r);n>=0||this._callbacks.push({callback:e,instrument:r})},t.prototype.removeCallback=function(e,r){var n=this._findCallback(e,r);n<0||this._callbacks.splice(n,1)},t.prototype.addBatchCallback=function(e,r){var n=new Set(r.filter(lt));if(n.size===0){f.diag.error("BatchObservableCallback is not associated with valid instruments",r);return}var o=this._findBatchCallback(e,n);o>=0||this._batchCallbacks.push({callback:e,instruments:n})},t.prototype.removeBatchCallback=function(e,r){var n=new Set(r.filter(lt)),o=this._findBatchCallback(e,n);o<0||this._batchCallbacks.splice(o,1)},t.prototype.observe=function(e,r){return An(this,void 0,void 0,function(){var n,o,i,s;return On(this,function(u){switch(u.label){case 0:return n=this._observeCallbacks(e,r),o=this._observeBatchCallbacks(e,r),[4,Zo(ya(ya([],ga(n),!1),ga(o),!1))];case 1:return i=u.sent(),s=i.filter(Jo).map(function(c){return c.reason}),[2,s]}})})},t.prototype._observeCallbacks=function(e,r){var n=this;return this._callbacks.map(function(o){var i=o.callback,s=o.instrument;return An(n,void 0,void 0,function(){var u,c;return On(this,function(a){switch(a.label){case 0:return u=new Ta(s._descriptor.name,s._descriptor.valueType),c=Promise.resolve(i(u)),r!=null&&(c=mn(c,r)),[4,c];case 1:return a.sent(),s._metricStorages.forEach(function(l){l.record(u._buffer,e)}),[2]}})})})},t.prototype._observeBatchCallbacks=function(e,r){var n=this;return this._batchCallbacks.map(function(o){var i=o.callback,s=o.instruments;return An(n,void 0,void 0,function(){var u,c;return On(this,function(a){switch(a.label){case 0:return u=new Sa,c=Promise.resolve(i(u)),r!=null&&(c=mn(c,r)),[4,c];case 1:return a.sent(),s.forEach(function(l){var p=u._buffer.get(l);p!=null&&l._metricStorages.forEach(function(d){d.record(p,e)})}),[2]}})})})},t.prototype._findCallback=function(e,r){return this._callbacks.findIndex(function(n){return n.callback===e&&n.instrument===r})},t.prototype._findBatchCallback=function(e,r){return this._batchCallbacks.findIndex(function(n){return n.callback===e&&ea(n.instruments,r)})},t}();var Yl=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Aa=function(t){Yl(e,t);function e(r,n,o,i){var s=t.call(this,r)||this;return s._attributesProcessor=o,s._deltaMetricStorage=new lr(n),s._temporalMetricStorage=new fr(n,i),s}return e.prototype.record=function(r,n,o,i){n=this._attributesProcessor.process(n,o),this._deltaMetricStorage.record(r,n,o,i)},e.prototype.collect=function(r,n){var o=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(r,this._instrumentDescriptor,o,n)},e}(cr);var Oa=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),pr=function(){function t(){}return t.Noop=function(){return $l},t}();var zl=function(t){Oa(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.process=function(r,n){return r},e}(pr);var bh=function(t){Oa(e,t);function e(r){var n=t.call(this)||this;return n._allowedAttributeNames=r,n}return e.prototype.process=function(r,n){var o=this,i={};return Object.keys(r).filter(function(s){return o._allowedAttributeNames.includes(s)}).forEach(function(s){return i[s]=r[s]}),i},e}(pr);var $l=new zl;var Ql=function(t,e,r,n){function o(i){return i instanceof r?i:new r(function(s){s(i)})}return new(r||(r=Promise))(function(i,s){function u(l){try{a(n.next(l))}catch(p){s(p)}}function c(l){try{a(n.throw(l))}catch(p){s(p)}}function a(l){l.done?i(l.value):o(l.value).then(u,c)}a((n=n.apply(t,e||[])).next())})},Zl=function(t,e){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,s;return s={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(a){return function(l){return c([a,l])}}function c(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=a[0]&2?o.return:a[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,a[1])).done)return i;switch(o=0,i&&(a=[a[0]&2,i.value]),a[0]){case 0:case 1:i=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,o=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){r.label=a[1];break}if(a[0]===6&&r.label<i[1]){r.label=i[1],i=a;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(a);break}i[2]&&r.ops.pop(),r.trys.pop();continue}a=e.call(t,r)}catch(l){a=[6,l],o=0}finally{n=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},Jl=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,i=[],s;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(u){s={error:u}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return i},Ra=function(){function t(e,r){this._meterProviderSharedState=e,this._instrumentationScope=r,this.metricStorageRegistry=new Ea,this.observableRegistry=new va,this.meter=new pa(this)}return t.prototype.registerMetricStorage=function(e){var r=this._registerMetricStorage(e,Aa);return r.length===1?r[0]:new ma(r)},t.prototype.registerAsyncMetricStorage=function(e){var r=this._registerMetricStorage(e,ha);return r},t.prototype.collect=function(e,r,n){return Ql(this,void 0,void 0,function(){var o,i,s;return Zl(this,function(u){switch(u.label){case 0:return[4,this.observableRegistry.observe(r,n?.timeoutMillis)];case 1:return o=u.sent(),i=this.metricStorageRegistry.getStorages(e),i.length===0?[2,null]:(s=i.map(function(c){return c.collect(e,r)}).filter(zo),s.length===0?[2,{errors:o}]:[2,{scopeMetrics:{scope:this._instrumentationScope,metrics:s},errors:o}])}})})},t.prototype._registerMetricStorage=function(e,r){var n=this,o=this._meterProviderSharedState.viewRegistry.findViews(e,this._instrumentationScope),i=o.map(function(c){var a=ra(c,e),l=n.metricStorageRegistry.findOrUpdateCompatibleStorage(a);if(l!=null)return l;var p=c.aggregation.createAggregator(a),d=new r(a,p,c.attributesProcessor,n._meterProviderSharedState.metricCollectors);return n.metricStorageRegistry.register(d),d});if(i.length===0){var s=this._meterProviderSharedState.selectAggregations(e.type),u=s.map(function(c){var a=Jl(c,2),l=a[0],p=a[1],d=n.metricStorageRegistry.findOrUpdateCompatibleCollectorStorage(l,e);if(d!=null)return d;var g=p.createAggregator(e),U=new r(e,g,pr.Noop(),[l]);return n.metricStorageRegistry.registerForCollector(l,U),U});i=i.concat(u)}return i},t}();var ef=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ba=function(){function t(e){this.resource=e,this.viewRegistry=new ia,this.metricCollectors=[],this.meterSharedStates=new Map}return t.prototype.getMeterSharedState=function(e){var r=Qo(e),n=this.meterSharedStates.get(r);return n==null&&(n=new Ra(this,e),this.meterSharedStates.set(r,n)),n},t.prototype.selectAggregations=function(e){var r,n,o=[];try{for(var i=ef(this.metricCollectors),s=i.next();!s.done;s=i.next()){var u=s.value;o.push([u,u.selectAggregation(e)])}}catch(c){r={error:c}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return o},t}();var La=y(C()),_r=function(t,e,r,n){function o(i){return i instanceof r?i:new r(function(s){s(i)})}return new(r||(r=Promise))(function(i,s){function u(l){try{a(n.next(l))}catch(p){s(p)}}function c(l){try{a(n.throw(l))}catch(p){s(p)}}function a(l){l.done?i(l.value):o(l.value).then(u,c)}a((n=n.apply(t,e||[])).next())})},dr=function(t,e){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,s;return s={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(a){return function(l){return c([a,l])}}function c(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=a[0]&2?o.return:a[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,a[1])).done)return i;switch(o=0,i&&(a=[a[0]&2,i.value]),a[0]){case 0:case 1:i=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,o=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){r.label=a[1];break}if(a[0]===6&&r.label<i[1]){r.label=i[1],i=a;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(a);break}i[2]&&r.ops.pop(),r.trys.pop();continue}a=e.call(t,r)}catch(l){a=[6,l],o=0}finally{n=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},tf=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,i=[],s;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(u){s={error:u}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return i},rf=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,i;n<o;n++)(i||!(n in e))&&(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))},Pa=function(){function t(e,r){this._sharedState=e,this._metricReader=r}return t.prototype.collect=function(e){return _r(this,void 0,void 0,function(){var r,n,o,i,s=this;return dr(this,function(u){switch(u.label){case 0:return r=(0,La.millisToHrTime)(Date.now()),n=[],o=[],i=Array.from(this._sharedState.meterSharedStates.values()).map(function(c){return _r(s,void 0,void 0,function(){var a;return dr(this,function(l){switch(l.label){case 0:return[4,c.collect(this,r,e)];case 1:return a=l.sent(),a?.scopeMetrics!=null&&n.push(a.scopeMetrics),a?.errors!=null&&o.push.apply(o,rf([],tf(a.errors),!1)),[2]}})})}),[4,Promise.all(i)];case 1:return u.sent(),[2,{resourceMetrics:{resource:this._sharedState.resource,scopeMetrics:n},errors:o}]}})})},t.prototype.forceFlush=function(e){return _r(this,void 0,void 0,function(){return dr(this,function(r){switch(r.label){case 0:return[4,this._metricReader.forceFlush(e)];case 1:return r.sent(),[2]}})})},t.prototype.shutdown=function(e){return _r(this,void 0,void 0,function(){return dr(this,function(r){switch(r.label){case 0:return[4,this._metricReader.shutdown(e)];case 1:return r.sent(),[2]}})})},t.prototype.selectAggregationTemporality=function(e){return this._metricReader.selectAggregationTemporality(e)},t.prototype.selectAggregation=function(e){return this._metricReader.selectAggregation(e)},t}();var Ia=function(t,e,r,n){function o(i){return i instanceof r?i:new r(function(s){s(i)})}return new(r||(r=Promise))(function(i,s){function u(l){try{a(n.next(l))}catch(p){s(p)}}function c(l){try{a(n.throw(l))}catch(p){s(p)}}function a(l){l.done?i(l.value):o(l.value).then(u,c)}a((n=n.apply(t,e||[])).next())})},Ca=function(t,e){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,s;return s={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(a){return function(l){return c([a,l])}}function c(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=a[0]&2?o.return:a[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,a[1])).done)return i;switch(o=0,i&&(a=[a[0]&2,i.value]),a[0]){case 0:case 1:i=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,o=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){r.label=a[1];break}if(a[0]===6&&r.label<i[1]){r.label=i[1],i=a;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(a);break}i[2]&&r.ops.pop(),r.trys.pop();continue}a=e.call(t,r)}catch(l){a=[6,l],o=0}finally{n=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},nf=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Rn=function(){function t(e){var r,n,o;this._shutdown=!1;var i=F.default().merge((o=e?.resource)!==null&&o!==void 0?o:F.empty());if(this._sharedState=new ba(i),e?.views!=null&&e.views.length>0)try{for(var s=nf(e.views),u=s.next();!u.done;u=s.next()){var c=u.value;this._sharedState.viewRegistry.addView(c)}}catch(a){r={error:a}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}}return t.prototype.getMeter=function(e,r,n){return r===void 0&&(r=""),n===void 0&&(n={}),this._shutdown?(f.diag.warn("A shutdown MeterProvider cannot provide a Meter"),(0,f.createNoopMeter)()):this._sharedState.getMeterSharedState({name:e,version:r,schemaUrl:n.schemaUrl}).meter},t.prototype.addMetricReader=function(e){var r=new Pa(this._sharedState,e);e.setMetricProducer(r),this._sharedState.metricCollectors.push(r)},t.prototype.shutdown=function(e){return Ia(this,void 0,void 0,function(){return Ca(this,function(r){switch(r.label){case 0:return this._shutdown?(f.diag.warn("shutdown may only be called once per MeterProvider"),[2]):(this._shutdown=!0,[4,Promise.all(this._sharedState.metricCollectors.map(function(n){return n.shutdown(e)}))]);case 1:return r.sent(),[2]}})})},t.prototype.forceFlush=function(e){return Ia(this,void 0,void 0,function(){return Ca(this,function(r){switch(r.label){case 0:return this._shutdown?(f.diag.warn("invalid attempt to force flush after MeterProvider shutdown"),[2]):[4,Promise.all(this._sharedState.metricCollectors.map(function(n){return n.forceFlush(e)}))];case 1:return r.sent(),[2]}})})},t}();var ni=y(Ee(),1),nt=y(Lt(),1),su=y(xa(),1),Le=y(C(),1);E();var lf=Symbol.for("@vercel/request-context");function $e(){return globalThis[lf]?.get()}var Pn=y(Ee(),1);function mr(t){return Object.fromEntries(Object.entries(t).filter(([e,r])=>r!==void 0))}function Da(t){return t?t.split("::").at(-1):void 0}function Ua(t=$e(),e){if(!t)return;let r=e?pf(e,t.headers):void 0;return mr({[Pn.SemanticAttributes.HTTP_HOST]:t.headers.host,[Pn.SemanticAttributes.HTTP_USER_AGENT]:t.headers["user-agent"],"http.referer":t.headers.referer,"vercel.request_id":Da(t.headers["x-vercel-id"]),"vercel.matched_path":t.headers["x-matched-path"],"vercel.edge_region":process.env.VERCEL_REGION,...r})}var ff={keys(t){return[]},get(t,e){return t[e.toLocaleLowerCase()]}};function pf(t,e){if(typeof t=="function")return t(e,ff);let r={};for(let[n,o]of Object.entries(t)){let i=e[o.toLocaleLowerCase()];i!==void 0&&(r[n]=i)}return r}E();function _t(t){return(t&f.TraceFlags.SAMPLED)!==0}var Tr=class{constructor(e,r){this.processors=e;this.attributesFromHeaders=r;this.rootSpanIds=new Map;this.waitSpanEnd=new Map}forceFlush(){return Promise.all(this.processors.map(e=>e.forceFlush().catch(r=>{f.diag.error("@vercel/otel: forceFlush failed:",r)}))).then(()=>{})}shutdown(){return Promise.all(this.processors.map(e=>e.shutdown().catch(()=>{}))).then(()=>{})}onStart(e,r){let{traceId:n,spanId:o,traceFlags:i}=e.spanContext(),s=!e.parentSpanId||!this.rootSpanIds.has(n);if(s?this.rootSpanIds.set(n,{rootSpanId:o,open:[]}):this.rootSpanIds.get(n)?.open.push(e),s&&_t(i)){let u=$e(),c=Ua(u,this.attributesFromHeaders);c&&e.setAttributes(c),u&&u.waitUntil(async()=>{if(this.rootSpanIds.has(n)){let a=new Promise(p=>{this.waitSpanEnd.set(n,p)}),l;await Promise.race([a,new Promise(p=>{l=setTimeout(()=>{this.waitSpanEnd.delete(n),p(void 0)},50)})]),l&&clearTimeout(l)}return this.forceFlush()})}for(let u of this.processors)u.onStart(e,r)}onEnd(e){let{traceId:r,spanId:n,traceFlags:o}=e.spanContext(),i=_t(o),s=this.rootSpanIds.get(r),u=s?.rootSpanId===n;if(i){let c=df(e);c&&Object.assign(e.attributes,c)}if(u){if(this.rootSpanIds.delete(r),s.open.length>0){for(let c of s.open)if(!c.ended&&c.spanContext().spanId!==n)try{c.end()}catch(a){f.diag.error("@vercel/otel: onEnd failed:",a)}}}else if(s)for(let c=0;c<s.open.length;c++)s.open[c]?.spanContext().spanId===n&&s.open.splice(c,1);for(let c of this.processors)c.onEnd(e);if(u){let c=this.waitSpanEnd.get(r);c&&(this.waitSpanEnd.delete(r),c())}}},_f={[f.SpanKind.INTERNAL]:"internal",[f.SpanKind.SERVER]:"server",[f.SpanKind.CLIENT]:"client",[f.SpanKind.PRODUCER]:"producer",[f.SpanKind.CONSUMER]:"consumer"};function df(t){let{kind:e,attributes:r}=t,{"operation.name":n,"resource.name":o,"span.type":i,"next.span_type":s,"http.method":u,"http.route":c}=r;if(n)return;let a=o??(u&&typeof u=="string"&&c&&typeof c=="string"?`${u} ${c}`:c);if(t.kind===f.SpanKind.SERVER&&u&&c&&typeof u=="string"&&typeof c=="string")return{"operation.name":"web.request","resource.name":a};let l=t.instrumentationLibrary.name,p=s??i;if(p&&typeof p=="string"){let d=Ba(l,p);return c?{"operation.name":d,"resource.name":a}:{"operation.name":d}}return{"operation.name":Ba(l,e===f.SpanKind.INTERNAL?"":_f[e])}}function Ba(t,e){if(!t)return e;let r=t.replace(/[ @./]/g,"_");return r.startsWith("_")&&(r=r.slice(1)),e?`${r}.${e}`:r}var Za=y(Dn(),1);var Qa=y($a(),1);E();var Qe=class extends Qa.OTLPExporterBase{constructor(e={}){super(e),e.headers&&(this._headers=e.headers)}onShutdown(){f.diag.debug("@vercel/otel/otlp: onShutdown")}onInit(){f.diag.debug("@vercel/otel/otlp: onInit")}send(e,r,n){if(this._shutdownOnce.isCalled){f.diag.debug("@vercel/otel/otlp: Shutdown already started. Cannot send objects");return}let o=this.convert(e),i,s,u;try{({body:i,contentType:s,headers:u}=this.toMessage(o))}catch(a){f.diag.warn("@vercel/otel/otlp: no proto",a);return}let c=fetch(this.url,{method:"POST",body:i,headers:{...this._headers,...u,"Content-Type":s,"User-Agent":"OTel-OTLP-Exporter-JavaScript/0.46.0"},next:{internal:!0}}).then(a=>{f.diag.debug("@vercel/otel/otlp: onSuccess",a.status,a.statusText),r(),a.arrayBuffer().catch(()=>{})}).catch(a=>{f.diag.error("@vercel/otel/otlp: onError",a),n(a)}).finally(()=>{let a=this._sendingPromises.indexOf(c);this._sendingPromises.splice(a,1)});this._sendingPromises.push(c)}getDefaultUrl(e){throw new Error("Method not implemented.")}};var Df="v1/traces",Uf=`http://localhost:4318/${Df}`;function vr(t){return typeof t.url=="string"?t.url:Uf}var Ze=class{constructor(e={}){this.impl=new Vn(e)}export(e,r){this.impl.export(e,r)}shutdown(){return this.impl.shutdown()}forceFlush(){return this.impl.forceFlush()}},Vn=class extends Qe{convert(e){return(0,Za.createExportTraceServiceRequest)(e,{useHex:!0,useLongBits:!1})}toMessage(e){return{body:JSON.stringify(e),contentType:"application/json"}}getDefaultUrl(e){return vr(e)}};var eu=y(Dn(),1);var Qs=y($s(),1);function Zs(t){let e=new Qs.Writer;return Wf(t,e),e.finish()}function Wf(t,e){if(t.resourceSpans!=null&&t.resourceSpans.length)for(let r=0;r<t.resourceSpans.length;++r)Yf(t.resourceSpans[r],e.uint32(10).fork()).ldelim();return e}function Yf(t,e){if(t.resource!=null&&zf(t.resource,e.uint32(10).fork()).ldelim(),t.scopeSpans!=null&&t.scopeSpans.length)for(let r=0;r<t.scopeSpans.length;++r)$f(t.scopeSpans[r],e.uint32(18).fork()).ldelim();return t.schemaUrl!=null&&e.uint32(26).string(t.schemaUrl),e}function zf(t,e){if(t.attributes!=null&&t.attributes.length)for(let r=0;r<t.attributes.length;++r)et(t.attributes[r],e.uint32(10).fork()).ldelim();return t.droppedAttributesCount!=null&&e.uint32(16).uint32(t.droppedAttributesCount),e}function $f(t,e){if(t.scope!=null&&Jf(t.scope,e.uint32(10).fork()).ldelim(),t.spans!=null&&t.spans.length)for(let r=0;r<t.spans.length;++r)ep(t.spans[r],e.uint32(18).fork()).ldelim();return t.schemaUrl!=null&&e.uint32(26).string(t.schemaUrl),e}function et(t,e){return t.key!=null&&e.uint32(10).string(t.key),t.value!=null&&Js(t.value,e.uint32(18).fork()).ldelim(),e}function Js(t,e){return t.stringValue!=null&&e.uint32(10).string(t.stringValue),t.boolValue!=null&&e.uint32(16).bool(t.boolValue),t.intValue!=null&&e.uint32(24).int64(t.intValue),t.doubleValue!=null&&e.uint32(33).double(t.doubleValue),t.arrayValue!=null&&Qf(t.arrayValue,e.uint32(42).fork()).ldelim(),t.kvlistValue!=null&&Zf(t.kvlistValue,e.uint32(50).fork()).ldelim(),t.bytesValue!=null&&e.uint32(58).bytes(t.bytesValue),e}function Qf(t,e){if(t.values!=null&&t.values.length)for(let r=0;r<t.values.length;++r)Js(t.values[r],e.uint32(10).fork()).ldelim();return e}function Zf(t,e){if(t.values!=null&&t.values.length)for(let r=0;r<t.values.length;++r)et(t.values[r],e.uint32(10).fork()).ldelim();return e}function Jf(t,e){if(t.name!=null&&e.uint32(10).string(t.name),t.version!=null&&e.uint32(18).string(t.version),t.attributes!=null&&t.attributes.length)for(let r=0;r<t.attributes.length;++r)et(t.attributes[r],e.uint32(26).fork()).ldelim();return t.droppedAttributesCount!=null&&e.uint32(32).uint32(t.droppedAttributesCount),e}function ep(t,e){if(t.traceId!=null&&e.uint32(10).bytes(t.traceId),t.spanId!=null&&e.uint32(18).bytes(t.spanId),t.traceState!=null&&e.uint32(26).string(t.traceState),t.parentSpanId!=null&&e.uint32(34).bytes(t.parentSpanId),t.name!=null&&e.uint32(42).string(t.name),t.kind!=null&&e.uint32(48).int32(t.kind),t.startTimeUnixNano!=null&&e.uint32(57).fixed64(t.startTimeUnixNano),t.endTimeUnixNano!=null&&e.uint32(65).fixed64(t.endTimeUnixNano),t.attributes!=null&&t.attributes.length)for(let r=0;r<t.attributes.length;++r)et(t.attributes[r],e.uint32(74).fork()).ldelim();if(t.droppedAttributesCount!=null&&e.uint32(80).uint32(t.droppedAttributesCount),t.events!=null&&t.events.length)for(let r=0;r<t.events.length;++r)rp(t.events[r],e.uint32(90).fork()).ldelim();if(t.droppedEventsCount!=null&&e.uint32(96).uint32(t.droppedEventsCount),t.links!=null&&t.links.length)for(let r=0;r<t.links.length;++r)np(t.links[r],e.uint32(106).fork()).ldelim();return t.droppedLinksCount!=null&&e.uint32(112).uint32(t.droppedLinksCount),t.status!=null&&tp(t.status,e.uint32(122).fork()).ldelim(),e}function tp(t,e){return t.message!=null&&e.uint32(18).string(t.message),t.code!=null&&e.uint32(24).int32(t.code),e}function rp(t,e){if(t.timeUnixNano!=null&&e.uint32(9).fixed64(t.timeUnixNano),t.name!=null&&e.uint32(18).string(t.name),t.attributes!=null&&t.attributes.length)for(let r=0;r<t.attributes.length;++r)et(t.attributes[r],e.uint32(26).fork()).ldelim();return t.droppedAttributesCount!=null&&e.uint32(32).uint32(t.droppedAttributesCount),e}function np(t,e){if(t.traceId!=null&&e.uint32(10).bytes(t.traceId),t.spanId!=null&&e.uint32(18).bytes(t.spanId),t.traceState!=null&&e.uint32(26).string(t.traceState),t.attributes!=null&&t.attributes.length)for(let r=0;r<t.attributes.length;++r)et(t.attributes[r],e.uint32(34).fork()).ldelim();return t.droppedAttributesCount!=null&&e.uint32(40).uint32(t.droppedAttributesCount),e}var Be=class{constructor(e={}){this.impl=new Jn(e)}export(e,r){this.impl.export(e,r)}shutdown(){return this.impl.shutdown()}forceFlush(){return this.impl.forceFlush()}},Jn=class extends Qe{convert(e){return(0,eu.createExportTraceServiceRequest)(e,void 0)}toMessage(e){return{body:Zs(e),contentType:"application/x-protobuf",headers:{accept:"application/x-protobuf"}}}getDefaultUrl(e){return vr(e)}};E();var le=y(Ee(),1);function tu(t,e){return t.replace(/\{(?<temp1>[^{}]+)\}/g,(r,n)=>{let o=e[n];return o!==void 0?String(o):r})}var tt=class{constructor(e={}){this.instrumentationName="@vercel/otel/fetch";this.instrumentationVersion="1.0.0";this.config=e}getConfig(){return this.config}setConfig(){}setTracerProvider(e){this.tracerProvider=e}setMeterProvider(){}enable(){this.disable();let{tracerProvider:e}=this;if(!e)return;let r=e.getTracer(this.instrumentationName,this.instrumentationVersion),n=this.config.ignoreUrls??[],o=(P,B)=>{if(B?.opentelemetry?.ignore!==void 0)return B.opentelemetry.ignore;if(n.length===0)return!1;let A=P.toString();return n.some(m=>typeof m=="string"?m==="*"?!0:A.startsWith(m):m.test(A))},i=process.env.VERCEL_URL||process.env.NEXT_PUBLIC_VERCEL_URL||null,s=process.env.VERCEL_BRANCH_URL||process.env.NEXT_PUBLIC_VERCEL_BRANCH_URL||null,u=this.config.propagateContextUrls??[],c=this.config.dontPropagateContextUrls??[],a=this.config.resourceNameTemplate,{attributesFromRequestHeaders:l,attributesFromResponseHeaders:p}=this.config,d=(P,B)=>{if(B?.opentelemetry?.propagateContext)return B.opentelemetry.propagateContext;let A=P.toString();return c.length>0&&c.some(m=>typeof m=="string"?m==="*"?!0:A.startsWith(m):m.test(A))?!1:i&&P.protocol==="https:"&&(P.host===i||P.host===s||P.host===$e()?.headers.host)||!i&&P.protocol==="http:"&&P.hostname==="localhost"?!0:u.some(m=>typeof m=="string"?m==="*"?!0:A.startsWith(m):m.test(A))};process.env.NEXT_OTEL_FETCH_DISABLED="1";let g=globalThis.fetch;this.originalFetch=g;let U=async(P,B)=>{let A=B;if(A?.next?.internal)return g(P,A);let m=new Request(P instanceof Request?P.clone():P,A),ne=new URL(m.url);if(o(ne,A))return g(P,A);let St={[le.SemanticAttributes.HTTP_METHOD]:m.method,[le.SemanticAttributes.HTTP_URL]:m.url,[le.SemanticAttributes.HTTP_HOST]:ne.host,[le.SemanticAttributes.HTTP_SCHEME]:ne.protocol.replace(":",""),[le.SemanticAttributes.NET_PEER_NAME]:ne.hostname,[le.SemanticAttributes.NET_PEER_PORT]:ne.port},Pr=a?tu(a,St):op(m.url),gt=A?.opentelemetry?.spanName??`fetch ${m.method} ${m.url}`,ii=f.context.active(),x=r.startSpan(gt,{kind:f.SpanKind.CLIENT,attributes:{...St,"operation.name":`fetch.${m.method}`,"resource.name":Pr,...A?.opentelemetry?.attributes}},ii);if(!x.isRecording()||!_t(x.spanContext().traceFlags))return x.end(),g(P,A);if(d(ne,A)){let Ge=f.trace.setSpan(ii,x);f.propagation.inject(Ge,m.headers,ip)}l&&ru(x,l,m.headers);try{let Ge=Date.now();A?.body&&A.body instanceof FormData&&m.headers.delete("content-type");let fe=await g(P,{...A,headers:m.headers}),cu=Date.now()-Ge;return x.setAttribute(le.SemanticAttributes.HTTP_STATUS_CODE,fe.status),x.setAttribute("http.response_time",cu),p&&ru(x,p,fe.headers),fe.status>=500&&ei(x,`Status: ${fe.status} (${fe.statusText})`),fe.body?ap(fe).then(Ir=>{x.isRecording()&&(x.setAttribute(le.SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED,Ir),x.end())},Ir=>{x.isRecording()&&(ei(x,Ir),x.end())}):x.end(),fe}catch(Ge){throw ei(x,Ge),x.end(),Ge}};globalThis.fetch=U}disable(){this.originalFetch&&(globalThis.fetch=this.originalFetch)}},ip={set(t,e,r){t.set(e,r)}};function op(t){let e=t.indexOf("?");return e===-1?t:t.substring(0,e)}function ap(t){let e=0,n=t.clone().body?.getReader();if(!n)return Promise.resolve(0);let o=()=>n.read().then(({done:i,value:s})=>{if(!i)return e+=s.byteLength,o()});return o().then(()=>e)}function ei(t,e){if(e instanceof Error)t.recordException(e),t.setStatus({code:f.SpanStatusCode.ERROR,message:e.message});else{let r=String(e);t.setStatus({code:f.SpanStatusCode.ERROR,message:r})}}function ru(t,e,r){for(let[n,o]of Object.entries(e)){let i=r.get(o);i!==null&&t.setAttribute(n,i)}}E();var nu=y(C(),1),sp="00",ti="traceparent",ri="tracestate",Tt=class{fields(){return[ti,ri]}inject(e,r,n){let o=f.trace.getSpanContext(e);if(!o||(0,nu.isTracingSuppressed)(e)||!(0,f.isSpanContextValid)(o))return;let i=`${sp}-${o.traceId}-${o.spanId}-0${Number(o.traceFlags||0).toString(16)}`;n.set(r,ti,i),o.traceState&&n.set(r,ri,o.traceState.serialize())}extract(e,r,n){let o=n.get(r,ti);if(!o)return e;let i=Array.isArray(o)?o[0]:o;if(typeof i!="string")return e;let s=up(i);if(!s)return e;s.isRemote=!0;let u=n.get(r,ri);if(u){let c=Array.isArray(u)?u.join(","):u;s.traceState=(0,f.createTraceState)(typeof c=="string"?c:void 0)}return f.trace.setSpanContext(e,s)}};function up(t){let[e,r,n,o,i]=t.split("-");return!e||!r||!n||!o||e.length!==2||r.length!==32||n.length!==16||o.length!==2||e==="00"&&i?null:{traceId:r,spanId:n,traceFlags:parseInt(o,16)}}var Lr=class{constructor(e={}){this.configuration=e}start(){let e=cp(),r=(0,nt.getEnvWithoutDefaults)(),n=this.configuration,o=process.env.NEXT_RUNTIME||"nodejs",i=!!e.OTEL_SDK_DISABLED;if(r.OTEL_LOG_LEVEL&&f.diag.setLogger(new f.DiagConsoleLogger,{logLevel:r.OTEL_LOG_LEVEL}),i)return;let s=n.idGenerator??new rr,u=n.contextManager??new su.AsyncLocalStorageContextManager;u.enable(),this.contextManager=u;let c=e.OTEL_SERVICE_NAME||n.serviceName||"app",a=new F(mr({[ni.SemanticResourceAttributes.SERVICE_NAME]:c,"node.ci":process.env.CI?!0:void 0,"node.env":"production",env:process.env.VERCEL_ENV||process.env.NEXT_PUBLIC_VERCEL_ENV,"vercel.region":process.env.VERCEL_REGION,"vercel.runtime":o,"vercel.sha":process.env.VERCEL_GIT_COMMIT_SHA||process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA,"vercel.host":process.env.VERCEL_URL||process.env.NEXT_PUBLIC_VERCEL_URL||void 0,"vercel.branch_host":process.env.VERCEL_BRANCH_URL||process.env.NEXT_PUBLIC_VERCEL_BRANCH_URL||void 0,"vercel.deployment_id":process.env.VERCEL_DEPLOYMENT_ID||void 0,[ni.SemanticResourceAttributes.SERVICE_VERSION]:process.env.VERCEL_DEPLOYMENT_ID,...n.attributes})),l=n.resourceDetectors??[bo];if(n.autoDetectResources??!0){let m={detectors:l};a=a.merge(Po(m))}let d=fp(n.propagators,e),g=pp(n.traceSampler,e),U=_p(n.spanProcessors,n,e);U.length===0&&f.diag.warn("@vercel/otel: No span processors configured. No spans will be exported.");let P=n.spanLimits,B=new wo({resource:a,idGenerator:s,sampler:g,spanLimits:P});if(B.addSpanProcessor(new Tr(U,n.attributesFromHeaders)),B.register({contextManager:u,propagator:new Le.CompositePropagator({propagators:d})}),this.tracerProvider=B,n.logRecordProcessor){let m=new En({resource:a});this.loggerProvider=m,m.addLogRecordProcessor(n.logRecordProcessor),ae.logs.setGlobalLoggerProvider(m)}if(n.metricReader||n.views){let m=new Rn({resource:a,views:n.views??[]});n.metricReader&&m.addMetricReader(n.metricReader),f.metrics.setGlobalMeterProvider(m),this.meterProvider=m}let A=lp(n.instrumentations,n.instrumentationConfig);this.disableInstrumentations=(0,au.registerInstrumentations)({instrumentations:A}),f.diag.info("@vercel/otel: started",c,o)}async shutdown(){let e=[];this.tracerProvider&&e.push(this.tracerProvider.shutdown()),this.loggerProvider&&e.push(this.loggerProvider.shutdown()),this.meterProvider&&e.push(this.meterProvider.shutdown()),f.diag.info("@vercel/otel: shutting down",e.length,process.env.NEXT_RUNTIME),await Promise.all(e),this.contextManager&&this.contextManager.disable();let{disableInstrumentations:r}=this;r&&r()}};function cp(){let t=(0,nt.parseEnvironment)(process.env);return{...nt.DEFAULT_ENVIRONMENT,...t}}function lp(t,e){return(t??["auto"]).map(r=>r==="auto"?(f.diag.debug("@vercel/otel: Configure instrumentations: fetch",e?.fetch),[new tt(e?.fetch)]):r==="fetch"?(f.diag.debug("@vercel/otel: Configure instrumentations: fetch",e?.fetch),new tt(e?.fetch)):r).flat()}function fp(t,e){let r=e.OTEL_PROPAGATORS&&e.OTEL_PROPAGATORS.length>0?e.OTEL_PROPAGATORS:void 0;return(t??r??["auto"]).map(n=>{if(n==="none")return[];if(n==="auto")return f.diag.debug("@vercel/otel: Configure propagators: tracecontext, baggage"),[new Tt,new Le.W3CBaggagePropagator];if(n==="tracecontext")return f.diag.debug("@vercel/otel: Configure propagator: tracecontext"),new Tt;if(n==="baggage")return f.diag.debug("@vercel/otel: Configure propagator: baggage"),new Le.W3CBaggagePropagator;if(typeof n=="string")throw new Error(`Unknown propagator: "${n}"`);return n}).flat()}var iu="always_on",rt=1;function pp(t,e){if(t&&typeof t!="string")return t;let r=t&&t!=="auto"?t:e.OTEL_TRACES_SAMPLER||iu;switch(f.diag.debug("@vercel/otel: Configure sampler: ",r),r){case"always_on":return new X;case"always_off":return new oe;case"parentbased_always_on":return new Te({root:new X});case"parentbased_always_off":return new Te({root:new oe});case"traceidratio":return new ke(ou(e));case"parentbased_traceidratio":return new Te({root:new ke(ou(e))});default:return f.diag.error(`@vercel/otel: OTEL_TRACES_SAMPLER value "${String(e.OTEL_TRACES_SAMPLER)} invalid, defaulting to ${iu}".`),new X}}function ou(t){if(t.OTEL_TRACES_SAMPLER_ARG===void 0||t.OTEL_TRACES_SAMPLER_ARG==="")return f.diag.error(`@vercel/otel: OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${rt}.`),rt;f.diag.debug("@vercel/otel: Configure sampler probability: ",t.OTEL_TRACES_SAMPLER_ARG);let e=Number(t.OTEL_TRACES_SAMPLER_ARG);return isNaN(e)?(f.diag.error(`@vercel/otel: OTEL_TRACES_SAMPLER_ARG=${t.OTEL_TRACES_SAMPLER_ARG} was given, but it is invalid, defaulting to ${rt}.`),rt):e<0||e>1?(f.diag.error(`@vercel/otel: OTEL_TRACES_SAMPLER_ARG=${t.OTEL_TRACES_SAMPLER_ARG} was given, but it is out of range ([0..1]), defaulting to ${rt}.`),rt):e}function _p(t,e,r){return[...(t??["auto"]).map(n=>{if(n==="auto"){if(process.env.VERCEL_OTEL_ENDPOINTS){let o=process.env.VERCEL_OTEL_ENDPOINTS_PORT||"4318",i=process.env.VERCEL_OTEL_ENDPOINTS_PROTOCOL||"http/protobuf";f.diag.debug("@vercel/otel: Configure vercel otel collector on port: ",o,i);let s={url:`http://localhost:${o}/v1/traces`,headers:{}},u=i==="http/protobuf"?new Be(s):new Ze(s);return new Ke(u)}return!e.traceExporter||e.traceExporter==="auto"||r.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT||r.OTEL_EXPORTER_OTLP_ENDPOINT?new Ke(dp(r)):void 0}return n}).filter(mp),...e.traceExporter&&e.traceExporter!=="auto"?[new Ke(e.traceExporter)]:[]]}function dp(t){let e=process.env.OTEL_EXPORTER_OTLP_TRACES_PROTOCOL??process.env.OTEL_EXPORTER_OTLP_PROTOCOL??"http/protobuf",r=Ep(t),n={...Le.baggageUtils.parseKeyPairsIntoRecord(t.OTEL_EXPORTER_OTLP_HEADERS),...Le.baggageUtils.parseKeyPairsIntoRecord(t.OTEL_EXPORTER_OTLP_TRACES_HEADERS)};switch(f.diag.debug("@vercel/otel: Configure trace exporter: ",e,r,`headers: ${Object.keys(n).join(",")||"<none>"}`),e){case"http/json":return new Ze({url:r,headers:n});case"http/protobuf":return new Be({url:r,headers:n});default:return f.diag.warn(`@vercel/otel: Unsupported OTLP traces protocol: ${e}. Using http/protobuf.`),new Be}}var uu="v1/traces",hp=`http://localhost:4318/${uu}`;function Ep(t){let e=t.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT;if(e&&typeof e=="string")return e;let r=t.OTEL_EXPORTER_OTLP_ENDPOINT;return r&&typeof r=="string"?`${r}/${uu}`:hp}function mp(t){return t!=null}function mm(t){let e;t?typeof t=="string"?e={serviceName:t}:e=t:e={},new Lr(e).start()}export{tt as FetchInstrumentation,Ze as OTLPHttpJsonTraceExporter,Be as OTLPHttpProtoTraceExporter,mm as registerOTel};
17
17
  //# sourceMappingURL=index.js.map