@sentry/node 8.8.0 → 8.9.0
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.
- package/cjs/integrations/anr/index.js +1 -1
- package/cjs/integrations/anr/index.js.map +1 -1
- package/cjs/integrations/local-variables/local-variables-async.js +1 -1
- package/cjs/integrations/tracing/index.js +1 -0
- package/cjs/integrations/tracing/index.js.map +1 -1
- package/cjs/integrations/tracing/redis.js +66 -48
- package/cjs/integrations/tracing/redis.js.map +1 -1
- package/cjs/utils/redisCache.js +10 -5
- package/cjs/utils/redisCache.js.map +1 -1
- package/esm/integrations/anr/index.js +1 -1
- package/esm/integrations/anr/index.js.map +1 -1
- package/esm/integrations/anr/worker-script.js +2 -2
- package/esm/integrations/local-variables/local-variables-async.js +1 -1
- package/esm/integrations/local-variables/worker-script.js +1 -1
- package/esm/integrations/tracing/index.js +2 -1
- package/esm/integrations/tracing/index.js.map +1 -1
- package/esm/integrations/tracing/redis.js +67 -49
- package/esm/integrations/tracing/redis.js.map +1 -1
- package/esm/utils/redisCache.js +10 -6
- package/esm/utils/redisCache.js.map +1 -1
- package/package.json +8 -7
- package/types/integrations/tracing/index.d.ts.map +1 -1
- package/types/integrations/tracing/redis.d.ts +2 -1
- package/types/integrations/tracing/redis.d.ts.map +1 -1
- package/types/utils/redisCache.d.ts +3 -0
- package/types/utils/redisCache.d.ts.map +1 -1
- package/types-ts3.8/integrations/tracing/redis.d.ts +2 -1
- package/types-ts3.8/utils/redisCache.d.ts +3 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! @sentry/node 8.
|
|
2
|
-
import{Session as t}from"node:inspector";import{parentPort as n,workerData as e}from"node:worker_threads";import{posix as r,sep as o}from"node:path";import*as s from"node:http";import*as i from"node:https";import{Readable as c}from"node:stream";import{createGzip as u}from"node:zlib";import*as a from"node:net";import*as f from"node:tls";const h=Object.prototype.toString;function p(t,n){return h.call(t)===`[object ${n}]`}function l(t){return p(t,"Object")}function d(t){return Boolean(t&&t.then&&"function"==typeof t.then)}function m(t,n){try{return t instanceof n}catch(t){return!1}}const g="8.8.0",y=globalThis;function b(t,n,e){const r=e||y,o=r.__SENTRY__=r.__SENTRY__||{},s=o[g]=o[g]||{};return s[t]||(s[t]=n())}const v=y,_=80;function w(t,n){const e=t,r=[];let o,s,i,c,u;if(!e||!e.tagName)return"";if(v.HTMLElement&&e instanceof HTMLElement&&e.dataset){if(e.dataset.sentryComponent)return e.dataset.sentryComponent;if(e.dataset.sentryElement)return e.dataset.sentryElement}r.push(e.tagName.toLowerCase());const a=n&&n.length?n.filter((t=>e.getAttribute(t))).map((t=>[t,e.getAttribute(t)])):null;if(a&&a.length)a.forEach((t=>{r.push(`[${t[0]}="${t[1]}"]`)}));else if(e.id&&r.push(`#${e.id}`),o=e.className,o&&p(o,"String"))for(s=o.split(/\s+/),u=0;u<s.length;u++)r.push(`.${s[u]}`);const f=["aria-label","type","name","title","alt"];for(u=0;u<f.length;u++)i=f[u],c=e.getAttribute(i),c&&r.push(`[${i}="${c}"]`);return r.join("")}const S="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,$=["debug","info","warn","error","log","assert","trace"],E={};function x(t){if(!("console"in y))return t();const n=y.console,e={},r=Object.keys(E);r.forEach((t=>{const r=E[t];e[t]=n[t],n[t]=r}));try{return t()}finally{r.forEach((t=>{n[t]=e[t]}))}}const N=function(){let t=!1;const n={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return S?$.forEach((e=>{n[e]=(...n)=>{t&&x((()=>{y.console[e](`Sentry Logger [${e}]:`,...n)}))}})):$.forEach((t=>{n[t]=()=>{}})),n}();function k(t,n=!1){const{host:e,path:r,pass:o,port:s,projectId:i,protocol:c,publicKey:u}=t;return`${c}://${u}${n&&o?`:${o}`:""}@${e}${s?`:${s}`:""}/${r?`${r}/`:r}${i}`}class C extends Error{constructor(t,n="warn"){super(t),this.message=t,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=n}}function D(t){if(function(t){switch(h.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return m(t,Error)}}(t))return{message:t.message,name:t.name,stack:t.stack,...O(t)};if(n=t,"undefined"!=typeof Event&&m(n,Event)){const n={type:t.type,target:T(t.target),currentTarget:T(t.currentTarget),...O(t)};return"undefined"!=typeof CustomEvent&&m(t,CustomEvent)&&(n.detail=t.detail),n}return t;var n}function T(t){try{return n=t,"undefined"!=typeof Element&&m(n,Element)?function(t,n={}){if(!t)return"<unknown>";try{let e=t;const r=5,o=[];let s=0,i=0;const c=" > ",u=c.length;let a;const f=Array.isArray(n)?n:n.keyAttrs,h=!Array.isArray(n)&&n.maxStringLength||_;for(;e&&s++<r&&(a=w(e,f),!("html"===a||s>1&&i+o.length*u+a.length>=h));)o.push(a),i+=a.length,e=e.parentNode;return o.reverse().join(c)}catch(t){return"<unknown>"}}(t):Object.prototype.toString.call(t)}catch(t){return"<unknown>"}var n}function O(t){if("object"==typeof t&&null!==t){const n={};for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n}return{}}function j(t){return R(t,new Map)}function R(t,n){if(function(t){if(!l(t))return!1;try{const n=Object.getPrototypeOf(t).constructor.name;return!n||"Object"===n}catch(t){return!0}}(t)){const e=n.get(t);if(void 0!==e)return e;const r={};n.set(t,r);for(const e of Object.keys(t))void 0!==t[e]&&(r[e]=R(t[e],n));return r}if(Array.isArray(t)){const e=n.get(t);if(void 0!==e)return e;const r=[];return n.set(t,r),t.forEach((t=>{r.push(R(t,n))})),r}return t}const A=50,I="?",P=/captureMessage|captureException/;const U="<anonymous>";const M=1e3;function L(){return Date.now()/M}const B=function(){const{performance:t}=y;if(!t||!t.now)return L;const n=Date.now()-t.now(),e=null==t.timeOrigin?n:t.timeOrigin;return()=>(e+t.now())/M}();function G(){const t=y,n=t.crypto||t.msCrypto;let e=()=>16*Math.random();try{if(n&&n.randomUUID)return n.randomUUID().replace(/-/g,"");n&&n.getRandomValues&&(e=()=>{const t=new Uint8Array(1);return n.getRandomValues(t),t[0]})}catch(t){}return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,(t=>(t^(15&e())>>t/4).toString(16)))}function J(t,n=100,e=1/0){try{return z("",t,n,e)}catch(t){return{ERROR:`**non-serializable** (${t})`}}}function z(t,n,e=1/0,r=1/0,o=function(){const t="function"==typeof WeakSet,n=t?new WeakSet:[];return[function(e){if(t)return!!n.has(e)||(n.add(e),!1);for(let t=0;t<n.length;t++)if(n[t]===e)return!0;return n.push(e),!1},function(e){if(t)n.delete(e);else for(let t=0;t<n.length;t++)if(n[t]===e){n.splice(t,1);break}}]}()){const[s,i]=o;if(null==n||["number","boolean","string"].includes(typeof n)&&!Number.isNaN(n))return n;const c=function(t,n){try{if("domain"===t&&n&&"object"==typeof n&&n.t)return"[Domain]";if("domainEmitter"===t)return"[DomainEmitter]";if("undefined"!=typeof global&&n===global)return"[Global]";if("undefined"!=typeof window&&n===window)return"[Window]";if("undefined"!=typeof document&&n===document)return"[Document]";if("object"==typeof(e=n)&&null!==e&&(e.__isVue||e.o))return"[VueViewModel]";if(function(t){return l(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t}(n))return"[SyntheticEvent]";if("number"==typeof n&&n!=n)return"[NaN]";if("function"==typeof n)return`[Function: ${function(t){try{return t&&"function"==typeof t&&t.name||U}catch(t){return U}}(n)}]`;if("symbol"==typeof n)return`[${String(n)}]`;if("bigint"==typeof n)return`[BigInt: ${String(n)}]`;const r=function(t){const n=Object.getPrototypeOf(t);return n?n.constructor.name:"null prototype"}(n);return/^HTML(\w*)Element$/.test(r)?`[HTMLElement: ${r}]`:`[object ${r}]`}catch(t){return`**non-serializable** (${t})`}var e}(t,n);if(!c.startsWith("[object "))return c;if(n.__sentry_skip_normalization__)return n;const u="number"==typeof n.__sentry_override_normalization_depth__?n.__sentry_override_normalization_depth__:e;if(0===u)return c.replace("object ","");if(s(n))return"[Circular ~]";const a=n;if(a&&"function"==typeof a.toJSON)try{return z("",a.toJSON(),u-1,r,o)}catch(t){}const f=Array.isArray(n)?[]:{};let h=0;const p=D(n);for(const t in p){if(!Object.prototype.hasOwnProperty.call(p,t))continue;if(h>=r){f[t]="[MaxProperties ~]";break}const n=p[t];f[t]=z(t,n,u-1,r,o),h++}return i(n),f}function H(t,n){const e=n.replace(/\\/g,"/").replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");let r=t;try{r=decodeURI(t)}catch(t){}return r.replace(/\\/g,"/").replace(/webpack:\/?/g,"").replace(new RegExp(`(file://)?/*${e}/*`,"ig"),"app:///")}(()=>{const{performance:t}=y;if(!t||!t.now)return;const n=36e5,e=t.now(),r=Date.now(),o=t.timeOrigin?Math.abs(t.timeOrigin+e-r):n,s=o<n,i=t.timing&&t.timing.navigationStart,c="number"==typeof i?Math.abs(i+e-r):n;(s||c<n)&&(o<=c&&t.timeOrigin)})();const W=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function Y(t){const n=function(t){const n=t.length>1024?`<truncated>${t.slice(-1024)}`:t,e=W.exec(n);return e?e.slice(1):[]}(t),e=n[0];let r=n[1];return e||r?(r&&(r=r.slice(0,r.length-1)),e+r):"."}var q;function F(t){return new K((n=>{n(t)}))}!function(t){t[t.PENDING=0]="PENDING";t[t.RESOLVED=1]="RESOLVED";t[t.REJECTED=2]="REJECTED"}(q||(q={}));class K{constructor(t){K.prototype.__init.call(this),K.prototype.__init2.call(this),K.prototype.__init3.call(this),K.prototype.__init4.call(this),this.i=q.PENDING,this.u=[];try{t(this.h,this.p)}catch(t){this.p(t)}}then(t,n){return new K(((e,r)=>{this.u.push([!1,n=>{if(t)try{e(t(n))}catch(t){r(t)}else e(n)},t=>{if(n)try{e(n(t))}catch(t){r(t)}else r(t)}]),this.l()}))}catch(t){return this.then((t=>t),t)}finally(t){return new K(((n,e)=>{let r,o;return this.then((n=>{o=!1,r=n,t&&t()}),(n=>{o=!0,r=n,t&&t()})).then((()=>{o?e(r):n(r)}))}))}__init(){this.h=t=>{this.m(q.RESOLVED,t)}}__init2(){this.p=t=>{this.m(q.REJECTED,t)}}__init3(){this.m=(t,n)=>{this.i===q.PENDING&&(d(n)?n.then(this.h,this.p):(this.i=t,this.v=n,this.l()))}}__init4(){this.l=()=>{if(this.i===q.PENDING)return;const t=this.u.slice();this.u=[],t.forEach((t=>{t[0]||(this.i===q.RESOLVED&&t[1](this.v),this.i===q.REJECTED&&t[2](this.v),t[0]=!0)}))}}}function V(t){const n=[];function e(t){return n.splice(n.indexOf(t),1)[0]}return{$:n,add:function(r){if(!(void 0===t||n.length<t))return o=new C("Not adding Promise because buffer limit was reached."),new K(((t,n)=>{n(o)}));var o;const s=r();return-1===n.indexOf(s)&&n.push(s),s.then((()=>e(s))).then(null,(()=>e(s).then(null,(()=>{})))),s},drain:function(t){return new K(((e,r)=>{let o=n.length;if(!o)return e(!0);const s=setTimeout((()=>{t&&t>0&&e(!1)}),t);n.forEach((t=>{F(t).then((()=>{--o||(clearTimeout(s),e(!0))}),r)}))}))}}}function Z(t,n=!1){return!(n||t&&!t.startsWith("/")&&!t.match(/^[A-Z]:/)&&!t.startsWith(".")&&!t.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//))&&void 0!==t&&!t.includes("node_modules/")}function Q(t,n=[]){return[t,n]}function X(t,n){const e=t[1];for(const t of e){if(n(t,t[0].type))return!0}return!1}function tt(t){return y.__SENTRY__&&y.__SENTRY__.encodePolyfill?y.__SENTRY__.encodePolyfill(t):(new TextEncoder).encode(t)}function nt(t){const[n,e]=t;let r=JSON.stringify(n);function o(t){"string"==typeof r?r="string"==typeof t?r+t:[tt(r),t]:r.push("string"==typeof t?tt(t):t)}for(const t of e){const[n,e]=t;if(o(`\n${JSON.stringify(n)}\n`),"string"==typeof e||e instanceof Uint8Array)o(e);else{let t;try{t=JSON.stringify(e)}catch(n){t=JSON.stringify(J(e))}o(t)}}return"string"==typeof r?r:function(t){const n=t.reduce(((t,n)=>t+n.length),0),e=new Uint8Array(n);let r=0;for(const n of t)e.set(n,r),r+=n.length;return e}(r)}const et={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",statsd:"metric_bucket"};function rt(t){return et[t]}function ot(t){if(!t||!t.sdk)return;const{name:n,version:e}=t.sdk;return{name:n,version:e}}const st=6e4;function it(t,{statusCode:n,headers:e},r=Date.now()){const o={...t},s=e&&e["x-sentry-rate-limits"],i=e&&e["retry-after"];if(s)for(const t of s.trim().split(",")){const[n,e,,,s]=t.split(":",5),i=parseInt(n,10),c=1e3*(isNaN(i)?60:i);if(e)for(const t of e.split(";"))"metric_bucket"===t&&s&&!s.split(";").includes("custom")||(o[t]=r+c);else o.all=r+c}else i?o.all=r+function(t,n=Date.now()){const e=parseInt(`${t}`,10);if(!isNaN(e))return 1e3*e;const r=Date.parse(`${t}`);return isNaN(r)?st:r-n}(i,r):429===n&&(o.all=r+6e4);return o}function ct(){return{traceId:G(),spanId:G().substring(16)}}const ut="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__;function at(){return ft(y),y}function ft(t){const n=t.__SENTRY__=t.__SENTRY__||{};return n.version=n.version||g,n[g]=n[g]||{}}function ht(t){const n=B(),e={sid:G(),init:!0,timestamp:n,started:n,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(t){return j({sid:`${t.sid}`,init:t.init,started:new Date(1e3*t.started).toISOString(),timestamp:new Date(1e3*t.timestamp).toISOString(),status:t.status,errors:t.errors,did:"number"==typeof t.did||"string"==typeof t.did?`${t.did}`:void 0,duration:t.duration,abnormal_mechanism:t.abnormal_mechanism,attrs:{release:t.release,environment:t.environment,ip_address:t.ipAddress,user_agent:t.userAgent}})}(e)};return t&&pt(e,t),e}function pt(t,n={}){if(n.user&&(!t.ipAddress&&n.user.ip_address&&(t.ipAddress=n.user.ip_address),t.did||n.did||(t.did=n.user.id||n.user.email||n.user.username)),t.timestamp=n.timestamp||B(),n.abnormal_mechanism&&(t.abnormal_mechanism=n.abnormal_mechanism),n.ignoreDuration&&(t.ignoreDuration=n.ignoreDuration),n.sid&&(t.sid=32===n.sid.length?n.sid:G()),void 0!==n.init&&(t.init=n.init),!t.did&&n.did&&(t.did=`${n.did}`),"number"==typeof n.started&&(t.started=n.started),t.ignoreDuration)t.duration=void 0;else if("number"==typeof n.duration)t.duration=n.duration;else{const n=t.timestamp-t.started;t.duration=n>=0?n:0}n.release&&(t.release=n.release),n.environment&&(t.environment=n.environment),!t.ipAddress&&n.ipAddress&&(t.ipAddress=n.ipAddress),!t.userAgent&&n.userAgent&&(t.userAgent=n.userAgent),"number"==typeof n.errors&&(t.errors=n.errors),n.status&&(t.status=n.status)}const lt="_sentrySpan";function dt(t,n){n?function(t,n,e){try{Object.defineProperty(t,n,{value:e,writable:!0,configurable:!0})}catch(e){S&&N.log(`Failed to add non-enumerable property "${n}" to object`,t)}}(t,lt,n):delete t[lt]}function mt(t){return t[lt]}class gt{constructor(){this._=!1,this.S=[],this.N=[],this.k=[],this.C=[],this.D={},this.T={},this.O={},this.j={},this.R={},this.A=ct()}clone(){const t=new gt;return t.k=[...this.k],t.T={...this.T},t.O={...this.O},t.j={...this.j},t.D=this.D,t.I=this.I,t.P=this.P,t.U=this.U,t.M=this.M,t.N=[...this.N],t.L=this.L,t.C=[...this.C],t.R={...this.R},t.A={...this.A},t.B=this.B,t.G=this.G,dt(t,mt(this)),t}setClient(t){this.B=t}setLastEventId(t){this.G=t}getClient(){return this.B}lastEventId(){return this.G}addScopeListener(t){this.S.push(t)}addEventProcessor(t){return this.N.push(t),this}setUser(t){return this.D=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this.P&&pt(this.P,{user:t}),this.J(),this}getUser(){return this.D}getRequestSession(){return this.L}setRequestSession(t){return this.L=t,this}setTags(t){return this.T={...this.T,...t},this.J(),this}setTag(t,n){return this.T={...this.T,[t]:n},this.J(),this}setExtras(t){return this.O={...this.O,...t},this.J(),this}setExtra(t,n){return this.O={...this.O,[t]:n},this.J(),this}setFingerprint(t){return this.M=t,this.J(),this}setLevel(t){return this.I=t,this.J(),this}setTransactionName(t){return this.U=t,this.J(),this}setContext(t,n){return null===n?delete this.j[t]:this.j[t]=n,this.J(),this}setSession(t){return t?this.P=t:delete this.P,this.J(),this}getSession(){return this.P}update(t){if(!t)return this;const n="function"==typeof t?t(this):t,[e,r]=n instanceof yt?[n.getScopeData(),n.getRequestSession()]:l(n)?[t,t.requestSession]:[],{tags:o,extra:s,user:i,contexts:c,level:u,fingerprint:a=[],propagationContext:f}=e||{};return this.T={...this.T,...o},this.O={...this.O,...s},this.j={...this.j,...c},i&&Object.keys(i).length&&(this.D=i),u&&(this.I=u),a.length&&(this.M=a),f&&(this.A=f),r&&(this.L=r),this}clear(){return this.k=[],this.T={},this.O={},this.D={},this.j={},this.I=void 0,this.U=void 0,this.M=void 0,this.L=void 0,this.P=void 0,dt(this,void 0),this.C=[],this.A=ct(),this.J(),this}addBreadcrumb(t,n){const e="number"==typeof n?n:100;if(e<=0)return this;const r={timestamp:L(),...t},o=this.k;return o.push(r),this.k=o.length>e?o.slice(-e):o,this.J(),this}getLastBreadcrumb(){return this.k[this.k.length-1]}clearBreadcrumbs(){return this.k=[],this.J(),this}addAttachment(t){return this.C.push(t),this}clearAttachments(){return this.C=[],this}getScopeData(){return{breadcrumbs:this.k,attachments:this.C,contexts:this.j,tags:this.T,extra:this.O,user:this.D,level:this.I,fingerprint:this.M||[],eventProcessors:this.N,propagationContext:this.A,sdkProcessingMetadata:this.R,transactionName:this.U,span:mt(this)}}setSDKProcessingMetadata(t){return this.R={...this.R,...t},this}setPropagationContext(t){return this.A=t,this}getPropagationContext(){return this.A}captureException(t,n){const e=n&&n.event_id?n.event_id:G();if(!this.B)return N.warn("No client configured on scope - will not capture exception!"),e;const r=new Error("Sentry syntheticException");return this.B.captureException(t,{originalException:t,syntheticException:r,...n,event_id:e},this),e}captureMessage(t,n,e){const r=e&&e.event_id?e.event_id:G();if(!this.B)return N.warn("No client configured on scope - will not capture message!"),r;const o=new Error(t);return this.B.captureMessage(t,n,{originalException:t,syntheticException:o,...e,event_id:r},this),r}captureEvent(t,n){const e=n&&n.event_id?n.event_id:G();return this.B?(this.B.captureEvent(t,{...n,event_id:e},this),e):(N.warn("No client configured on scope - will not capture event!"),e)}J(){this._||(this._=!0,this.S.forEach((t=>{t(this)})),this._=!1)}}const yt=gt;class bt{constructor(t,n){let e,r;e=t||new yt,r=n||new yt,this.H=[{scope:e}],this.W=r}withScope(t){const n=this.Y();let e;try{e=t(n)}catch(t){throw this.q(),t}return d(e)?e.then((t=>(this.q(),t)),(t=>{throw this.q(),t})):(this.q(),e)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this.W}getStack(){return this.H}getStackTop(){return this.H[this.H.length-1]}Y(){const t=this.getScope().clone();return this.getStack().push({client:this.getClient(),scope:t}),t}q(){return!(this.getStack().length<=1)&&!!this.getStack().pop()}}function vt(){const t=ft(at());return t.stack=t.stack||new bt(b("defaultCurrentScope",(()=>new yt)),b("defaultIsolationScope",(()=>new yt)))}function _t(t){return vt().withScope(t)}function wt(t,n){const e=vt();return e.withScope((()=>(e.getStackTop().scope=t,n(t))))}function St(t){return vt().withScope((()=>t(vt().getIsolationScope())))}function $t(t){const n=ft(t);return n.acs?n.acs:{withIsolationScope:St,withScope:_t,withSetScope:wt,withSetIsolationScope:(t,n)=>St(n),getCurrentScope:()=>vt().getScope(),getIsolationScope:()=>vt().getIsolationScope()}}function Et(){return $t(at()).getCurrentScope().getClient()}const xt="_sentryMetrics";function Nt(t){const n=t[xt];if(!n)return;const e={};for(const[,[t,r]]of n)e[t]||(e[t]=[]),e[t].push(j(r));return e}const kt="sentry.source",Ct="sentry.sample_rate",Dt="sentry.op",Tt="sentry.origin",Ot=0,jt=1,Rt=1;function At(t){const{spanId:n,traceId:e}=t.spanContext(),{parent_span_id:r}=Ut(t);return j({parent_span_id:r,span_id:n,trace_id:e})}function It(t){return"number"==typeof t?Pt(t):Array.isArray(t)?t[0]+t[1]/1e9:t instanceof Date?Pt(t.getTime()):B()}function Pt(t){return t>9999999999?t/1e3:t}function Ut(t){if(function(t){return"function"==typeof t.getSpanJSON}(t))return t.getSpanJSON();try{const{spanId:n,traceId:e}=t.spanContext();if(function(t){const n=t;return!!(n.attributes&&n.startTime&&n.name&&n.endTime&&n.status)}(t)){const{attributes:r,startTime:o,name:s,endTime:i,parentSpanId:c,status:u}=t;return j({span_id:n,trace_id:e,data:r,description:s,parent_span_id:c,start_timestamp:It(o),timestamp:It(i)||void 0,status:Mt(u),op:r[Dt],origin:r[Tt],_metrics_summary:Nt(t)})}return{span_id:n,trace_id:e}}catch(t){return{}}}function Mt(t){if(t&&t.code!==Ot)return t.code===jt?"ok":t.message||"unknown_error"}const Lt="_sentryRootSpan";function Bt(t){return t[Lt]||t}const Gt="production",Jt="_frozenDsc";function zt(t){const n=Et();if(!n)return{};const e=function(t,n){const e=n.getOptions(),{publicKey:r}=n.getDsn()||{},o=j({environment:e.environment||Gt,release:e.release,public_key:r,trace_id:t});return n.emit("createDsc",o),o}(Ut(t).trace_id||"",n),r=Bt(t);if(!r)return e;const o=r[Jt];if(o)return o;const s=Ut(r),i=s.data||{},c=i[Ct];null!=c&&(e.sample_rate=`${c}`);const u=i[kt];return u&&"url"!==u&&(e.transaction=s.description),e.sampled=String(function(t){const{traceFlags:n}=t.spanContext();return n===Rt}(r)),n.emit("createDsc",e),e}function Ht(t,n,e,r){const o=ot(e),s=t.type&&"replay_event"!==t.type?t.type:"event";!function(t,n){n&&(t.sdk=t.sdk||{},t.sdk.name=t.sdk.name||n.name,t.sdk.version=t.sdk.version||n.version,t.sdk.integrations=[...t.sdk.integrations||[],...n.integrations||[]],t.sdk.packages=[...t.sdk.packages||[],...n.packages||[]])}(t,e&&e.sdk);const i=function(t,n,e,r){const o=t.sdkProcessingMetadata&&t.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:t.event_id,sent_at:(new Date).toISOString(),...n&&{sdk:n},...!!e&&r&&{dsn:k(r)},...o&&{trace:j({...o})}}}(t,o,r,n);delete t.sdkProcessingMetadata;return Q(i,[[{type:s},t]])}const Wt="__SENTRY_SUPPRESS_TRACING__";function Yt(t){const n=$t(at());return n.suppressTracing?n.suppressTracing(t):function(...t){const n=$t(at());if(2===t.length){const[e,r]=t;return e?n.withSetScope(e,r):n.withScope(r)}return n.withScope(t[0])}((n=>(n.setSDKProcessingMetadata({[Wt]:!0}),t())))}function qt(t,n){const{fingerprint:e,span:r,breadcrumbs:o,sdkProcessingMetadata:s}=n;!function(t,n){const{extra:e,tags:r,user:o,contexts:s,level:i,transactionName:c}=n,u=j(e);u&&Object.keys(u).length&&(t.extra={...u,...t.extra});const a=j(r);a&&Object.keys(a).length&&(t.tags={...a,...t.tags});const f=j(o);f&&Object.keys(f).length&&(t.user={...f,...t.user});const h=j(s);h&&Object.keys(h).length&&(t.contexts={...h,...t.contexts});i&&(t.level=i);c&&"transaction"!==t.type&&(t.transaction=c)}(t,n),r&&function(t,n){t.contexts={trace:At(n),...t.contexts},t.sdkProcessingMetadata={dynamicSamplingContext:zt(n),...t.sdkProcessingMetadata};const e=Bt(n),r=Ut(e).description;r&&!t.transaction&&"transaction"===t.type&&(t.transaction=r)}(t,r),function(t,n){t.fingerprint=t.fingerprint?function(t){return Array.isArray(t)?t:[t]}(t.fingerprint):[],n&&(t.fingerprint=t.fingerprint.concat(n));t.fingerprint&&!t.fingerprint.length&&delete t.fingerprint}(t,e),function(t,n){const e=[...t.breadcrumbs||[],...n];t.breadcrumbs=e.length?e:void 0}(t,o),function(t,n){t.sdkProcessingMetadata={...t.sdkProcessingMetadata,...n}}(t,s)}const Ft="7";function Kt(t,n){return e={sentry_key:t.publicKey,sentry_version:Ft,...n&&{sentry_client:`${n.name}/${n.version}`}},Object.keys(e).map((t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`)).join("&");var e}const Vt=64;function Zt(t,n,e=V(t.bufferSize||Vt)){let r={};return{send:function(o){const s=[];if(X(o,((n,e)=>{const o=rt(e);if(function(t,n,e=Date.now()){return function(t,n){return t[n]||t.all||0}(t,n)>e}(r,o)){const r=Qt(n,e);t.recordDroppedEvent("ratelimit_backoff",o,r)}else s.push(n)})),0===s.length)return F({});const i=Q(o[0],s),c=n=>{X(i,((e,r)=>{const o=Qt(e,r);t.recordDroppedEvent(n,rt(r),o)}))};return e.add((()=>n({body:nt(i)}).then((t=>(void 0!==t.statusCode&&(t.statusCode<200||t.statusCode>=300)&&ut&&N.warn(`Sentry responded with status code ${t.statusCode} to sent event.`),r=it(r,t),t)),(t=>{throw c("network_error"),t})))).then((t=>t),(t=>{if(t instanceof C)return ut&&N.error("Skipped sending event because buffer is full."),c("queue_overflow"),F({});throw t}))},flush:t=>e.drain(t)}}function Qt(t,n){if("event"===n||"transaction"===n)return Array.isArray(t)?t[1]:void 0}const Xt=Symbol("AgentBaseInternalState");class tn extends s.Agent{[Xt];options;keepAlive;constructor(t){super(t),this[Xt]={}}isSecureEndpoint(t){if(t){if("boolean"==typeof t.secureEndpoint)return t.secureEndpoint;if("string"==typeof t.protocol)return"https:"===t.protocol}const{stack:n}=new Error;return"string"==typeof n&&n.split("\n").some((t=>-1!==t.indexOf("(https.js:")||-1!==t.indexOf("node:https:")))}createSocket(t,n,e){const r={...n,secureEndpoint:this.isSecureEndpoint(n)};Promise.resolve().then((()=>this.connect(t,r))).then((o=>{if(o instanceof s.Agent)return o.addRequest(t,r);this[Xt].currentSocket=o,super.createSocket(t,n,e)}),e)}createConnection(){const t=this[Xt].currentSocket;if(this[Xt].currentSocket=void 0,!t)throw new Error("No socket was returned in the `connect()` function");return t}get defaultPort(){return this[Xt].defaultPort??("https:"===this.protocol?443:80)}set defaultPort(t){this[Xt]&&(this[Xt].defaultPort=t)}get protocol(){return this[Xt].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(t){this[Xt]&&(this[Xt].protocol=t)}}function nn(...t){N.log("[https-proxy-agent:parse-proxy-response]",...t)}function en(t){return new Promise(((n,e)=>{let r=0;const o=[];function s(){const c=t.read();c?function(c){o.push(c),r+=c.length;const u=Buffer.concat(o,r),a=u.indexOf("\r\n\r\n");if(-1===a)return nn("have not received end of HTTP headers yet..."),void s();const f=u.slice(0,a).toString("ascii").split("\r\n"),h=f.shift();if(!h)return t.destroy(),e(new Error("No header received from proxy CONNECT response"));const p=h.split(" "),l=+p[1],d=p.slice(2).join(" "),m={};for(const n of f){if(!n)continue;const r=n.indexOf(":");if(-1===r)return t.destroy(),e(new Error(`Invalid header from proxy CONNECT response: "${n}"`));const o=n.slice(0,r).toLowerCase(),s=n.slice(r+1).trimStart(),i=m[o];"string"==typeof i?m[o]=[i,s]:Array.isArray(i)?i.push(s):m[o]=s}nn("got proxy server response: %o %o",h,m),i(),n({connect:{statusCode:l,statusText:d,headers:m},buffered:u})}(c):t.once("readable",s)}function i(){t.removeListener("end",c),t.removeListener("error",u),t.removeListener("readable",s)}function c(){i(),nn("onend"),e(new Error("Proxy connection ended before receiving CONNECT response"))}function u(t){i(),nn("onerror %o",t),e(t)}t.on("error",u),t.on("end",c),s()}))}function rn(...t){N.log("[https-proxy-agent]",...t)}class on extends tn{static protocols=["http","https"];proxy;proxyHeaders;connectOpts;constructor(t,n){super(n),this.options={},this.proxy="string"==typeof t?new URL(t):t,this.proxyHeaders=n?.headers??{},rn("Creating new HttpsProxyAgent instance: %o",this.proxy.href);const e=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),r=this.proxy.port?parseInt(this.proxy.port,10):"https:"===this.proxy.protocol?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...n?cn(n,"headers"):null,host:e,port:r}}async connect(t,n){const{proxy:e}=this;if(!n.host)throw new TypeError('No "host" provided');let r;if("https:"===e.protocol){rn("Creating `tls.Socket`: %o",this.connectOpts);const t=this.connectOpts.servername||this.connectOpts.host;r=f.connect({...this.connectOpts,servername:t&&a.isIP(t)?void 0:t})}else rn("Creating `net.Socket`: %o",this.connectOpts),r=a.connect(this.connectOpts);const o="function"==typeof this.proxyHeaders?this.proxyHeaders():{...this.proxyHeaders},s=a.isIPv6(n.host)?`[${n.host}]`:n.host;let i=`CONNECT ${s}:${n.port} HTTP/1.1\r\n`;if(e.username||e.password){const t=`${decodeURIComponent(e.username)}:${decodeURIComponent(e.password)}`;o["Proxy-Authorization"]=`Basic ${Buffer.from(t).toString("base64")}`}o.Host=`${s}:${n.port}`,o["Proxy-Connection"]||(o["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(const t of Object.keys(o))i+=`${t}: ${o[t]}\r\n`;const c=en(r);r.write(`${i}\r\n`);const{connect:u,buffered:h}=await c;if(t.emit("proxyConnect",u),this.emit("proxyConnect",u,t),200===u.statusCode){if(t.once("socket",sn),n.secureEndpoint){rn("Upgrading socket connection to TLS");const t=n.servername||n.host;return f.connect({...cn(n,"host","path","port"),socket:r,servername:a.isIP(t)?void 0:t})}return r}r.destroy();const p=new a.Socket({writable:!1});return p.readable=!0,t.once("socket",(t=>{rn("Replaying proxy buffer for failed request"),t.push(h),t.push(null)})),p}}function sn(t){t.resume()}function cn(t,...n){const e={};let r;for(r in t)n.includes(r)||(e[r]=t[r]);return e}const un=32768;function an(t){return t.replace(/^[A-Z]:/,"").replace(/\\/g,"/")}const fn=e;let hn,pn=!1;function ln(t){fn.debug&&console.log(`[ANR Worker] ${t}`)}var dn,mn,gn;const yn=function(t){let n;try{n=new URL(t.url)}catch(n){return x((()=>{console.warn("[@sentry/node]: Invalid dsn or tunnel option, will not send any events. The tunnel option must be a full URL when used.")})),Zt(t,(()=>Promise.resolve({})))}const e="https:"===n.protocol,r=function(t,n){const{no_proxy:e}=process.env;return e&&e.split(",").some((n=>t.host.endsWith(n)||t.hostname.endsWith(n)))?void 0:n}(n,t.proxy||(e?process.env.https_proxy:void 0)||process.env.http_proxy),o=e?i:s,a=void 0!==t.keepAlive&&t.keepAlive,f=r?new on(r):new o.Agent({keepAlive:a,maxSockets:30,timeout:2e3});return Yt((()=>{const n=function(t,n,e){const{hostname:r,pathname:o,port:s,protocol:i,search:a}=new URL(t.url);return function(f){return new Promise(((h,p)=>{let l=function(t){return new c({read(){this.push(t),this.push(null)}})}(f.body);const d={...t.headers};f.body.length>un&&(d["content-encoding"]="gzip",l=l.pipe(u()));const m=n.request({method:"POST",agent:e,headers:d,hostname:r,path:`${o}${a}`,port:s,protocol:i,ca:t.caCerts},(t=>{t.on("data",(()=>{})),t.on("end",(()=>{})),t.setEncoding("utf8");const n=t.headers["retry-after"]??null,e=t.headers["x-sentry-rate-limits"]??null;h({statusCode:t.statusCode,headers:{"retry-after":n,"x-sentry-rate-limits":Array.isArray(e)?e[0]:e}})}));m.on("error",p),l.pipe(m)}))}}(t,t.httpModule??o,f);return Zt(t,n)}))}({url:(dn=fn.dsn,mn=fn.tunnel,gn=fn.sdkMetadata.sdk,mn||`${function(t){return`${function(t){const n=t.protocol?`${t.protocol}:`:"",e=t.port?`:${t.port}`:"";return`${n}//${t.host}${e}${t.path?`/${t.path}`:""}/api/`}(t)}${t.projectId}/envelope/`}(dn)}?${Kt(dn,gn)}`),recordDroppedEvent:()=>{}});async function bn(){if(hn){ln("Sending abnormal session"),pt(hn,{status:"abnormal",abnormal_mechanism:"anr_foreground"});const t=function(t,n,e,r){const o=ot(e);return Q({sent_at:(new Date).toISOString(),...o&&{sdk:o},...!!r&&n&&{dsn:k(n)}},["aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()]])}(hn,fn.dsn,fn.sdkMetadata,fn.tunnel);ln(JSON.stringify(t)),await yn.send(t);try{n?.postMessage("session-ended")}catch(t){}}}function vn(t){if(!t)return;const n=function(t){if(!t.length)return[];const n=Array.from(t);return/sentryWrapped/.test(n[n.length-1].function||"")&&n.pop(),n.reverse(),P.test(n[n.length-1].function||"")&&(n.pop(),P.test(n[n.length-1].function||"")&&n.pop()),n.slice(0,A).map((t=>({...t,filename:t.filename||n[n.length-1].filename,function:t.function||I})))}(t);if(fn.appRootPath)for(const t of n)t.filename&&(t.filename=H(t.filename,fn.appRootPath));return n}async function _n(t,n){if(pn)return;pn=!0,await bn(),ln("Sending event");const e={event_id:G(),contexts:fn.contexts,release:fn.release,environment:fn.environment,dist:fn.dist,platform:"node",level:"error",exception:{values:[{type:"ApplicationNotResponding",value:`Application Not Responding for at least ${fn.anrThreshold} ms`,stacktrace:{frames:vn(t)},mechanism:{type:"ANR"}}]},tags:fn.staticTags};n&&function(t,n){if(qt(t,n),!t.contexts?.trace){const{traceId:e,spanId:r,parentSpanId:o}=n.propagationContext;t.contexts={trace:{trace_id:e,span_id:r,parent_span_id:o},...t.contexts}}}(e,n);const r=Ht(e,fn.dsn,fn.sdkMetadata,fn.tunnel);ln(JSON.stringify(r)),await yn.send(r),await yn.flush(2e3),setTimeout((()=>{process.exit(0)}),5e3)}let wn;if(ln("Started"),fn.captureStackTrace){ln("Connecting to debugger");const n=new t;n.connectToMainThread(),ln("Connected to debugger");const e=new Map;n.on("Debugger.scriptParsed",(t=>{e.set(t.params.scriptId,t.params.url)})),n.on("Debugger.paused",(t=>{if("other"===t.params.reason)try{ln("Debugger paused");const s=[...t.params.callFrames],i=fn.appRootPath?function(t=(process.argv[1]?Y(process.argv[1]):process.cwd()),n="\\"===o){const e=n?an(t):t;return t=>{if(!t)return;const o=n?an(t):t;let{dir:s,base:i,ext:c}=r.parse(o);".js"!==c&&".mjs"!==c&&".cjs"!==c||(i=i.slice(0,-1*c.length)),s||(s=".");const u=s.lastIndexOf("/node_modules");if(u>-1)return`${s.slice(u+14).replace(/\//g,".")}:${i}`;if(s.startsWith(e)){let t=s.slice(e.length+1).replace(/\//g,".");return t&&(t+=":"),t+=i,t}return i}}(fn.appRootPath):()=>{},c=s.map((t=>function(t,n,e){const r=n?n.replace(/^file:\/\//,""):void 0,o=t.location.columnNumber?t.location.columnNumber+1:void 0,s=t.location.lineNumber?t.location.lineNumber+1:void 0;return j({filename:r,module:e(r),function:t.functionName||I,colno:o,lineno:s,in_app:r?Z(r):void 0})}(t,e.get(t.location.scriptId),i))),u=setTimeout((()=>{_n(c).then(null,(()=>{ln("Sending ANR event failed.")}))}),5e3);n.post("Runtime.evaluate",{expression:"global.__SENTRY_GET_SCOPES__();",silent:!0,returnByValue:!0},((t,e)=>{t&&ln(`Error executing script: '${t.message}'`),clearTimeout(u);const r=e&&e.result?e.result.value:void 0;n.post("Debugger.resume"),n.post("Debugger.disable"),_n(c,r).then(null,(()=>{ln("Sending ANR event failed.")}))}))}catch(t){throw n.post("Debugger.resume"),n.post("Debugger.disable"),t}})),wn=()=>{try{n.post("Debugger.enable",(()=>{n.post("Debugger.pause")}))}catch(t){}}}const{poll:Sn}=function(t,n,e,r){const o=t();let s=!1,i=!0;return setInterval((()=>{const t=o.getTimeMs();!1===s&&t>n+e&&(s=!0,i&&r()),t<n+e&&(s=!1)}),20),{poll:()=>{o.reset()},enabled:t=>{i=t}}}((function(){let t=process.hrtime();return{getTimeMs:()=>{const[n,e]=process.hrtime(t);return Math.floor(1e3*n+e/1e6)},reset:()=>{t=process.hrtime()}}}),fn.pollInterval,fn.anrThreshold,(function(){ln("Watchdog timeout"),wn?(ln("Pausing debugger to capture stack trace"),wn()):(ln("Capturing event without a stack trace"),_n().then(null,(()=>{ln("Sending ANR event failed on watchdog timeout.")})))}));n?.on("message",(t=>{t.session&&(hn=ht(t.session)),Sn()}));
|
|
1
|
+
/*! @sentry/node 8.9.0 (5043af7) | https://github.com/getsentry/sentry-javascript */
|
|
2
|
+
import{Session as t}from"node:inspector";import{parentPort as n,workerData as e}from"node:worker_threads";import{posix as r,sep as o}from"node:path";import*as s from"node:http";import*as i from"node:https";import{Readable as c}from"node:stream";import{createGzip as u}from"node:zlib";import*as a from"node:net";import*as f from"node:tls";const h=Object.prototype.toString;function p(t,n){return h.call(t)===`[object ${n}]`}function l(t){return p(t,"Object")}function d(t){return Boolean(t&&t.then&&"function"==typeof t.then)}function m(t,n){try{return t instanceof n}catch(t){return!1}}const g="8.9.0",y=globalThis;function b(t,n,e){const r=e||y,o=r.__SENTRY__=r.__SENTRY__||{},s=o[g]=o[g]||{};return s[t]||(s[t]=n())}const v=y,_=80;function w(t,n){const e=t,r=[];let o,s,i,c,u;if(!e||!e.tagName)return"";if(v.HTMLElement&&e instanceof HTMLElement&&e.dataset){if(e.dataset.sentryComponent)return e.dataset.sentryComponent;if(e.dataset.sentryElement)return e.dataset.sentryElement}r.push(e.tagName.toLowerCase());const a=n&&n.length?n.filter((t=>e.getAttribute(t))).map((t=>[t,e.getAttribute(t)])):null;if(a&&a.length)a.forEach((t=>{r.push(`[${t[0]}="${t[1]}"]`)}));else if(e.id&&r.push(`#${e.id}`),o=e.className,o&&p(o,"String"))for(s=o.split(/\s+/),u=0;u<s.length;u++)r.push(`.${s[u]}`);const f=["aria-label","type","name","title","alt"];for(u=0;u<f.length;u++)i=f[u],c=e.getAttribute(i),c&&r.push(`[${i}="${c}"]`);return r.join("")}const S="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,$=["debug","info","warn","error","log","assert","trace"],E={};function x(t){if(!("console"in y))return t();const n=y.console,e={},r=Object.keys(E);r.forEach((t=>{const r=E[t];e[t]=n[t],n[t]=r}));try{return t()}finally{r.forEach((t=>{n[t]=e[t]}))}}const N=function(){let t=!1;const n={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return S?$.forEach((e=>{n[e]=(...n)=>{t&&x((()=>{y.console[e](`Sentry Logger [${e}]:`,...n)}))}})):$.forEach((t=>{n[t]=()=>{}})),n}();function k(t,n=!1){const{host:e,path:r,pass:o,port:s,projectId:i,protocol:c,publicKey:u}=t;return`${c}://${u}${n&&o?`:${o}`:""}@${e}${s?`:${s}`:""}/${r?`${r}/`:r}${i}`}class C extends Error{constructor(t,n="warn"){super(t),this.message=t,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=n}}function D(t){if(function(t){switch(h.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return m(t,Error)}}(t))return{message:t.message,name:t.name,stack:t.stack,...O(t)};if(n=t,"undefined"!=typeof Event&&m(n,Event)){const n={type:t.type,target:T(t.target),currentTarget:T(t.currentTarget),...O(t)};return"undefined"!=typeof CustomEvent&&m(t,CustomEvent)&&(n.detail=t.detail),n}return t;var n}function T(t){try{return n=t,"undefined"!=typeof Element&&m(n,Element)?function(t,n={}){if(!t)return"<unknown>";try{let e=t;const r=5,o=[];let s=0,i=0;const c=" > ",u=c.length;let a;const f=Array.isArray(n)?n:n.keyAttrs,h=!Array.isArray(n)&&n.maxStringLength||_;for(;e&&s++<r&&(a=w(e,f),!("html"===a||s>1&&i+o.length*u+a.length>=h));)o.push(a),i+=a.length,e=e.parentNode;return o.reverse().join(c)}catch(t){return"<unknown>"}}(t):Object.prototype.toString.call(t)}catch(t){return"<unknown>"}var n}function O(t){if("object"==typeof t&&null!==t){const n={};for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n}return{}}function j(t){return R(t,new Map)}function R(t,n){if(function(t){if(!l(t))return!1;try{const n=Object.getPrototypeOf(t).constructor.name;return!n||"Object"===n}catch(t){return!0}}(t)){const e=n.get(t);if(void 0!==e)return e;const r={};n.set(t,r);for(const e of Object.keys(t))void 0!==t[e]&&(r[e]=R(t[e],n));return r}if(Array.isArray(t)){const e=n.get(t);if(void 0!==e)return e;const r=[];return n.set(t,r),t.forEach((t=>{r.push(R(t,n))})),r}return t}const A=50,I="?",P=/captureMessage|captureException/;const U="<anonymous>";const M=1e3;function L(){return Date.now()/M}const B=function(){const{performance:t}=y;if(!t||!t.now)return L;const n=Date.now()-t.now(),e=null==t.timeOrigin?n:t.timeOrigin;return()=>(e+t.now())/M}();function G(){const t=y,n=t.crypto||t.msCrypto;let e=()=>16*Math.random();try{if(n&&n.randomUUID)return n.randomUUID().replace(/-/g,"");n&&n.getRandomValues&&(e=()=>{const t=new Uint8Array(1);return n.getRandomValues(t),t[0]})}catch(t){}return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,(t=>(t^(15&e())>>t/4).toString(16)))}function J(t,n=100,e=1/0){try{return z("",t,n,e)}catch(t){return{ERROR:`**non-serializable** (${t})`}}}function z(t,n,e=1/0,r=1/0,o=function(){const t="function"==typeof WeakSet,n=t?new WeakSet:[];return[function(e){if(t)return!!n.has(e)||(n.add(e),!1);for(let t=0;t<n.length;t++)if(n[t]===e)return!0;return n.push(e),!1},function(e){if(t)n.delete(e);else for(let t=0;t<n.length;t++)if(n[t]===e){n.splice(t,1);break}}]}()){const[s,i]=o;if(null==n||["number","boolean","string"].includes(typeof n)&&!Number.isNaN(n))return n;const c=function(t,n){try{if("domain"===t&&n&&"object"==typeof n&&n.t)return"[Domain]";if("domainEmitter"===t)return"[DomainEmitter]";if("undefined"!=typeof global&&n===global)return"[Global]";if("undefined"!=typeof window&&n===window)return"[Window]";if("undefined"!=typeof document&&n===document)return"[Document]";if("object"==typeof(e=n)&&null!==e&&(e.__isVue||e.o))return"[VueViewModel]";if(function(t){return l(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t}(n))return"[SyntheticEvent]";if("number"==typeof n&&n!=n)return"[NaN]";if("function"==typeof n)return`[Function: ${function(t){try{return t&&"function"==typeof t&&t.name||U}catch(t){return U}}(n)}]`;if("symbol"==typeof n)return`[${String(n)}]`;if("bigint"==typeof n)return`[BigInt: ${String(n)}]`;const r=function(t){const n=Object.getPrototypeOf(t);return n?n.constructor.name:"null prototype"}(n);return/^HTML(\w*)Element$/.test(r)?`[HTMLElement: ${r}]`:`[object ${r}]`}catch(t){return`**non-serializable** (${t})`}var e}(t,n);if(!c.startsWith("[object "))return c;if(n.__sentry_skip_normalization__)return n;const u="number"==typeof n.__sentry_override_normalization_depth__?n.__sentry_override_normalization_depth__:e;if(0===u)return c.replace("object ","");if(s(n))return"[Circular ~]";const a=n;if(a&&"function"==typeof a.toJSON)try{return z("",a.toJSON(),u-1,r,o)}catch(t){}const f=Array.isArray(n)?[]:{};let h=0;const p=D(n);for(const t in p){if(!Object.prototype.hasOwnProperty.call(p,t))continue;if(h>=r){f[t]="[MaxProperties ~]";break}const n=p[t];f[t]=z(t,n,u-1,r,o),h++}return i(n),f}function H(t,n){const e=n.replace(/\\/g,"/").replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");let r=t;try{r=decodeURI(t)}catch(t){}return r.replace(/\\/g,"/").replace(/webpack:\/?/g,"").replace(new RegExp(`(file://)?/*${e}/*`,"ig"),"app:///")}(()=>{const{performance:t}=y;if(!t||!t.now)return;const n=36e5,e=t.now(),r=Date.now(),o=t.timeOrigin?Math.abs(t.timeOrigin+e-r):n,s=o<n,i=t.timing&&t.timing.navigationStart,c="number"==typeof i?Math.abs(i+e-r):n;(s||c<n)&&(o<=c&&t.timeOrigin)})();const W=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function Y(t){const n=function(t){const n=t.length>1024?`<truncated>${t.slice(-1024)}`:t,e=W.exec(n);return e?e.slice(1):[]}(t),e=n[0];let r=n[1];return e||r?(r&&(r=r.slice(0,r.length-1)),e+r):"."}var q;function F(t){return new K((n=>{n(t)}))}!function(t){t[t.PENDING=0]="PENDING";t[t.RESOLVED=1]="RESOLVED";t[t.REJECTED=2]="REJECTED"}(q||(q={}));class K{constructor(t){K.prototype.__init.call(this),K.prototype.__init2.call(this),K.prototype.__init3.call(this),K.prototype.__init4.call(this),this.i=q.PENDING,this.u=[];try{t(this.h,this.p)}catch(t){this.p(t)}}then(t,n){return new K(((e,r)=>{this.u.push([!1,n=>{if(t)try{e(t(n))}catch(t){r(t)}else e(n)},t=>{if(n)try{e(n(t))}catch(t){r(t)}else r(t)}]),this.l()}))}catch(t){return this.then((t=>t),t)}finally(t){return new K(((n,e)=>{let r,o;return this.then((n=>{o=!1,r=n,t&&t()}),(n=>{o=!0,r=n,t&&t()})).then((()=>{o?e(r):n(r)}))}))}__init(){this.h=t=>{this.m(q.RESOLVED,t)}}__init2(){this.p=t=>{this.m(q.REJECTED,t)}}__init3(){this.m=(t,n)=>{this.i===q.PENDING&&(d(n)?n.then(this.h,this.p):(this.i=t,this.v=n,this.l()))}}__init4(){this.l=()=>{if(this.i===q.PENDING)return;const t=this.u.slice();this.u=[],t.forEach((t=>{t[0]||(this.i===q.RESOLVED&&t[1](this.v),this.i===q.REJECTED&&t[2](this.v),t[0]=!0)}))}}}function V(t){const n=[];function e(t){return n.splice(n.indexOf(t),1)[0]}return{$:n,add:function(r){if(!(void 0===t||n.length<t))return o=new C("Not adding Promise because buffer limit was reached."),new K(((t,n)=>{n(o)}));var o;const s=r();return-1===n.indexOf(s)&&n.push(s),s.then((()=>e(s))).then(null,(()=>e(s).then(null,(()=>{})))),s},drain:function(t){return new K(((e,r)=>{let o=n.length;if(!o)return e(!0);const s=setTimeout((()=>{t&&t>0&&e(!1)}),t);n.forEach((t=>{F(t).then((()=>{--o||(clearTimeout(s),e(!0))}),r)}))}))}}}function Z(t,n=!1){return!(n||t&&!t.startsWith("/")&&!t.match(/^[A-Z]:/)&&!t.startsWith(".")&&!t.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//))&&void 0!==t&&!t.includes("node_modules/")}function Q(t,n=[]){return[t,n]}function X(t,n){const e=t[1];for(const t of e){if(n(t,t[0].type))return!0}return!1}function tt(t){return y.__SENTRY__&&y.__SENTRY__.encodePolyfill?y.__SENTRY__.encodePolyfill(t):(new TextEncoder).encode(t)}function nt(t){const[n,e]=t;let r=JSON.stringify(n);function o(t){"string"==typeof r?r="string"==typeof t?r+t:[tt(r),t]:r.push("string"==typeof t?tt(t):t)}for(const t of e){const[n,e]=t;if(o(`\n${JSON.stringify(n)}\n`),"string"==typeof e||e instanceof Uint8Array)o(e);else{let t;try{t=JSON.stringify(e)}catch(n){t=JSON.stringify(J(e))}o(t)}}return"string"==typeof r?r:function(t){const n=t.reduce(((t,n)=>t+n.length),0),e=new Uint8Array(n);let r=0;for(const n of t)e.set(n,r),r+=n.length;return e}(r)}const et={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",statsd:"metric_bucket"};function rt(t){return et[t]}function ot(t){if(!t||!t.sdk)return;const{name:n,version:e}=t.sdk;return{name:n,version:e}}const st=6e4;function it(t,{statusCode:n,headers:e},r=Date.now()){const o={...t},s=e&&e["x-sentry-rate-limits"],i=e&&e["retry-after"];if(s)for(const t of s.trim().split(",")){const[n,e,,,s]=t.split(":",5),i=parseInt(n,10),c=1e3*(isNaN(i)?60:i);if(e)for(const t of e.split(";"))"metric_bucket"===t&&s&&!s.split(";").includes("custom")||(o[t]=r+c);else o.all=r+c}else i?o.all=r+function(t,n=Date.now()){const e=parseInt(`${t}`,10);if(!isNaN(e))return 1e3*e;const r=Date.parse(`${t}`);return isNaN(r)?st:r-n}(i,r):429===n&&(o.all=r+6e4);return o}function ct(){return{traceId:G(),spanId:G().substring(16)}}const ut="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__;function at(){return ft(y),y}function ft(t){const n=t.__SENTRY__=t.__SENTRY__||{};return n.version=n.version||g,n[g]=n[g]||{}}function ht(t){const n=B(),e={sid:G(),init:!0,timestamp:n,started:n,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(t){return j({sid:`${t.sid}`,init:t.init,started:new Date(1e3*t.started).toISOString(),timestamp:new Date(1e3*t.timestamp).toISOString(),status:t.status,errors:t.errors,did:"number"==typeof t.did||"string"==typeof t.did?`${t.did}`:void 0,duration:t.duration,abnormal_mechanism:t.abnormal_mechanism,attrs:{release:t.release,environment:t.environment,ip_address:t.ipAddress,user_agent:t.userAgent}})}(e)};return t&&pt(e,t),e}function pt(t,n={}){if(n.user&&(!t.ipAddress&&n.user.ip_address&&(t.ipAddress=n.user.ip_address),t.did||n.did||(t.did=n.user.id||n.user.email||n.user.username)),t.timestamp=n.timestamp||B(),n.abnormal_mechanism&&(t.abnormal_mechanism=n.abnormal_mechanism),n.ignoreDuration&&(t.ignoreDuration=n.ignoreDuration),n.sid&&(t.sid=32===n.sid.length?n.sid:G()),void 0!==n.init&&(t.init=n.init),!t.did&&n.did&&(t.did=`${n.did}`),"number"==typeof n.started&&(t.started=n.started),t.ignoreDuration)t.duration=void 0;else if("number"==typeof n.duration)t.duration=n.duration;else{const n=t.timestamp-t.started;t.duration=n>=0?n:0}n.release&&(t.release=n.release),n.environment&&(t.environment=n.environment),!t.ipAddress&&n.ipAddress&&(t.ipAddress=n.ipAddress),!t.userAgent&&n.userAgent&&(t.userAgent=n.userAgent),"number"==typeof n.errors&&(t.errors=n.errors),n.status&&(t.status=n.status)}const lt="_sentrySpan";function dt(t,n){n?function(t,n,e){try{Object.defineProperty(t,n,{value:e,writable:!0,configurable:!0})}catch(e){S&&N.log(`Failed to add non-enumerable property "${n}" to object`,t)}}(t,lt,n):delete t[lt]}function mt(t){return t[lt]}class gt{constructor(){this._=!1,this.S=[],this.N=[],this.k=[],this.C=[],this.D={},this.T={},this.O={},this.j={},this.R={},this.A=ct()}clone(){const t=new gt;return t.k=[...this.k],t.T={...this.T},t.O={...this.O},t.j={...this.j},t.D=this.D,t.I=this.I,t.P=this.P,t.U=this.U,t.M=this.M,t.N=[...this.N],t.L=this.L,t.C=[...this.C],t.R={...this.R},t.A={...this.A},t.B=this.B,t.G=this.G,dt(t,mt(this)),t}setClient(t){this.B=t}setLastEventId(t){this.G=t}getClient(){return this.B}lastEventId(){return this.G}addScopeListener(t){this.S.push(t)}addEventProcessor(t){return this.N.push(t),this}setUser(t){return this.D=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this.P&&pt(this.P,{user:t}),this.J(),this}getUser(){return this.D}getRequestSession(){return this.L}setRequestSession(t){return this.L=t,this}setTags(t){return this.T={...this.T,...t},this.J(),this}setTag(t,n){return this.T={...this.T,[t]:n},this.J(),this}setExtras(t){return this.O={...this.O,...t},this.J(),this}setExtra(t,n){return this.O={...this.O,[t]:n},this.J(),this}setFingerprint(t){return this.M=t,this.J(),this}setLevel(t){return this.I=t,this.J(),this}setTransactionName(t){return this.U=t,this.J(),this}setContext(t,n){return null===n?delete this.j[t]:this.j[t]=n,this.J(),this}setSession(t){return t?this.P=t:delete this.P,this.J(),this}getSession(){return this.P}update(t){if(!t)return this;const n="function"==typeof t?t(this):t,[e,r]=n instanceof yt?[n.getScopeData(),n.getRequestSession()]:l(n)?[t,t.requestSession]:[],{tags:o,extra:s,user:i,contexts:c,level:u,fingerprint:a=[],propagationContext:f}=e||{};return this.T={...this.T,...o},this.O={...this.O,...s},this.j={...this.j,...c},i&&Object.keys(i).length&&(this.D=i),u&&(this.I=u),a.length&&(this.M=a),f&&(this.A=f),r&&(this.L=r),this}clear(){return this.k=[],this.T={},this.O={},this.D={},this.j={},this.I=void 0,this.U=void 0,this.M=void 0,this.L=void 0,this.P=void 0,dt(this,void 0),this.C=[],this.A=ct(),this.J(),this}addBreadcrumb(t,n){const e="number"==typeof n?n:100;if(e<=0)return this;const r={timestamp:L(),...t},o=this.k;return o.push(r),this.k=o.length>e?o.slice(-e):o,this.J(),this}getLastBreadcrumb(){return this.k[this.k.length-1]}clearBreadcrumbs(){return this.k=[],this.J(),this}addAttachment(t){return this.C.push(t),this}clearAttachments(){return this.C=[],this}getScopeData(){return{breadcrumbs:this.k,attachments:this.C,contexts:this.j,tags:this.T,extra:this.O,user:this.D,level:this.I,fingerprint:this.M||[],eventProcessors:this.N,propagationContext:this.A,sdkProcessingMetadata:this.R,transactionName:this.U,span:mt(this)}}setSDKProcessingMetadata(t){return this.R={...this.R,...t},this}setPropagationContext(t){return this.A=t,this}getPropagationContext(){return this.A}captureException(t,n){const e=n&&n.event_id?n.event_id:G();if(!this.B)return N.warn("No client configured on scope - will not capture exception!"),e;const r=new Error("Sentry syntheticException");return this.B.captureException(t,{originalException:t,syntheticException:r,...n,event_id:e},this),e}captureMessage(t,n,e){const r=e&&e.event_id?e.event_id:G();if(!this.B)return N.warn("No client configured on scope - will not capture message!"),r;const o=new Error(t);return this.B.captureMessage(t,n,{originalException:t,syntheticException:o,...e,event_id:r},this),r}captureEvent(t,n){const e=n&&n.event_id?n.event_id:G();return this.B?(this.B.captureEvent(t,{...n,event_id:e},this),e):(N.warn("No client configured on scope - will not capture event!"),e)}J(){this._||(this._=!0,this.S.forEach((t=>{t(this)})),this._=!1)}}const yt=gt;class bt{constructor(t,n){let e,r;e=t||new yt,r=n||new yt,this.H=[{scope:e}],this.W=r}withScope(t){const n=this.Y();let e;try{e=t(n)}catch(t){throw this.q(),t}return d(e)?e.then((t=>(this.q(),t)),(t=>{throw this.q(),t})):(this.q(),e)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this.W}getStack(){return this.H}getStackTop(){return this.H[this.H.length-1]}Y(){const t=this.getScope().clone();return this.getStack().push({client:this.getClient(),scope:t}),t}q(){return!(this.getStack().length<=1)&&!!this.getStack().pop()}}function vt(){const t=ft(at());return t.stack=t.stack||new bt(b("defaultCurrentScope",(()=>new yt)),b("defaultIsolationScope",(()=>new yt)))}function _t(t){return vt().withScope(t)}function wt(t,n){const e=vt();return e.withScope((()=>(e.getStackTop().scope=t,n(t))))}function St(t){return vt().withScope((()=>t(vt().getIsolationScope())))}function $t(t){const n=ft(t);return n.acs?n.acs:{withIsolationScope:St,withScope:_t,withSetScope:wt,withSetIsolationScope:(t,n)=>St(n),getCurrentScope:()=>vt().getScope(),getIsolationScope:()=>vt().getIsolationScope()}}function Et(){return $t(at()).getCurrentScope().getClient()}const xt="_sentryMetrics";function Nt(t){const n=t[xt];if(!n)return;const e={};for(const[,[t,r]]of n)e[t]||(e[t]=[]),e[t].push(j(r));return e}const kt="sentry.source",Ct="sentry.sample_rate",Dt="sentry.op",Tt="sentry.origin",Ot=0,jt=1,Rt=1;function At(t){const{spanId:n,traceId:e}=t.spanContext(),{parent_span_id:r}=Ut(t);return j({parent_span_id:r,span_id:n,trace_id:e})}function It(t){return"number"==typeof t?Pt(t):Array.isArray(t)?t[0]+t[1]/1e9:t instanceof Date?Pt(t.getTime()):B()}function Pt(t){return t>9999999999?t/1e3:t}function Ut(t){if(function(t){return"function"==typeof t.getSpanJSON}(t))return t.getSpanJSON();try{const{spanId:n,traceId:e}=t.spanContext();if(function(t){const n=t;return!!(n.attributes&&n.startTime&&n.name&&n.endTime&&n.status)}(t)){const{attributes:r,startTime:o,name:s,endTime:i,parentSpanId:c,status:u}=t;return j({span_id:n,trace_id:e,data:r,description:s,parent_span_id:c,start_timestamp:It(o),timestamp:It(i)||void 0,status:Mt(u),op:r[Dt],origin:r[Tt],_metrics_summary:Nt(t)})}return{span_id:n,trace_id:e}}catch(t){return{}}}function Mt(t){if(t&&t.code!==Ot)return t.code===jt?"ok":t.message||"unknown_error"}const Lt="_sentryRootSpan";function Bt(t){return t[Lt]||t}const Gt="production",Jt="_frozenDsc";function zt(t){const n=Et();if(!n)return{};const e=function(t,n){const e=n.getOptions(),{publicKey:r}=n.getDsn()||{},o=j({environment:e.environment||Gt,release:e.release,public_key:r,trace_id:t});return n.emit("createDsc",o),o}(Ut(t).trace_id||"",n),r=Bt(t);if(!r)return e;const o=r[Jt];if(o)return o;const s=Ut(r),i=s.data||{},c=i[Ct];null!=c&&(e.sample_rate=`${c}`);const u=i[kt];return u&&"url"!==u&&(e.transaction=s.description),e.sampled=String(function(t){const{traceFlags:n}=t.spanContext();return n===Rt}(r)),n.emit("createDsc",e),e}function Ht(t,n,e,r){const o=ot(e),s=t.type&&"replay_event"!==t.type?t.type:"event";!function(t,n){n&&(t.sdk=t.sdk||{},t.sdk.name=t.sdk.name||n.name,t.sdk.version=t.sdk.version||n.version,t.sdk.integrations=[...t.sdk.integrations||[],...n.integrations||[]],t.sdk.packages=[...t.sdk.packages||[],...n.packages||[]])}(t,e&&e.sdk);const i=function(t,n,e,r){const o=t.sdkProcessingMetadata&&t.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:t.event_id,sent_at:(new Date).toISOString(),...n&&{sdk:n},...!!e&&r&&{dsn:k(r)},...o&&{trace:j({...o})}}}(t,o,r,n);delete t.sdkProcessingMetadata;return Q(i,[[{type:s},t]])}const Wt="__SENTRY_SUPPRESS_TRACING__";function Yt(t){const n=$t(at());return n.suppressTracing?n.suppressTracing(t):function(...t){const n=$t(at());if(2===t.length){const[e,r]=t;return e?n.withSetScope(e,r):n.withScope(r)}return n.withScope(t[0])}((n=>(n.setSDKProcessingMetadata({[Wt]:!0}),t())))}function qt(t,n){const{fingerprint:e,span:r,breadcrumbs:o,sdkProcessingMetadata:s}=n;!function(t,n){const{extra:e,tags:r,user:o,contexts:s,level:i,transactionName:c}=n,u=j(e);u&&Object.keys(u).length&&(t.extra={...u,...t.extra});const a=j(r);a&&Object.keys(a).length&&(t.tags={...a,...t.tags});const f=j(o);f&&Object.keys(f).length&&(t.user={...f,...t.user});const h=j(s);h&&Object.keys(h).length&&(t.contexts={...h,...t.contexts});i&&(t.level=i);c&&"transaction"!==t.type&&(t.transaction=c)}(t,n),r&&function(t,n){t.contexts={trace:At(n),...t.contexts},t.sdkProcessingMetadata={dynamicSamplingContext:zt(n),...t.sdkProcessingMetadata};const e=Bt(n),r=Ut(e).description;r&&!t.transaction&&"transaction"===t.type&&(t.transaction=r)}(t,r),function(t,n){t.fingerprint=t.fingerprint?function(t){return Array.isArray(t)?t:[t]}(t.fingerprint):[],n&&(t.fingerprint=t.fingerprint.concat(n));t.fingerprint&&!t.fingerprint.length&&delete t.fingerprint}(t,e),function(t,n){const e=[...t.breadcrumbs||[],...n];t.breadcrumbs=e.length?e:void 0}(t,o),function(t,n){t.sdkProcessingMetadata={...t.sdkProcessingMetadata,...n}}(t,s)}const Ft="7";function Kt(t,n){return e={sentry_key:t.publicKey,sentry_version:Ft,...n&&{sentry_client:`${n.name}/${n.version}`}},Object.keys(e).map((t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`)).join("&");var e}const Vt=64;function Zt(t,n,e=V(t.bufferSize||Vt)){let r={};return{send:function(o){const s=[];if(X(o,((n,e)=>{const o=rt(e);if(function(t,n,e=Date.now()){return function(t,n){return t[n]||t.all||0}(t,n)>e}(r,o)){const r=Qt(n,e);t.recordDroppedEvent("ratelimit_backoff",o,r)}else s.push(n)})),0===s.length)return F({});const i=Q(o[0],s),c=n=>{X(i,((e,r)=>{const o=Qt(e,r);t.recordDroppedEvent(n,rt(r),o)}))};return e.add((()=>n({body:nt(i)}).then((t=>(void 0!==t.statusCode&&(t.statusCode<200||t.statusCode>=300)&&ut&&N.warn(`Sentry responded with status code ${t.statusCode} to sent event.`),r=it(r,t),t)),(t=>{throw c("network_error"),t})))).then((t=>t),(t=>{if(t instanceof C)return ut&&N.error("Skipped sending event because buffer is full."),c("queue_overflow"),F({});throw t}))},flush:t=>e.drain(t)}}function Qt(t,n){if("event"===n||"transaction"===n)return Array.isArray(t)?t[1]:void 0}const Xt=Symbol("AgentBaseInternalState");class tn extends s.Agent{[Xt];options;keepAlive;constructor(t){super(t),this[Xt]={}}isSecureEndpoint(t){if(t){if("boolean"==typeof t.secureEndpoint)return t.secureEndpoint;if("string"==typeof t.protocol)return"https:"===t.protocol}const{stack:n}=new Error;return"string"==typeof n&&n.split("\n").some((t=>-1!==t.indexOf("(https.js:")||-1!==t.indexOf("node:https:")))}createSocket(t,n,e){const r={...n,secureEndpoint:this.isSecureEndpoint(n)};Promise.resolve().then((()=>this.connect(t,r))).then((o=>{if(o instanceof s.Agent)return o.addRequest(t,r);this[Xt].currentSocket=o,super.createSocket(t,n,e)}),e)}createConnection(){const t=this[Xt].currentSocket;if(this[Xt].currentSocket=void 0,!t)throw new Error("No socket was returned in the `connect()` function");return t}get defaultPort(){return this[Xt].defaultPort??("https:"===this.protocol?443:80)}set defaultPort(t){this[Xt]&&(this[Xt].defaultPort=t)}get protocol(){return this[Xt].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(t){this[Xt]&&(this[Xt].protocol=t)}}function nn(...t){N.log("[https-proxy-agent:parse-proxy-response]",...t)}function en(t){return new Promise(((n,e)=>{let r=0;const o=[];function s(){const c=t.read();c?function(c){o.push(c),r+=c.length;const u=Buffer.concat(o,r),a=u.indexOf("\r\n\r\n");if(-1===a)return nn("have not received end of HTTP headers yet..."),void s();const f=u.slice(0,a).toString("ascii").split("\r\n"),h=f.shift();if(!h)return t.destroy(),e(new Error("No header received from proxy CONNECT response"));const p=h.split(" "),l=+p[1],d=p.slice(2).join(" "),m={};for(const n of f){if(!n)continue;const r=n.indexOf(":");if(-1===r)return t.destroy(),e(new Error(`Invalid header from proxy CONNECT response: "${n}"`));const o=n.slice(0,r).toLowerCase(),s=n.slice(r+1).trimStart(),i=m[o];"string"==typeof i?m[o]=[i,s]:Array.isArray(i)?i.push(s):m[o]=s}nn("got proxy server response: %o %o",h,m),i(),n({connect:{statusCode:l,statusText:d,headers:m},buffered:u})}(c):t.once("readable",s)}function i(){t.removeListener("end",c),t.removeListener("error",u),t.removeListener("readable",s)}function c(){i(),nn("onend"),e(new Error("Proxy connection ended before receiving CONNECT response"))}function u(t){i(),nn("onerror %o",t),e(t)}t.on("error",u),t.on("end",c),s()}))}function rn(...t){N.log("[https-proxy-agent]",...t)}class on extends tn{static protocols=["http","https"];proxy;proxyHeaders;connectOpts;constructor(t,n){super(n),this.options={},this.proxy="string"==typeof t?new URL(t):t,this.proxyHeaders=n?.headers??{},rn("Creating new HttpsProxyAgent instance: %o",this.proxy.href);const e=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),r=this.proxy.port?parseInt(this.proxy.port,10):"https:"===this.proxy.protocol?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...n?cn(n,"headers"):null,host:e,port:r}}async connect(t,n){const{proxy:e}=this;if(!n.host)throw new TypeError('No "host" provided');let r;if("https:"===e.protocol){rn("Creating `tls.Socket`: %o",this.connectOpts);const t=this.connectOpts.servername||this.connectOpts.host;r=f.connect({...this.connectOpts,servername:t&&a.isIP(t)?void 0:t})}else rn("Creating `net.Socket`: %o",this.connectOpts),r=a.connect(this.connectOpts);const o="function"==typeof this.proxyHeaders?this.proxyHeaders():{...this.proxyHeaders},s=a.isIPv6(n.host)?`[${n.host}]`:n.host;let i=`CONNECT ${s}:${n.port} HTTP/1.1\r\n`;if(e.username||e.password){const t=`${decodeURIComponent(e.username)}:${decodeURIComponent(e.password)}`;o["Proxy-Authorization"]=`Basic ${Buffer.from(t).toString("base64")}`}o.Host=`${s}:${n.port}`,o["Proxy-Connection"]||(o["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(const t of Object.keys(o))i+=`${t}: ${o[t]}\r\n`;const c=en(r);r.write(`${i}\r\n`);const{connect:u,buffered:h}=await c;if(t.emit("proxyConnect",u),this.emit("proxyConnect",u,t),200===u.statusCode){if(t.once("socket",sn),n.secureEndpoint){rn("Upgrading socket connection to TLS");const t=n.servername||n.host;return f.connect({...cn(n,"host","path","port"),socket:r,servername:a.isIP(t)?void 0:t})}return r}r.destroy();const p=new a.Socket({writable:!1});return p.readable=!0,t.once("socket",(t=>{rn("Replaying proxy buffer for failed request"),t.push(h),t.push(null)})),p}}function sn(t){t.resume()}function cn(t,...n){const e={};let r;for(r in t)n.includes(r)||(e[r]=t[r]);return e}const un=32768;function an(t){return t.replace(/^[A-Z]:/,"").replace(/\\/g,"/")}const fn=e;let hn,pn=!1;function ln(t){fn.debug&&console.log(`[ANR Worker] ${t}`)}var dn,mn,gn;const yn=function(t){let n;try{n=new URL(t.url)}catch(n){return x((()=>{console.warn("[@sentry/node]: Invalid dsn or tunnel option, will not send any events. The tunnel option must be a full URL when used.")})),Zt(t,(()=>Promise.resolve({})))}const e="https:"===n.protocol,r=function(t,n){const{no_proxy:e}=process.env;return e&&e.split(",").some((n=>t.host.endsWith(n)||t.hostname.endsWith(n)))?void 0:n}(n,t.proxy||(e?process.env.https_proxy:void 0)||process.env.http_proxy),o=e?i:s,a=void 0!==t.keepAlive&&t.keepAlive,f=r?new on(r):new o.Agent({keepAlive:a,maxSockets:30,timeout:2e3});return Yt((()=>{const n=function(t,n,e){const{hostname:r,pathname:o,port:s,protocol:i,search:a}=new URL(t.url);return function(f){return new Promise(((h,p)=>{let l=function(t){return new c({read(){this.push(t),this.push(null)}})}(f.body);const d={...t.headers};f.body.length>un&&(d["content-encoding"]="gzip",l=l.pipe(u()));const m=n.request({method:"POST",agent:e,headers:d,hostname:r,path:`${o}${a}`,port:s,protocol:i,ca:t.caCerts},(t=>{t.on("data",(()=>{})),t.on("end",(()=>{})),t.setEncoding("utf8");const n=t.headers["retry-after"]??null,e=t.headers["x-sentry-rate-limits"]??null;h({statusCode:t.statusCode,headers:{"retry-after":n,"x-sentry-rate-limits":Array.isArray(e)?e[0]:e}})}));m.on("error",p),l.pipe(m)}))}}(t,t.httpModule??o,f);return Zt(t,n)}))}({url:(dn=fn.dsn,mn=fn.tunnel,gn=fn.sdkMetadata.sdk,mn||`${function(t){return`${function(t){const n=t.protocol?`${t.protocol}:`:"",e=t.port?`:${t.port}`:"";return`${n}//${t.host}${e}${t.path?`/${t.path}`:""}/api/`}(t)}${t.projectId}/envelope/`}(dn)}?${Kt(dn,gn)}`),recordDroppedEvent:()=>{}});async function bn(){if(hn){ln("Sending abnormal session"),pt(hn,{status:"abnormal",abnormal_mechanism:"anr_foreground"});const t=function(t,n,e,r){const o=ot(e);return Q({sent_at:(new Date).toISOString(),...o&&{sdk:o},...!!r&&n&&{dsn:k(n)}},["aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()]])}(hn,fn.dsn,fn.sdkMetadata,fn.tunnel);ln(JSON.stringify(t)),await yn.send(t);try{n?.postMessage("session-ended")}catch(t){}}}function vn(t){if(!t)return;const n=function(t){if(!t.length)return[];const n=Array.from(t);return/sentryWrapped/.test(n[n.length-1].function||"")&&n.pop(),n.reverse(),P.test(n[n.length-1].function||"")&&(n.pop(),P.test(n[n.length-1].function||"")&&n.pop()),n.slice(0,A).map((t=>({...t,filename:t.filename||n[n.length-1].filename,function:t.function||I})))}(t);if(fn.appRootPath)for(const t of n)t.filename&&(t.filename=H(t.filename,fn.appRootPath));return n}async function _n(t,n){if(pn)return;pn=!0,await bn(),ln("Sending event");const e={event_id:G(),contexts:fn.contexts,release:fn.release,environment:fn.environment,dist:fn.dist,platform:"node",level:"error",exception:{values:[{type:"ApplicationNotResponding",value:`Application Not Responding for at least ${fn.anrThreshold} ms`,stacktrace:{frames:vn(t)},mechanism:{type:"ANR"}}]},tags:fn.staticTags};n&&function(t,n){if(qt(t,n),!t.contexts?.trace){const{traceId:e,spanId:r,parentSpanId:o}=n.propagationContext;t.contexts={trace:{trace_id:e,span_id:r,parent_span_id:o},...t.contexts}}}(e,n);const r=Ht(e,fn.dsn,fn.sdkMetadata,fn.tunnel);ln(JSON.stringify(r)),await yn.send(r),await yn.flush(2e3),setTimeout((()=>{process.exit(0)}),5e3)}let wn;if(ln("Started"),fn.captureStackTrace){ln("Connecting to debugger");const n=new t;n.connectToMainThread(),ln("Connected to debugger");const e=new Map;n.on("Debugger.scriptParsed",(t=>{e.set(t.params.scriptId,t.params.url)})),n.on("Debugger.paused",(t=>{if("other"===t.params.reason)try{ln("Debugger paused");const s=[...t.params.callFrames],i=fn.appRootPath?function(t=(process.argv[1]?Y(process.argv[1]):process.cwd()),n="\\"===o){const e=n?an(t):t;return t=>{if(!t)return;const o=n?an(t):t;let{dir:s,base:i,ext:c}=r.parse(o);".js"!==c&&".mjs"!==c&&".cjs"!==c||(i=i.slice(0,-1*c.length)),s||(s=".");const u=s.lastIndexOf("/node_modules");if(u>-1)return`${s.slice(u+14).replace(/\//g,".")}:${i}`;if(s.startsWith(e)){let t=s.slice(e.length+1).replace(/\//g,".");return t&&(t+=":"),t+=i,t}return i}}(fn.appRootPath):()=>{},c=s.map((t=>function(t,n,e){const r=n?n.replace(/^file:\/\//,""):void 0,o=t.location.columnNumber?t.location.columnNumber+1:void 0,s=t.location.lineNumber?t.location.lineNumber+1:void 0;return j({filename:r,module:e(r),function:t.functionName||I,colno:o,lineno:s,in_app:r?Z(r):void 0})}(t,e.get(t.location.scriptId),i))),u=setTimeout((()=>{_n(c).then(null,(()=>{ln("Sending ANR event failed.")}))}),5e3);n.post("Runtime.evaluate",{expression:"global.__SENTRY_GET_SCOPES__();",silent:!0,returnByValue:!0},((t,e)=>{t&&ln(`Error executing script: '${t.message}'`),clearTimeout(u);const r=e&&e.result?e.result.value:void 0;n.post("Debugger.resume"),n.post("Debugger.disable"),_n(c,r).then(null,(()=>{ln("Sending ANR event failed.")}))}))}catch(t){throw n.post("Debugger.resume"),n.post("Debugger.disable"),t}})),wn=()=>{try{n.post("Debugger.enable",(()=>{n.post("Debugger.pause")}))}catch(t){}}}const{poll:Sn}=function(t,n,e,r){const o=t();let s=!1,i=!0;return setInterval((()=>{const t=o.getTimeMs();!1===s&&t>n+e&&(s=!0,i&&r()),t<n+e&&(s=!1)}),20),{poll:()=>{o.reset()},enabled:t=>{i=t}}}((function(){let t=process.hrtime();return{getTimeMs:()=>{const[n,e]=process.hrtime(t);return Math.floor(1e3*n+e/1e6)},reset:()=>{t=process.hrtime()}}}),fn.pollInterval,fn.anrThreshold,(function(){ln("Watchdog timeout"),wn?(ln("Pausing debugger to capture stack trace"),wn()):(ln("Capturing event without a stack trace"),_n().then(null,(()=>{ln("Sending ANR event failed on watchdog timeout.")})))}));n?.on("message",(t=>{t.session&&(hn=ht(t.session)),Sn()}));
|
|
@@ -5,7 +5,7 @@ import { LRUMap, logger } from '@sentry/utils';
|
|
|
5
5
|
import { hashFrames, functionNamesMatch } from './common.js';
|
|
6
6
|
|
|
7
7
|
// This string is a placeholder that gets overwritten with the worker code.
|
|
8
|
-
const base64WorkerScript = '
|
|
8
|
+
const base64WorkerScript = 'LyohIEBzZW50cnkvbm9kZSA4LjkuMCAoNTA0M2FmNykgfCBodHRwczovL2d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F1c2VPbkV4Y2VwdGlvbnMiLHtzdGF0ZTpyPyJhbGwiOiJ1bmNhdWdodCJ9KSxyKXtjb25zdCBlPWcubWF4RXhjZXB0aW9uc1BlclNlY29uZHx8NTA7aD1mdW5jdGlvbihlLG4sdCl7bGV0IG89MCxyPTUsaT0wO3JldHVybiBzZXRJbnRlcnZhbCgoKCk9PnswPT09aT9vPmUmJihyKj0yLHQocikscj44NjQwMCYmKHI9ODY0MDApLGk9cik6KGktPTEsMD09PWkmJm4oKSksbz0wfSksMWUzKS51bnJlZigpLCgpPT57bys9MX19KGUsKGFzeW5jKCk9PntiKCJSYXRlLWxpbWl0IGxpZnRlZC4iKSxhd2FpdCBuLnBvc3QoIkRlYnVnZ2VyLnNldFBhdXNlT25FeGNlcHRpb25zIix7c3RhdGU6ImFsbCJ9KX0pLChhc3luYyBlPT57YihgUmF0ZS1saW1pdCBleGNlZWRlZC4gRGlzYWJsaW5nIGNhcHR1cmluZyBvZiBjYXVnaHQgZXhjZXB0aW9ucyBmb3IgJHtlfSBzZWNvbmRzLmApLGF3YWl0IG4ucG9zdCgiRGVidWdnZXIuc2V0UGF1c2VPbkV4Y2VwdGlvbnMiLHtzdGF0ZToidW5jYXVnaHQifSl9KSl9fSkoKS5jYXRjaCgoZT0+e2IoIkZhaWxlZCB0byBzdGFydCBkZWJ1Z2dlciIsZSl9KSksc2V0SW50ZXJ2YWwoKCgpPT57fSksMWU0KTs=';
|
|
9
9
|
|
|
10
10
|
function log(...args) {
|
|
11
11
|
logger.log('[LocalVariables]', ...args);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! @sentry/node 8.
|
|
1
|
+
/*! @sentry/node 8.9.0 (5043af7) | https://github.com/getsentry/sentry-javascript */
|
|
2
2
|
import{Session as e}from"node:inspector/promises";import{workerData as n,parentPort as t}from"node:worker_threads";import{posix as o,sep as r}from"node:path";const i=50,s="?",c=/\(error: (.*)\)/,a=/captureMessage|captureException/;const u=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function f(e){const n=function(e){const n=e.length>1024?`<truncated>${e.slice(-1024)}`:e,t=u.exec(n);return t?t.slice(1):[]}(e),t=n[0];let o=n[1];return t||o?(o&&(o=o.slice(0,o.length-1)),t+o):"."}function l(e,n=!1){return!(n||e&&!e.startsWith("/")&&!e.match(/^[A-Z]:/)&&!e.startsWith(".")&&!e.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//))&&void 0!==e&&!e.includes("node_modules/")}function d(e){const n=/^\s*[-]{4,}$/,t=/at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;return o=>{const r=o.match(t);if(r){let n,t,o,i,c;if(r[1]){o=r[1];let e=o.lastIndexOf(".");if("."===o[e-1]&&e--,e>0){n=o.slice(0,e),t=o.slice(e+1);const r=n.indexOf(".Module");r>0&&(o=o.slice(r+1),n=n.slice(0,r))}i=void 0}t&&(i=n,c=t),"<anonymous>"===t&&(c=void 0,o=void 0),void 0===o&&(c=c||s,o=i?`${i}.${c}`:c);let a=r[2]&&r[2].startsWith("file://")?r[2].slice(7):r[2];const u="native"===r[5];return a&&a.match(/\/[A-Z]:/)&&(a=a.slice(1)),a||!r[5]||u||(a=r[5]),{filename:a,module:e?e(a):void 0,function:o,lineno:parseInt(r[3],10)||void 0,colno:parseInt(r[4],10)||void 0,in_app:l(a,u)}}if(o.match(n))return{filename:o}}}function p(e){return e.replace(/^[A-Z]:/,"").replace(/\\/g,"/")}const g=n,m=function(...e){const n=e.sort(((e,n)=>e[0]-n[0])).map((e=>e[1]));return(e,t=0,o=0)=>{const r=[],u=e.split("\n");for(let e=t;e<u.length;e++){const t=u[e];if(t.length>1024)continue;const s=c.test(t)?t.replace(c,"$1"):t;if(!s.match(/\S*Error: /)){for(const e of n){const n=e(s);if(n){r.push(n);break}}if(r.length>=i+o)break}}return function(e){if(!e.length)return[];const n=Array.from(e);/sentryWrapped/.test(n[n.length-1].function||"")&&n.pop();n.reverse(),a.test(n[n.length-1].function||"")&&(n.pop(),a.test(n[n.length-1].function||"")&&n.pop());return n.slice(0,i).map((e=>({...e,filename:e.filename||n[n.length-1].filename,function:e.function||s})))}(r.slice(o))}}([90,d(function(e=(process.argv[1]?f(process.argv[1]):process.cwd()),n="\\"===r){const t=n?p(e):e;return e=>{if(!e)return;const r=n?p(e):e;let{dir:i,base:s,ext:c}=o.parse(r);".js"!==c&&".mjs"!==c&&".cjs"!==c||(s=s.slice(0,-1*c.length)),i||(i=".");const a=i.lastIndexOf("/node_modules");if(a>-1)return`${i.slice(a+14).replace(/\//g,".")}:${s}`;if(i.startsWith(t)){let e=i.slice(t.length+1).replace(/\//g,".");return e&&(e+=":"),e+=s,e}return s}}(g.basePath))]);function b(...e){g.debug&&console.log("[LocalVariables Worker]",...e)}async function v(e,n,t,o){const r=await e.post("Runtime.getProperties",{objectId:n,ownProperties:!0});o[t]=r.result.filter((e=>"length"!==e.name&&!isNaN(parseInt(e.name,10)))).sort(((e,n)=>parseInt(e.name,10)-parseInt(n.name,10))).map((e=>e.value?.value))}async function $(e,n,t,o){const r=await e.post("Runtime.getProperties",{objectId:n,ownProperties:!0});o[t]=r.result.map((e=>[e.name,e.value?.value])).reduce(((e,[n,t])=>(e[n]=t,e)),{})}function w(e,n){e.value&&("value"in e.value?void 0===e.value.value||null===e.value.value?n[e.name]=`<${e.value.value}>`:n[e.name]=e.value.value:"description"in e.value&&"function"!==e.value.type?n[e.name]=`<${e.value.description}>`:"undefined"===e.value.type&&(n[e.name]="<undefined>"))}async function y(e,n){const t=await e.post("Runtime.getProperties",{objectId:n,ownProperties:!0}),o={};for(const n of t.result)if(n?.value?.objectId&&"Array"===n?.value.className){const t=n.value.objectId;await v(e,t,n.name,o)}else if(n?.value?.objectId&&"Object"===n?.value?.className){const t=n.value.objectId;await $(e,t,n.name,o)}else n?.value&&w(n,o);return o}let h;(async function(){const n=new e;n.connectToMainThread(),b("Connected to main thread");let o=!1;n.on("Debugger.resumed",(()=>{o=!1})),n.on("Debugger.paused",(e=>{o=!0,async function(e,n,{reason:o,data:r,callFrames:i}){if("exception"!==o&&"promiseRejection"!==o)return;h?.();const s=function(e,n){if(void 0!==n)return function(e){if(void 0!==e)return e.slice(-10).reduce(((e,n)=>`${e},${n.function},${n.lineno},${n.colno}`),"")}(e(n,1))}(n,r?.description);if(null==s)return;const c=[];for(let n=0;n<i.length;n++){const{scopeChain:t,functionName:o,this:r}=i[n],s=t.find((e=>"local"===e.type)),a="global"!==r.className&&r.className?`${r.className}.${o}`:o;if(void 0===s?.object.objectId)c[n]={function:a};else{const t=await y(e,s.object.objectId);c[n]={function:a,vars:t}}}t?.postMessage({exceptionHash:s,frames:c})}(n,m,e.params).then((()=>o?n.post("Debugger.resume"):Promise.resolve()),(e=>{}))})),await n.post("Debugger.enable");const r=!1!==g.captureAllExceptions;if(await n.post("Debugger.setPauseOnExceptions",{state:r?"all":"uncaught"}),r){const e=g.maxExceptionsPerSecond||50;h=function(e,n,t){let o=0,r=5,i=0;return setInterval((()=>{0===i?o>e&&(r*=2,t(r),r>86400&&(r=86400),i=r):(i-=1,0===i&&n()),o=0}),1e3).unref(),()=>{o+=1}}(e,(async()=>{b("Rate-limit lifted."),await n.post("Debugger.setPauseOnExceptions",{state:"all"})}),(async e=>{b(`Rate-limit exceeded. Disabling capturing of caught exceptions for ${e} seconds.`),await n.post("Debugger.setPauseOnExceptions",{state:"uncaught"})}))}})().catch((e=>{b("Failed to start debugger",e)})),setInterval((()=>{}),1e4);
|
|
@@ -11,7 +11,7 @@ import { mysqlIntegration, instrumentMysql } from './mysql.js';
|
|
|
11
11
|
import { mysql2Integration, instrumentMysql2 } from './mysql2.js';
|
|
12
12
|
import { nestIntegration, instrumentNest } from './nest.js';
|
|
13
13
|
import { postgresIntegration, instrumentPostgres } from './postgres.js';
|
|
14
|
-
import { redisIntegration } from './redis.js';
|
|
14
|
+
import { redisIntegration, instrumentRedis } from './redis.js';
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* With OTEL, all performance integrations will be added, as OTEL only initializes them when the patched package is actually required.
|
|
@@ -58,6 +58,7 @@ function getOpenTelemetryInstrumentationToPreload() {
|
|
|
58
58
|
instrumentPostgres,
|
|
59
59
|
instrumentHapi,
|
|
60
60
|
instrumentGraphql,
|
|
61
|
+
instrumentRedis,
|
|
61
62
|
];
|
|
62
63
|
}
|
|
63
64
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/integrations/tracing/index.ts"],"sourcesContent":["import type { Integration } from '@sentry/types';\nimport { instrumentHttp } from '../http';\n\nimport { connectIntegration, instrumentConnect } from './connect';\nimport { expressIntegration, instrumentExpress } from './express';\nimport { fastifyIntegration, instrumentFastify } from './fastify';\nimport { graphqlIntegration, instrumentGraphql } from './graphql';\nimport { hapiIntegration, instrumentHapi } from './hapi';\nimport { instrumentKoa, koaIntegration } from './koa';\nimport { instrumentMongo, mongoIntegration } from './mongo';\nimport { instrumentMongoose, mongooseIntegration } from './mongoose';\nimport { instrumentMysql, mysqlIntegration } from './mysql';\nimport { instrumentMysql2, mysql2Integration } from './mysql2';\nimport { instrumentNest, nestIntegration } from './nest';\nimport { instrumentPostgres, postgresIntegration } from './postgres';\nimport { redisIntegration } from './redis';\n\n/**\n * With OTEL, all performance integrations will be added, as OTEL only initializes them when the patched package is actually required.\n */\nexport function getAutoPerformanceIntegrations(): Integration[] {\n return [\n expressIntegration(),\n fastifyIntegration(),\n graphqlIntegration(),\n mongoIntegration(),\n mongooseIntegration(),\n mysqlIntegration(),\n mysql2Integration(),\n redisIntegration(),\n postgresIntegration(),\n // For now, we do not include prisma by default because it has ESM issues\n // See https://github.com/prisma/prisma/issues/23410\n // TODO v8: Figure out a better solution for this, maybe only disable in ESM mode?\n // prismaIntegration(),\n nestIntegration(),\n hapiIntegration(),\n koaIntegration(),\n connectIntegration(),\n ];\n}\n\n/**\n * Get a list of methods to instrument OTEL, when preload instrumentation.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function getOpenTelemetryInstrumentationToPreload(): (((options?: any) => void) & { id: string })[] {\n return [\n instrumentHttp,\n instrumentExpress,\n instrumentConnect,\n instrumentFastify,\n instrumentHapi,\n instrumentKoa,\n instrumentNest,\n instrumentMongo,\n instrumentMongoose,\n instrumentMysql,\n instrumentMysql2,\n instrumentPostgres,\n instrumentHapi,\n instrumentGraphql,\n ];\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAiBA;AACA;AACA;AACO,SAAS,8BAA8B,GAAkB;AAChE,EAAE,OAAO;AACT,IAAI,kBAAkB,EAAE;AACxB,IAAI,kBAAkB,EAAE;AACxB,IAAI,kBAAkB,EAAE;AACxB,IAAI,gBAAgB,EAAE;AACtB,IAAI,mBAAmB,EAAE;AACzB,IAAI,gBAAgB,EAAE;AACtB,IAAI,iBAAiB,EAAE;AACvB,IAAI,gBAAgB,EAAE;AACtB,IAAI,mBAAmB,EAAE;AACzB;AACA;AACA;AACA;AACA,IAAI,eAAe,EAAE;AACrB,IAAI,eAAe,EAAE;AACrB,IAAI,cAAc,EAAE;AACpB,IAAI,kBAAkB,EAAE;AACxB,GAAG,CAAA;AACH,CAAA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,wCAAwC,GAAmD;AAC3G,EAAE,OAAO;AACT,IAAI,cAAc;AAClB,IAAI,iBAAiB;AACrB,IAAI,iBAAiB;AACrB,IAAI,iBAAiB;AACrB,IAAI,cAAc;AAClB,IAAI,aAAa;AACjB,IAAI,cAAc;AAClB,IAAI,eAAe;AACnB,IAAI,kBAAkB;AACtB,IAAI,eAAe;AACnB,IAAI,gBAAgB;AACpB,IAAI,kBAAkB;AACtB,IAAI,cAAc;AAClB,IAAI,iBAAiB;AACrB,GAAG,CAAA;AACH;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/integrations/tracing/index.ts"],"sourcesContent":["import type { Integration } from '@sentry/types';\nimport { instrumentHttp } from '../http';\n\nimport { connectIntegration, instrumentConnect } from './connect';\nimport { expressIntegration, instrumentExpress } from './express';\nimport { fastifyIntegration, instrumentFastify } from './fastify';\nimport { graphqlIntegration, instrumentGraphql } from './graphql';\nimport { hapiIntegration, instrumentHapi } from './hapi';\nimport { instrumentKoa, koaIntegration } from './koa';\nimport { instrumentMongo, mongoIntegration } from './mongo';\nimport { instrumentMongoose, mongooseIntegration } from './mongoose';\nimport { instrumentMysql, mysqlIntegration } from './mysql';\nimport { instrumentMysql2, mysql2Integration } from './mysql2';\nimport { instrumentNest, nestIntegration } from './nest';\nimport { instrumentPostgres, postgresIntegration } from './postgres';\nimport { instrumentRedis, redisIntegration } from './redis';\n\n/**\n * With OTEL, all performance integrations will be added, as OTEL only initializes them when the patched package is actually required.\n */\nexport function getAutoPerformanceIntegrations(): Integration[] {\n return [\n expressIntegration(),\n fastifyIntegration(),\n graphqlIntegration(),\n mongoIntegration(),\n mongooseIntegration(),\n mysqlIntegration(),\n mysql2Integration(),\n redisIntegration(),\n postgresIntegration(),\n // For now, we do not include prisma by default because it has ESM issues\n // See https://github.com/prisma/prisma/issues/23410\n // TODO v8: Figure out a better solution for this, maybe only disable in ESM mode?\n // prismaIntegration(),\n nestIntegration(),\n hapiIntegration(),\n koaIntegration(),\n connectIntegration(),\n ];\n}\n\n/**\n * Get a list of methods to instrument OTEL, when preload instrumentation.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function getOpenTelemetryInstrumentationToPreload(): (((options?: any) => void) & { id: string })[] {\n return [\n instrumentHttp,\n instrumentExpress,\n instrumentConnect,\n instrumentFastify,\n instrumentHapi,\n instrumentKoa,\n instrumentNest,\n instrumentMongo,\n instrumentMongoose,\n instrumentMysql,\n instrumentMysql2,\n instrumentPostgres,\n instrumentHapi,\n instrumentGraphql,\n instrumentRedis,\n ];\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAiBA;AACA;AACA;AACO,SAAS,8BAA8B,GAAkB;AAChE,EAAE,OAAO;AACT,IAAI,kBAAkB,EAAE;AACxB,IAAI,kBAAkB,EAAE;AACxB,IAAI,kBAAkB,EAAE;AACxB,IAAI,gBAAgB,EAAE;AACtB,IAAI,mBAAmB,EAAE;AACzB,IAAI,gBAAgB,EAAE;AACtB,IAAI,iBAAiB,EAAE;AACvB,IAAI,gBAAgB,EAAE;AACtB,IAAI,mBAAmB,EAAE;AACzB;AACA;AACA;AACA;AACA,IAAI,eAAe,EAAE;AACrB,IAAI,eAAe,EAAE;AACrB,IAAI,cAAc,EAAE;AACpB,IAAI,kBAAkB,EAAE;AACxB,GAAG,CAAA;AACH,CAAA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,wCAAwC,GAAmD;AAC3G,EAAE,OAAO;AACT,IAAI,cAAc;AAClB,IAAI,iBAAiB;AACrB,IAAI,iBAAiB;AACrB,IAAI,iBAAiB;AACrB,IAAI,cAAc;AAClB,IAAI,aAAa;AACjB,IAAI,cAAc;AAClB,IAAI,eAAe;AACnB,IAAI,kBAAkB;AACtB,IAAI,eAAe;AACnB,IAAI,gBAAgB;AACpB,IAAI,kBAAkB;AACtB,IAAI,cAAc;AAClB,IAAI,iBAAiB;AACrB,IAAI,eAAe;AACnB,GAAG,CAAA;AACH;;;;"}
|
|
@@ -1,71 +1,89 @@
|
|
|
1
1
|
import { _optionalChain } from '@sentry/utils';
|
|
2
2
|
import { IORedisInstrumentation } from '@opentelemetry/instrumentation-ioredis';
|
|
3
|
+
import { RedisInstrumentation } from '@opentelemetry/instrumentation-redis-4';
|
|
3
4
|
import { defineIntegration, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE, SEMANTIC_ATTRIBUTE_CACHE_HIT, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_CACHE_KEY, spanToJSON } from '@sentry/core';
|
|
5
|
+
import { truncate } from '@sentry/utils';
|
|
4
6
|
import { generateInstrumentOnce } from '../../otel/instrument.js';
|
|
5
|
-
import { getCacheKeySafely, getCacheOperation, shouldConsiderForCache, calculateCacheItemSize, GET_COMMANDS } from '../../utils/redisCache.js';
|
|
7
|
+
import { getCacheKeySafely, getCacheOperation, shouldConsiderForCache, calculateCacheItemSize, isInCommands, GET_COMMANDS } from '../../utils/redisCache.js';
|
|
6
8
|
|
|
7
9
|
const INTEGRATION_NAME = 'Redis';
|
|
8
10
|
|
|
9
11
|
let _redisOptions = {};
|
|
10
12
|
|
|
11
|
-
const
|
|
13
|
+
const cacheResponseHook = (span, redisCommand, cmdArgs, response) => {
|
|
14
|
+
span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, 'auto.db.otel.redis');
|
|
15
|
+
|
|
16
|
+
const safeKey = getCacheKeySafely(redisCommand, cmdArgs);
|
|
17
|
+
const cacheOperation = getCacheOperation(redisCommand);
|
|
18
|
+
|
|
19
|
+
if (
|
|
20
|
+
!safeKey ||
|
|
21
|
+
!cacheOperation ||
|
|
22
|
+
!_optionalChain([_redisOptions, 'optionalAccess', _ => _.cachePrefixes]) ||
|
|
23
|
+
!shouldConsiderForCache(redisCommand, safeKey, _redisOptions.cachePrefixes)
|
|
24
|
+
) {
|
|
25
|
+
// not relevant for cache
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// otel/ioredis seems to be using the old standard, as there was a change to those params: https://github.com/open-telemetry/opentelemetry-specification/issues/3199
|
|
30
|
+
// We are using params based on the docs: https://opentelemetry.io/docs/specs/semconv/attributes-registry/network/
|
|
31
|
+
const networkPeerAddress = _optionalChain([spanToJSON, 'call', _2 => _2(span), 'access', _3 => _3.data, 'optionalAccess', _4 => _4['net.peer.name']]);
|
|
32
|
+
const networkPeerPort = _optionalChain([spanToJSON, 'call', _5 => _5(span), 'access', _6 => _6.data, 'optionalAccess', _7 => _7['net.peer.port']]);
|
|
33
|
+
if (networkPeerPort && networkPeerAddress) {
|
|
34
|
+
span.setAttributes({ 'network.peer.address': networkPeerAddress, 'network.peer.port': networkPeerPort });
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const cacheItemSize = calculateCacheItemSize(response);
|
|
38
|
+
|
|
39
|
+
if (cacheItemSize) {
|
|
40
|
+
span.setAttribute(SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE, cacheItemSize);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (isInCommands(GET_COMMANDS, redisCommand) && cacheItemSize !== undefined) {
|
|
44
|
+
span.setAttribute(SEMANTIC_ATTRIBUTE_CACHE_HIT, cacheItemSize > 0);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
span.setAttributes({
|
|
48
|
+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: cacheOperation,
|
|
49
|
+
[SEMANTIC_ATTRIBUTE_CACHE_KEY]: safeKey,
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
const spanDescription = safeKey.join(', ');
|
|
53
|
+
|
|
54
|
+
span.updateName(truncate(spanDescription, 1024));
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const instrumentIORedis = generateInstrumentOnce('IORedis', () => {
|
|
12
58
|
return new IORedisInstrumentation({
|
|
13
|
-
responseHook:
|
|
14
|
-
span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, 'auto.db.otel.redis');
|
|
15
|
-
|
|
16
|
-
const safeKey = getCacheKeySafely(redisCommand, cmdArgs);
|
|
17
|
-
const cacheOperation = getCacheOperation(redisCommand);
|
|
18
|
-
|
|
19
|
-
if (
|
|
20
|
-
!safeKey ||
|
|
21
|
-
!cacheOperation ||
|
|
22
|
-
!_optionalChain([_redisOptions, 'optionalAccess', _ => _.cachePrefixes]) ||
|
|
23
|
-
!shouldConsiderForCache(redisCommand, safeKey, _redisOptions.cachePrefixes)
|
|
24
|
-
) {
|
|
25
|
-
// not relevant for cache
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// otel/ioredis seems to be using the old standard, as there was a change to those params: https://github.com/open-telemetry/opentelemetry-specification/issues/3199
|
|
30
|
-
// We are using params based on the docs: https://opentelemetry.io/docs/specs/semconv/attributes-registry/network/
|
|
31
|
-
const networkPeerAddress = _optionalChain([spanToJSON, 'call', _2 => _2(span), 'access', _3 => _3.data, 'optionalAccess', _4 => _4['net.peer.name']]);
|
|
32
|
-
const networkPeerPort = _optionalChain([spanToJSON, 'call', _5 => _5(span), 'access', _6 => _6.data, 'optionalAccess', _7 => _7['net.peer.port']]);
|
|
33
|
-
if (networkPeerPort && networkPeerAddress) {
|
|
34
|
-
span.setAttributes({ 'network.peer.address': networkPeerAddress, 'network.peer.port': networkPeerPort });
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const cacheItemSize = calculateCacheItemSize(response);
|
|
38
|
-
|
|
39
|
-
if (cacheItemSize) {
|
|
40
|
-
span.setAttribute(SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE, cacheItemSize);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (GET_COMMANDS.includes(redisCommand) && cacheItemSize !== undefined) {
|
|
44
|
-
span.setAttribute(SEMANTIC_ATTRIBUTE_CACHE_HIT, cacheItemSize > 0);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
span.setAttributes({
|
|
48
|
-
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: cacheOperation,
|
|
49
|
-
[SEMANTIC_ATTRIBUTE_CACHE_KEY]: safeKey,
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
const spanDescription = safeKey.join(', ');
|
|
53
|
-
|
|
54
|
-
span.updateName(spanDescription.length > 1024 ? `${spanDescription.substring(0, 1024)}...` : spanDescription);
|
|
55
|
-
},
|
|
59
|
+
responseHook: cacheResponseHook,
|
|
56
60
|
});
|
|
57
61
|
});
|
|
58
62
|
|
|
63
|
+
const instrumentRedis4 = generateInstrumentOnce('Redis-4', () => {
|
|
64
|
+
return new RedisInstrumentation({
|
|
65
|
+
responseHook: cacheResponseHook,
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
/** To be able to preload all Redis OTel instrumentations with just one ID ("Redis"), all the instrumentations are generated in this one function */
|
|
70
|
+
const instrumentRedis = Object.assign(
|
|
71
|
+
() => {
|
|
72
|
+
instrumentIORedis();
|
|
73
|
+
instrumentRedis4();
|
|
74
|
+
|
|
75
|
+
// todo: implement them gradually
|
|
76
|
+
// new LegacyRedisInstrumentation({}),
|
|
77
|
+
},
|
|
78
|
+
{ id: INTEGRATION_NAME },
|
|
79
|
+
);
|
|
80
|
+
|
|
59
81
|
const _redisIntegration = ((options = {}) => {
|
|
60
82
|
return {
|
|
61
83
|
name: INTEGRATION_NAME,
|
|
62
84
|
setupOnce() {
|
|
63
85
|
_redisOptions = options;
|
|
64
86
|
instrumentRedis();
|
|
65
|
-
|
|
66
|
-
// todo: implement them gradually
|
|
67
|
-
// new LegacyRedisInstrumentation({}),
|
|
68
|
-
// new RedisInstrumentation({}),
|
|
69
87
|
},
|
|
70
88
|
};
|
|
71
89
|
}) ;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redis.js","sources":["../../../../src/integrations/tracing/redis.ts"],"sourcesContent":["import { IORedisInstrumentation } from '@opentelemetry/instrumentation-ioredis';\nimport {\n SEMANTIC_ATTRIBUTE_CACHE_HIT,\n SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE,\n SEMANTIC_ATTRIBUTE_CACHE_KEY,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n defineIntegration,\n spanToJSON,\n} from '@sentry/core';\nimport type { IntegrationFn } from '@sentry/types';\nimport { generateInstrumentOnce } from '../../otel/instrument';\nimport {\n GET_COMMANDS,\n calculateCacheItemSize,\n getCacheKeySafely,\n getCacheOperation,\n shouldConsiderForCache,\n} from '../../utils/redisCache';\n\ninterface RedisOptions {\n cachePrefixes?: string[];\n}\n\nconst INTEGRATION_NAME = 'Redis';\n\nlet _redisOptions: RedisOptions = {};\n\nexport const instrumentRedis = generateInstrumentOnce(INTEGRATION_NAME, () => {\n return new IORedisInstrumentation({\n responseHook: (span, redisCommand, cmdArgs, response) => {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, 'auto.db.otel.redis');\n\n const safeKey = getCacheKeySafely(redisCommand, cmdArgs);\n const cacheOperation = getCacheOperation(redisCommand);\n\n if (\n !safeKey ||\n !cacheOperation ||\n !_redisOptions?.cachePrefixes ||\n !shouldConsiderForCache(redisCommand, safeKey, _redisOptions.cachePrefixes)\n ) {\n // not relevant for cache\n return;\n }\n\n // otel/ioredis seems to be using the old standard, as there was a change to those params: https://github.com/open-telemetry/opentelemetry-specification/issues/3199\n // We are using params based on the docs: https://opentelemetry.io/docs/specs/semconv/attributes-registry/network/\n const networkPeerAddress = spanToJSON(span).data?.['net.peer.name'];\n const networkPeerPort = spanToJSON(span).data?.['net.peer.port'];\n if (networkPeerPort && networkPeerAddress) {\n span.setAttributes({ 'network.peer.address': networkPeerAddress, 'network.peer.port': networkPeerPort });\n }\n\n const cacheItemSize = calculateCacheItemSize(response);\n\n if (cacheItemSize) {\n span.setAttribute(SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE, cacheItemSize);\n }\n\n if (GET_COMMANDS.includes(redisCommand) && cacheItemSize !== undefined) {\n span.setAttribute(SEMANTIC_ATTRIBUTE_CACHE_HIT, cacheItemSize > 0);\n }\n\n span.setAttributes({\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: cacheOperation,\n [SEMANTIC_ATTRIBUTE_CACHE_KEY]: safeKey,\n });\n\n const spanDescription = safeKey.join(', ');\n\n span.updateName(spanDescription.length > 1024 ? `${spanDescription.substring(0, 1024)}...` : spanDescription);\n },\n });\n});\n\nconst _redisIntegration = ((options: RedisOptions = {}) => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n _redisOptions = options;\n instrumentRedis();\n\n // todo: implement them gradually\n // new LegacyRedisInstrumentation({}),\n // new RedisInstrumentation({}),\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Redis integration for \"ioredis\"\n *\n * Capture tracing data for redis and ioredis.\n */\nexport const redisIntegration = defineIntegration(_redisIntegration);\n"],"names":[],"mappings":";;;;;;AAwBA,CAAM,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAmB,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO;;AAEhC,CAAI,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAA8B,EAAA,CAAA,CAAE;;AAE7B,CAAA,CAAA,CAAA,CAAA,EAAM,gBAAkB,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAsB,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAgB,EAAE,CAAM,EAAA,CAAA,EAAA;EAC5E,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,CAAI,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAsB,CAAC;IAChC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,EAAE,CAAC,CAAI,CAAA,CAAA,CAAA,EAAE,YAAY,EAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,EAAE,CAAA,CAAA,CAAA,CAA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A,CAAA,CAAA,CAAA,CAAA,CAAA;CACA;CACA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;CACA,CAAA;AACA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;"}
|
|
1
|
+
{"version":3,"file":"redis.js","sources":["../../../../src/integrations/tracing/redis.ts"],"sourcesContent":["import type { Span } from '@opentelemetry/api';\nimport type { RedisResponseCustomAttributeFunction } from '@opentelemetry/instrumentation-ioredis';\nimport { IORedisInstrumentation } from '@opentelemetry/instrumentation-ioredis';\nimport { RedisInstrumentation } from '@opentelemetry/instrumentation-redis-4';\nimport {\n SEMANTIC_ATTRIBUTE_CACHE_HIT,\n SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE,\n SEMANTIC_ATTRIBUTE_CACHE_KEY,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n defineIntegration,\n spanToJSON,\n} from '@sentry/core';\nimport type { IntegrationFn } from '@sentry/types';\nimport { truncate } from '@sentry/utils';\nimport { generateInstrumentOnce } from '../../otel/instrument';\nimport {\n GET_COMMANDS,\n calculateCacheItemSize,\n getCacheKeySafely,\n getCacheOperation,\n isInCommands,\n shouldConsiderForCache,\n} from '../../utils/redisCache';\n\ninterface RedisOptions {\n cachePrefixes?: string[];\n}\n\nconst INTEGRATION_NAME = 'Redis';\n\nlet _redisOptions: RedisOptions = {};\n\nconst cacheResponseHook: RedisResponseCustomAttributeFunction = (span: Span, redisCommand, cmdArgs, response) => {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, 'auto.db.otel.redis');\n\n const safeKey = getCacheKeySafely(redisCommand, cmdArgs);\n const cacheOperation = getCacheOperation(redisCommand);\n\n if (\n !safeKey ||\n !cacheOperation ||\n !_redisOptions?.cachePrefixes ||\n !shouldConsiderForCache(redisCommand, safeKey, _redisOptions.cachePrefixes)\n ) {\n // not relevant for cache\n return;\n }\n\n // otel/ioredis seems to be using the old standard, as there was a change to those params: https://github.com/open-telemetry/opentelemetry-specification/issues/3199\n // We are using params based on the docs: https://opentelemetry.io/docs/specs/semconv/attributes-registry/network/\n const networkPeerAddress = spanToJSON(span).data?.['net.peer.name'];\n const networkPeerPort = spanToJSON(span).data?.['net.peer.port'];\n if (networkPeerPort && networkPeerAddress) {\n span.setAttributes({ 'network.peer.address': networkPeerAddress, 'network.peer.port': networkPeerPort });\n }\n\n const cacheItemSize = calculateCacheItemSize(response);\n\n if (cacheItemSize) {\n span.setAttribute(SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE, cacheItemSize);\n }\n\n if (isInCommands(GET_COMMANDS, redisCommand) && cacheItemSize !== undefined) {\n span.setAttribute(SEMANTIC_ATTRIBUTE_CACHE_HIT, cacheItemSize > 0);\n }\n\n span.setAttributes({\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: cacheOperation,\n [SEMANTIC_ATTRIBUTE_CACHE_KEY]: safeKey,\n });\n\n const spanDescription = safeKey.join(', ');\n\n span.updateName(truncate(spanDescription, 1024));\n};\n\nconst instrumentIORedis = generateInstrumentOnce('IORedis', () => {\n return new IORedisInstrumentation({\n responseHook: cacheResponseHook,\n });\n});\n\nconst instrumentRedis4 = generateInstrumentOnce('Redis-4', () => {\n return new RedisInstrumentation({\n responseHook: cacheResponseHook,\n });\n});\n\n/** To be able to preload all Redis OTel instrumentations with just one ID (\"Redis\"), all the instrumentations are generated in this one function */\nexport const instrumentRedis = Object.assign(\n (): void => {\n instrumentIORedis();\n instrumentRedis4();\n\n // todo: implement them gradually\n // new LegacyRedisInstrumentation({}),\n },\n { id: INTEGRATION_NAME },\n);\n\nconst _redisIntegration = ((options: RedisOptions = {}) => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n _redisOptions = options;\n instrumentRedis();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Redis integration for \"ioredis\"\n *\n * Capture tracing data for redis and ioredis.\n */\nexport const redisIntegration = defineIntegration(_redisIntegration);\n"],"names":[],"mappings":";;;;;;;;AA6BA,CAAM,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAmB,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO;;AAEhC,CAAI,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAA8B,EAAA,CAAA,CAAE;;AAEpC,CAAM,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAA0D,EAAA,CAAC,CAAI,CAAA,CAAA,CAAA,EAAQ,YAAY,EAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,EAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,EAAK,CAAA,EAAA;EAC/G,CAAA,CAAA,CAAA,CAAI,CAAC,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA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AAA,CAAA,CAAA,CAAA,EAAA,EAAE,CAAiB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAC,CAAiB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;"}
|
package/esm/utils/redisCache.js
CHANGED
|
@@ -6,15 +6,19 @@ const GET_COMMANDS = ['get', 'mget'];
|
|
|
6
6
|
const SET_COMMANDS = ['set', 'setex'];
|
|
7
7
|
// todo: del, expire
|
|
8
8
|
|
|
9
|
+
/** Checks if a given command is in the list of redis commands.
|
|
10
|
+
* Useful because commands can come in lowercase or uppercase (depending on the library). */
|
|
11
|
+
function isInCommands(redisCommands, command) {
|
|
12
|
+
return redisCommands.includes(command.toLowerCase());
|
|
13
|
+
}
|
|
14
|
+
|
|
9
15
|
/** Determine cache operation based on redis statement */
|
|
10
16
|
function getCacheOperation(
|
|
11
17
|
command,
|
|
12
18
|
) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
if (GET_COMMANDS.includes(lowercaseStatement)) {
|
|
19
|
+
if (isInCommands(GET_COMMANDS, command)) {
|
|
16
20
|
return 'cache.get';
|
|
17
|
-
} else if (SET_COMMANDS
|
|
21
|
+
} else if (isInCommands(SET_COMMANDS, command)) {
|
|
18
22
|
return 'cache.put';
|
|
19
23
|
} else {
|
|
20
24
|
return undefined;
|
|
@@ -43,7 +47,7 @@ function getCacheKeySafely(redisCommand, cmdArgs) {
|
|
|
43
47
|
}
|
|
44
48
|
};
|
|
45
49
|
|
|
46
|
-
if (SINGLE_ARG_COMMANDS
|
|
50
|
+
if (isInCommands(SINGLE_ARG_COMMANDS, redisCommand) && cmdArgs.length > 0) {
|
|
47
51
|
return processArg(cmdArgs[0]);
|
|
48
52
|
}
|
|
49
53
|
|
|
@@ -90,5 +94,5 @@ function calculateCacheItemSize(response) {
|
|
|
90
94
|
: getSize(response);
|
|
91
95
|
}
|
|
92
96
|
|
|
93
|
-
export { GET_COMMANDS, SET_COMMANDS, calculateCacheItemSize, getCacheKeySafely, getCacheOperation, shouldConsiderForCache };
|
|
97
|
+
export { GET_COMMANDS, SET_COMMANDS, calculateCacheItemSize, getCacheKeySafely, getCacheOperation, isInCommands, shouldConsiderForCache };
|
|
94
98
|
//# sourceMappingURL=redisCache.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redisCache.js","sources":["../../../src/utils/redisCache.ts"],"sourcesContent":["import type { CommandArgs as IORedisCommandArgs } from '@opentelemetry/instrumentation-ioredis';\nimport { flatten } from '@sentry/utils';\n\nconst SINGLE_ARG_COMMANDS = ['get', 'set', 'setex'];\n\nexport const GET_COMMANDS = ['get', 'mget'];\nexport const SET_COMMANDS = ['set', 'setex'];\n// todo: del, expire\n\n/** Determine cache operation based on redis statement */\nexport function getCacheOperation(\n command: string,\n): 'cache.get' | 'cache.put' | 'cache.remove' | 'cache.flush' | undefined {\n
|
|
1
|
+
{"version":3,"file":"redisCache.js","sources":["../../../src/utils/redisCache.ts"],"sourcesContent":["import type { CommandArgs as IORedisCommandArgs } from '@opentelemetry/instrumentation-ioredis';\nimport { flatten } from '@sentry/utils';\n\nconst SINGLE_ARG_COMMANDS = ['get', 'set', 'setex'];\n\nexport const GET_COMMANDS = ['get', 'mget'];\nexport const SET_COMMANDS = ['set', 'setex'];\n// todo: del, expire\n\n/** Checks if a given command is in the list of redis commands.\n * Useful because commands can come in lowercase or uppercase (depending on the library). */\nexport function isInCommands(redisCommands: string[], command: string): boolean {\n return redisCommands.includes(command.toLowerCase());\n}\n\n/** Determine cache operation based on redis statement */\nexport function getCacheOperation(\n command: string,\n): 'cache.get' | 'cache.put' | 'cache.remove' | 'cache.flush' | undefined {\n if (isInCommands(GET_COMMANDS, command)) {\n return 'cache.get';\n } else if (isInCommands(SET_COMMANDS, command)) {\n return 'cache.put';\n } else {\n return undefined;\n }\n}\n\nfunction keyHasPrefix(key: string, prefixes: string[]): boolean {\n return prefixes.some(prefix => key.startsWith(prefix));\n}\n\n/** Safely converts a redis key to a string (comma-separated if there are multiple keys) */\nexport function getCacheKeySafely(redisCommand: string, cmdArgs: IORedisCommandArgs): string[] | undefined {\n try {\n if (cmdArgs.length === 0) {\n return undefined;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const processArg = (arg: string | Buffer | number | any[]): string[] => {\n if (typeof arg === 'string' || typeof arg === 'number' || Buffer.isBuffer(arg)) {\n return [arg.toString()];\n } else if (Array.isArray(arg)) {\n return flatten(arg.map(arg => processArg(arg)));\n } else {\n return ['<unknown>'];\n }\n };\n\n if (isInCommands(SINGLE_ARG_COMMANDS, redisCommand) && cmdArgs.length > 0) {\n return processArg(cmdArgs[0]);\n }\n\n return flatten(cmdArgs.map(arg => processArg(arg)));\n } catch (e) {\n return undefined;\n }\n}\n\n/** Determines whether a redis operation should be considered as \"cache operation\" by checking if a key is prefixed.\n * We only support certain commands (such as 'set', 'get', 'mget'). */\nexport function shouldConsiderForCache(redisCommand: string, keys: string[], prefixes: string[]): boolean {\n if (!getCacheOperation(redisCommand)) {\n return false;\n }\n\n for (const key of keys) {\n if (keyHasPrefix(key, prefixes)) {\n return true;\n }\n }\n return false;\n}\n\n/** Calculates size based on the cache response value */\nexport function calculateCacheItemSize(response: unknown): number | undefined {\n const getSize = (value: unknown): number | undefined => {\n try {\n if (Buffer.isBuffer(value)) return value.byteLength;\n else if (typeof value === 'string') return value.length;\n else if (typeof value === 'number') return value.toString().length;\n else if (value === null || value === undefined) return 0;\n return JSON.stringify(value).length;\n } catch (e) {\n return undefined;\n }\n };\n\n return Array.isArray(response)\n ? response.reduce((acc: number | undefined, curr) => {\n const size = getSize(curr);\n return typeof size === 'number' ? (acc !== undefined ? acc + size : size) : acc;\n }, 0)\n : getSize(response);\n}\n"],"names":[],"mappings":";;AAGA,MAAM,mBAAA,GAAsB,CAAC,KAA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AAA,KAAU,QAAQ,EAAE,OAAO,KAAK,CAAC,MAAM,CAAA;AAC7D,WAAW,IAAI,OAAO,UAAU,QAAQ,EAAE,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAA;AACxE,WAAW,IAAI,KAAA,KAAU,IAAA,IAAQ,KAAA,KAAU,SAAS,EAAE,OAAO,CAAC,CAAA;AAC9D,MAAM,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,MAAM,CAAA;AACzC,KAAM,CAAA,OAAO,CAAC,EAAE;AAChB,MAAM,OAAO,SAAS,CAAA;AACtB,KAAI;AACJ,GAAG,CAAA;AACH;AACA,EAAE,OAAO,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAA;AAC/B,MAAM,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,EAAsB,IAAI,KAAK;AACzD,QAAQ,MAAM,IAAK,GAAE,OAAO,CAAC,IAAI,CAAC,CAAA;AAClC,QAAQ,OAAO,OAAO,IAAA,KAAS,QAAS,IAAG,GAAI,KAAI,SAAU,GAAE,MAAM,IAAA,GAAO,IAAI,IAAI,GAAG,CAAA;AACvF,OAAO,EAAE,CAAC,CAAA;AACV,MAAM,OAAO,CAAC,QAAQ,CAAC,CAAA;AACvB;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/node",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.9.0",
|
|
4
4
|
"description": "Sentry Node SDK using OpenTelemetry for performance instrumentation",
|
|
5
5
|
"repository": "git://github.com/getsentry/sentry-javascript.git",
|
|
6
6
|
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/node",
|
|
@@ -75,27 +75,28 @@
|
|
|
75
75
|
"@opentelemetry/core": "^1.25.0",
|
|
76
76
|
"@opentelemetry/instrumentation": "^0.52.0",
|
|
77
77
|
"@opentelemetry/instrumentation-connect": "0.37.0",
|
|
78
|
-
"@opentelemetry/instrumentation-express": "0.40.
|
|
78
|
+
"@opentelemetry/instrumentation-express": "0.40.1",
|
|
79
79
|
"@opentelemetry/instrumentation-fastify": "0.37.0",
|
|
80
80
|
"@opentelemetry/instrumentation-graphql": "0.41.0",
|
|
81
81
|
"@opentelemetry/instrumentation-hapi": "0.39.0",
|
|
82
82
|
"@opentelemetry/instrumentation-http": "0.52.0",
|
|
83
83
|
"@opentelemetry/instrumentation-ioredis": "0.41.0",
|
|
84
84
|
"@opentelemetry/instrumentation-koa": "0.41.0",
|
|
85
|
-
"@opentelemetry/instrumentation-mongodb": "0.
|
|
85
|
+
"@opentelemetry/instrumentation-mongodb": "0.45.0",
|
|
86
86
|
"@opentelemetry/instrumentation-mongoose": "0.39.0",
|
|
87
87
|
"@opentelemetry/instrumentation-mysql": "0.39.0",
|
|
88
88
|
"@opentelemetry/instrumentation-mysql2": "0.39.0",
|
|
89
89
|
"@opentelemetry/instrumentation-nestjs-core": "0.38.0",
|
|
90
90
|
"@opentelemetry/instrumentation-pg": "0.42.0",
|
|
91
|
+
"@opentelemetry/instrumentation-redis-4": "0.40.0",
|
|
91
92
|
"@opentelemetry/resources": "^1.25.0",
|
|
92
93
|
"@opentelemetry/sdk-trace-base": "^1.25.0",
|
|
93
94
|
"@opentelemetry/semantic-conventions": "^1.25.0",
|
|
94
95
|
"@prisma/instrumentation": "5.15.0",
|
|
95
|
-
"@sentry/core": "8.
|
|
96
|
-
"@sentry/opentelemetry": "8.
|
|
97
|
-
"@sentry/types": "8.
|
|
98
|
-
"@sentry/utils": "8.
|
|
96
|
+
"@sentry/core": "8.9.0",
|
|
97
|
+
"@sentry/opentelemetry": "8.9.0",
|
|
98
|
+
"@sentry/types": "8.9.0",
|
|
99
|
+
"@sentry/utils": "8.9.0"
|
|
99
100
|
},
|
|
100
101
|
"devDependencies": {
|
|
101
102
|
"@types/node": "^14.18.0"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/integrations/tracing/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAiBjD;;GAEG;AACH,wBAAgB,8BAA8B,IAAI,WAAW,EAAE,CAoB9D;AAED;;GAEG;AAEH,wBAAgB,wCAAwC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/integrations/tracing/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAiBjD;;GAEG;AACH,wBAAgB,8BAA8B,IAAI,WAAW,EAAE,CAoB9D;AAED;;GAEG;AAEH,wBAAgB,wCAAwC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC,EAAE,CAkBzG"}
|