@sentry/profiling-node 8.39.0 → 8.41.0-beta.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/lib/cjs/index.js +54 -55
- package/lib/cjs/index.js.map +1 -1
- package/lib/esm/index.js +2 -3
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/package.json +1 -1
- package/lib/sentry_cpu_profiler-darwin-arm64-108.node +0 -0
- package/lib/sentry_cpu_profiler-darwin-arm64-115.node +0 -0
- package/lib/sentry_cpu_profiler-darwin-arm64-127.node +0 -0
- package/lib/sentry_cpu_profiler-darwin-arm64-93.node +0 -0
- package/lib/sentry_cpu_profiler-darwin-x64-108.node +0 -0
- package/lib/sentry_cpu_profiler-darwin-x64-115.node +0 -0
- package/lib/sentry_cpu_profiler-darwin-x64-127.node +0 -0
- package/lib/sentry_cpu_profiler-darwin-x64-93.node +0 -0
- package/lib/sentry_cpu_profiler-win32-x64-108.node +0 -0
- package/lib/sentry_cpu_profiler-win32-x64-115.node +0 -0
- package/lib/sentry_cpu_profiler-win32-x64-127.node +0 -0
- package/lib/sentry_cpu_profiler-win32-x64-93.node +0 -0
- package/lib/types/spanProfileUtils.d.ts.map +1 -1
- package/lib/types/utils.d.ts.map +1 -1
- package/package.json +4 -5
package/lib/cjs/index.js
CHANGED
|
@@ -2,12 +2,11 @@ var {
|
|
|
2
2
|
_nullishCoalesce,
|
|
3
3
|
_optionalChain,
|
|
4
4
|
_optionalChainDelete
|
|
5
|
-
} = require('@sentry/
|
|
5
|
+
} = require('@sentry/core');
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
8
8
|
|
|
9
9
|
const core = require('@sentry/core');
|
|
10
|
-
const utils = require('@sentry/utils');
|
|
11
10
|
const node_os = require('node:os');
|
|
12
11
|
const node_path = require('node:path');
|
|
13
12
|
const node_process = require('node:process');
|
|
@@ -171,7 +170,7 @@ const PrivateCpuProfilerBindings = importCppBindingsModule();
|
|
|
171
170
|
class Bindings {
|
|
172
171
|
startProfiling(name) {
|
|
173
172
|
if (!PrivateCpuProfilerBindings) {
|
|
174
|
-
DEBUG_BUILD &&
|
|
173
|
+
DEBUG_BUILD && core.logger.log('[Profiling] Bindings not loaded, ignoring call to startProfiling.');
|
|
175
174
|
return;
|
|
176
175
|
}
|
|
177
176
|
|
|
@@ -184,7 +183,7 @@ class Bindings {
|
|
|
184
183
|
) {
|
|
185
184
|
if (!PrivateCpuProfilerBindings) {
|
|
186
185
|
DEBUG_BUILD &&
|
|
187
|
-
|
|
186
|
+
core.logger.log('[Profiling] Bindings not loaded or profile was never started, ignoring call to stopProfiling.');
|
|
188
187
|
return null;
|
|
189
188
|
}
|
|
190
189
|
|
|
@@ -192,14 +191,14 @@ class Bindings {
|
|
|
192
191
|
name,
|
|
193
192
|
format ,
|
|
194
193
|
node_worker_threads.threadId,
|
|
195
|
-
!!
|
|
194
|
+
!!core.GLOBAL_OBJ._sentryDebugIds,
|
|
196
195
|
);
|
|
197
196
|
}
|
|
198
197
|
}
|
|
199
198
|
|
|
200
199
|
const CpuProfilerBindings = new Bindings();
|
|
201
200
|
|
|
202
|
-
const NODE_VERSION =
|
|
201
|
+
const NODE_VERSION = core.parseSemver(process.versions.node) ;
|
|
203
202
|
const NODE_MAJOR = NODE_VERSION.major;
|
|
204
203
|
|
|
205
204
|
function _nullishCoalesce$1(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }function _optionalChain$1(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }/* eslint-disable max-lines */
|
|
@@ -307,7 +306,7 @@ function createProfilePayload(
|
|
|
307
306
|
// All profiles and transactions are rejected if this is the case and we want to
|
|
308
307
|
// warn users that this is happening if they enable debug flag
|
|
309
308
|
if (trace_id && trace_id.length !== 32) {
|
|
310
|
-
DEBUG_BUILD &&
|
|
309
|
+
DEBUG_BUILD && core.logger.log(`[Profiling] Invalid traceId: ${trace_id} on profiled event`);
|
|
311
310
|
}
|
|
312
311
|
|
|
313
312
|
const enrichedThreadProfile = enrichWithThreadInformation(cpuProfile);
|
|
@@ -375,7 +374,7 @@ function createProfileChunkPayload(
|
|
|
375
374
|
// All profiles and transactions are rejected if this is the case and we want to
|
|
376
375
|
// warn users that this is happening if they enable debug flag
|
|
377
376
|
if (trace_id && trace_id.length !== 32) {
|
|
378
|
-
DEBUG_BUILD &&
|
|
377
|
+
DEBUG_BUILD && core.logger.log(`[Profiling] Invalid traceId: ${trace_id} on profiled event`);
|
|
379
378
|
}
|
|
380
379
|
|
|
381
380
|
const enrichedThreadProfile = enrichWithThreadInformation(cpuProfile);
|
|
@@ -434,7 +433,7 @@ function isValidSampleRate(rate) {
|
|
|
434
433
|
// we need to check NaN explicitly because it's of type 'number' and therefore wouldn't get caught by this typecheck
|
|
435
434
|
if ((typeof rate !== 'number' && typeof rate !== 'boolean') || (typeof rate === 'number' && isNaN(rate))) {
|
|
436
435
|
DEBUG_BUILD &&
|
|
437
|
-
|
|
436
|
+
core.logger.warn(
|
|
438
437
|
`[Profiling] Invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(
|
|
439
438
|
rate,
|
|
440
439
|
)} of type ${JSON.stringify(typeof rate)}.`,
|
|
@@ -449,7 +448,7 @@ function isValidSampleRate(rate) {
|
|
|
449
448
|
|
|
450
449
|
// in case sampleRate is a boolean, it will get automatically cast to 1 if it's true and 0 if it's false
|
|
451
450
|
if (rate < 0 || rate > 1) {
|
|
452
|
-
DEBUG_BUILD &&
|
|
451
|
+
DEBUG_BUILD && core.logger.warn(`[Profiling] Invalid sample rate. Sample rate must be between 0 and 1. Got ${rate}.`);
|
|
453
452
|
return false;
|
|
454
453
|
}
|
|
455
454
|
return true;
|
|
@@ -466,7 +465,7 @@ function isValidProfile(profile) {
|
|
|
466
465
|
// Log a warning if the profile has less than 2 samples so users can know why
|
|
467
466
|
// they are not seeing any profiling data and we cant avoid the back and forth
|
|
468
467
|
// of asking them to provide us with a dump of the profile data.
|
|
469
|
-
|
|
468
|
+
core.logger.log('[Profiling] Discarding profile because it contains less than 2 samples');
|
|
470
469
|
return false;
|
|
471
470
|
}
|
|
472
471
|
|
|
@@ -488,7 +487,7 @@ function isValidProfileChunk(profile) {
|
|
|
488
487
|
// Log a warning if the profile has less than 2 samples so users can know why
|
|
489
488
|
// they are not seeing any profiling data and we cant avoid the back and forth
|
|
490
489
|
// of asking them to provide us with a dump of the profile data.
|
|
491
|
-
|
|
490
|
+
core.logger.log('[Profiling] Discarding profile chunk because it contains less than 2 samples');
|
|
492
491
|
return false;
|
|
493
492
|
}
|
|
494
493
|
|
|
@@ -521,7 +520,7 @@ function addProfilesToEnvelope(envelope, profiles) {
|
|
|
521
520
|
function findProfiledTransactionsFromEnvelope(envelope) {
|
|
522
521
|
const events = [];
|
|
523
522
|
|
|
524
|
-
|
|
523
|
+
core.forEachEnvelopeItem(envelope, (item, type) => {
|
|
525
524
|
if (type !== 'transaction') {
|
|
526
525
|
return;
|
|
527
526
|
}
|
|
@@ -557,10 +556,10 @@ function createEventEnvelopeHeaders(
|
|
|
557
556
|
dsn,
|
|
558
557
|
) {
|
|
559
558
|
return {
|
|
560
|
-
event_id:
|
|
559
|
+
event_id: core.uuid4(),
|
|
561
560
|
sent_at: new Date().toISOString(),
|
|
562
561
|
...(sdkInfo && { sdk: sdkInfo }),
|
|
563
|
-
...(!!tunnel && dsn && { dsn:
|
|
562
|
+
...(!!tunnel && dsn && { dsn: core.dsnToString(dsn) }),
|
|
564
563
|
};
|
|
565
564
|
}
|
|
566
565
|
|
|
@@ -577,7 +576,7 @@ function makeProfileChunkEnvelope(
|
|
|
577
576
|
type: 'profile_chunk',
|
|
578
577
|
};
|
|
579
578
|
|
|
580
|
-
return
|
|
579
|
+
return core.createEnvelope(createEventEnvelopeHeaders(sdkInfo, tunnel, dsn), [
|
|
581
580
|
[profileChunkHeader, chunk],
|
|
582
581
|
]);
|
|
583
582
|
}
|
|
@@ -594,7 +593,7 @@ function applyDebugMetadata(client, resource_paths) {
|
|
|
594
593
|
return [];
|
|
595
594
|
}
|
|
596
595
|
|
|
597
|
-
return
|
|
596
|
+
return core.getDebugImagesForResources(options.stackParser, resource_paths);
|
|
598
597
|
}
|
|
599
598
|
|
|
600
599
|
const MAX_PROFILE_DURATION_MS = 30 * 1000;
|
|
@@ -617,13 +616,13 @@ function maybeProfileSpan(
|
|
|
617
616
|
|
|
618
617
|
// Client and options are required for profiling
|
|
619
618
|
if (!client) {
|
|
620
|
-
DEBUG_BUILD &&
|
|
619
|
+
DEBUG_BUILD && core.logger.log('[Profiling] Profiling disabled, no client found.');
|
|
621
620
|
return;
|
|
622
621
|
}
|
|
623
622
|
|
|
624
623
|
const options = client.getOptions();
|
|
625
624
|
if (!options) {
|
|
626
|
-
DEBUG_BUILD &&
|
|
625
|
+
DEBUG_BUILD && core.logger.log('[Profiling] Profiling disabled, no options found.');
|
|
627
626
|
return;
|
|
628
627
|
}
|
|
629
628
|
|
|
@@ -651,14 +650,14 @@ function maybeProfileSpan(
|
|
|
651
650
|
// Since this is coming from the user (or from a function provided by the user), who knows what we might get. (The
|
|
652
651
|
// only valid values are booleans or numbers between 0 and 1.)
|
|
653
652
|
if (!isValidSampleRate(profilesSampleRate)) {
|
|
654
|
-
DEBUG_BUILD &&
|
|
653
|
+
DEBUG_BUILD && core.logger.warn('[Profiling] Discarding profile because of invalid sample rate.');
|
|
655
654
|
return;
|
|
656
655
|
}
|
|
657
656
|
|
|
658
657
|
// if the function returned 0 (or false), or if `profileSampleRate` is 0, it's a sign the profile should be dropped
|
|
659
658
|
if (!profilesSampleRate) {
|
|
660
659
|
DEBUG_BUILD &&
|
|
661
|
-
|
|
660
|
+
core.logger.log(
|
|
662
661
|
`[Profiling] Discarding profile because ${
|
|
663
662
|
typeof profilesSampler === 'function'
|
|
664
663
|
? 'profileSampler returned 0 or false'
|
|
@@ -674,7 +673,7 @@ function maybeProfileSpan(
|
|
|
674
673
|
// Check if we should sample this profile
|
|
675
674
|
if (!sampled) {
|
|
676
675
|
DEBUG_BUILD &&
|
|
677
|
-
|
|
676
|
+
core.logger.log(
|
|
678
677
|
`[Profiling] Discarding profile because it's not included in the random sample (sampling rate = ${Number(
|
|
679
678
|
profilesSampleRate,
|
|
680
679
|
)})`,
|
|
@@ -682,9 +681,9 @@ function maybeProfileSpan(
|
|
|
682
681
|
return;
|
|
683
682
|
}
|
|
684
683
|
|
|
685
|
-
const profile_id =
|
|
684
|
+
const profile_id = core.uuid4();
|
|
686
685
|
CpuProfilerBindings.startProfiling(profile_id);
|
|
687
|
-
DEBUG_BUILD &&
|
|
686
|
+
DEBUG_BUILD && core.logger.log(`[Profiling] started profiling transaction: ${core.spanToJSON(span).description}`);
|
|
688
687
|
|
|
689
688
|
// set transaction context - do this regardless if profiling fails down the line
|
|
690
689
|
// so that we can still see the profile_id in the transaction context
|
|
@@ -704,12 +703,12 @@ function stopSpanProfile(span, profile_id) {
|
|
|
704
703
|
}
|
|
705
704
|
|
|
706
705
|
const profile = CpuProfilerBindings.stopProfiling(profile_id, 0);
|
|
707
|
-
DEBUG_BUILD &&
|
|
706
|
+
DEBUG_BUILD && core.logger.log(`[Profiling] stopped profiling of transaction: ${core.spanToJSON(span).description}`);
|
|
708
707
|
|
|
709
708
|
// In case of an overlapping span, stopProfiling may return null and silently ignore the overlapping profile.
|
|
710
709
|
if (!profile) {
|
|
711
710
|
DEBUG_BUILD &&
|
|
712
|
-
|
|
711
|
+
core.logger.log(
|
|
713
712
|
`[Profiling] profiler returned null profile for: ${core.spanToJSON(span).description}`,
|
|
714
713
|
'this may indicate an overlapping span or a call to stopProfiling with a profile title that was never started',
|
|
715
714
|
);
|
|
@@ -729,7 +728,7 @@ var ProfileFormat;(function (ProfileFormat) {
|
|
|
729
728
|
/* eslint-disable max-lines */
|
|
730
729
|
|
|
731
730
|
const CHUNK_INTERVAL_MS = 5000;
|
|
732
|
-
const PROFILE_MAP = new
|
|
731
|
+
const PROFILE_MAP = new core.LRUMap(50);
|
|
733
732
|
const PROFILE_TIMEOUTS = {};
|
|
734
733
|
|
|
735
734
|
function addToProfileQueue(profile_id, profile) {
|
|
@@ -772,7 +771,7 @@ function setupAutomatedSpanProfiling(client) {
|
|
|
772
771
|
// Enqueue a timeout to prevent profiles from running over max duration.
|
|
773
772
|
const timeout = global.setTimeout(() => {
|
|
774
773
|
DEBUG_BUILD &&
|
|
775
|
-
|
|
774
|
+
core.logger.log('[Profiling] max profile duration elapsed, stopping profiling for:', core.spanToJSON(span).description);
|
|
776
775
|
|
|
777
776
|
const profile = stopSpanProfile(span, profile_id);
|
|
778
777
|
if (profile) {
|
|
@@ -833,7 +832,7 @@ function setupAutomatedSpanProfiling(client) {
|
|
|
833
832
|
|
|
834
833
|
const cpuProfile = takeFromProfileQueue(profile_id);
|
|
835
834
|
if (!cpuProfile) {
|
|
836
|
-
DEBUG_BUILD &&
|
|
835
|
+
DEBUG_BUILD && core.logger.log(`[Profiling] Could not retrieve profile for transaction: ${profile_id}`);
|
|
837
836
|
continue;
|
|
838
837
|
}
|
|
839
838
|
|
|
@@ -877,7 +876,7 @@ class ContinuousProfiler {constructor() { ContinuousProfiler.prototype.__init.ca
|
|
|
877
876
|
*/
|
|
878
877
|
start() {
|
|
879
878
|
if (!this._client) {
|
|
880
|
-
DEBUG_BUILD &&
|
|
879
|
+
DEBUG_BUILD && core.logger.log('[Profiling] Failed to start, sentry client was never attached to the profiler.');
|
|
881
880
|
return;
|
|
882
881
|
}
|
|
883
882
|
|
|
@@ -895,7 +894,7 @@ class ContinuousProfiler {constructor() { ContinuousProfiler.prototype.__init.ca
|
|
|
895
894
|
*/
|
|
896
895
|
stop() {
|
|
897
896
|
if (!this._client) {
|
|
898
|
-
DEBUG_BUILD &&
|
|
897
|
+
DEBUG_BUILD && core.logger.log('[Profiling] Failed to stop, sentry client was never attached to the profiler.');
|
|
899
898
|
return;
|
|
900
899
|
}
|
|
901
900
|
this._chunkStop();
|
|
@@ -910,12 +909,12 @@ class ContinuousProfiler {constructor() { ContinuousProfiler.prototype.__init.ca
|
|
|
910
909
|
// The client is not attached to the profiler if the user has not enabled continuous profiling.
|
|
911
910
|
// In this case, calling start() and stop() is a noop action.The reason this exists is because
|
|
912
911
|
// it makes the types easier to work with and avoids users having to do null checks.
|
|
913
|
-
DEBUG_BUILD &&
|
|
912
|
+
DEBUG_BUILD && core.logger.log('[Profiling] Profiler was never attached to the client.');
|
|
914
913
|
return;
|
|
915
914
|
}
|
|
916
915
|
if (this._chunkData) {
|
|
917
916
|
DEBUG_BUILD &&
|
|
918
|
-
|
|
917
|
+
core.logger.log(
|
|
919
918
|
`[Profiling] Chunk with chunk_id ${this._chunkData.id} is still running, current chunk will be stopped a new chunk will be started.`,
|
|
920
919
|
);
|
|
921
920
|
this._chunkStop();
|
|
@@ -931,35 +930,35 @@ class ContinuousProfiler {constructor() { ContinuousProfiler.prototype.__init.ca
|
|
|
931
930
|
if (_optionalChain([this, 'access', _6 => _6._chunkData, 'optionalAccess', _7 => _7.timer])) {
|
|
932
931
|
global.clearTimeout(this._chunkData.timer);
|
|
933
932
|
this._chunkData.timer = undefined;
|
|
934
|
-
DEBUG_BUILD &&
|
|
933
|
+
DEBUG_BUILD && core.logger.log(`[Profiling] Stopping profiling chunk: ${this._chunkData.id}`);
|
|
935
934
|
}
|
|
936
935
|
if (!this._client) {
|
|
937
936
|
DEBUG_BUILD &&
|
|
938
|
-
|
|
937
|
+
core.logger.log('[Profiling] Failed to collect profile, sentry client was never attached to the profiler.');
|
|
939
938
|
return;
|
|
940
939
|
}
|
|
941
940
|
if (!_optionalChain([this, 'access', _8 => _8._chunkData, 'optionalAccess', _9 => _9.id])) {
|
|
942
941
|
DEBUG_BUILD &&
|
|
943
|
-
|
|
942
|
+
core.logger.log(`[Profiling] Failed to collect profile for: ${_optionalChain([this, 'access', _10 => _10._chunkData, 'optionalAccess', _11 => _11.id])}, the chunk_id is missing.`);
|
|
944
943
|
return;
|
|
945
944
|
}
|
|
946
945
|
|
|
947
946
|
const profile = CpuProfilerBindings.stopProfiling(this._chunkData.id, ProfileFormat.CHUNK);
|
|
948
947
|
|
|
949
948
|
if (!profile) {
|
|
950
|
-
DEBUG_BUILD &&
|
|
949
|
+
DEBUG_BUILD && core.logger.log(`[Profiling] _chunkiledStartTraceID to collect profile for: ${this._chunkData.id}`);
|
|
951
950
|
return;
|
|
952
951
|
}
|
|
953
952
|
if (!this._profilerId) {
|
|
954
953
|
DEBUG_BUILD &&
|
|
955
|
-
|
|
954
|
+
core.logger.log('[Profiling] Profile chunk does not contain a valid profiler_id, this is a bug in the SDK');
|
|
956
955
|
return;
|
|
957
956
|
}
|
|
958
957
|
if (profile) {
|
|
959
|
-
DEBUG_BUILD &&
|
|
958
|
+
DEBUG_BUILD && core.logger.log(`[Profiling] Sending profile chunk ${this._chunkData.id}.`);
|
|
960
959
|
}
|
|
961
960
|
|
|
962
|
-
DEBUG_BUILD &&
|
|
961
|
+
DEBUG_BUILD && core.logger.log(`[Profiling] Profile chunk ${this._chunkData.id} sent to Sentry.`);
|
|
963
962
|
const chunk = createProfilingChunkEvent(
|
|
964
963
|
this._client,
|
|
965
964
|
this._client.getOptions(),
|
|
@@ -973,7 +972,7 @@ class ContinuousProfiler {constructor() { ContinuousProfiler.prototype.__init.ca
|
|
|
973
972
|
);
|
|
974
973
|
|
|
975
974
|
if (!chunk) {
|
|
976
|
-
DEBUG_BUILD &&
|
|
975
|
+
DEBUG_BUILD && core.logger.log(`[Profiling] Failed to create profile chunk for: ${this._chunkData.id}`);
|
|
977
976
|
this._resetChunkData();
|
|
978
977
|
return;
|
|
979
978
|
}
|
|
@@ -993,13 +992,13 @@ class ContinuousProfiler {constructor() { ContinuousProfiler.prototype.__init.ca
|
|
|
993
992
|
_flush(chunk) {
|
|
994
993
|
if (!this._client) {
|
|
995
994
|
DEBUG_BUILD &&
|
|
996
|
-
|
|
995
|
+
core.logger.log('[Profiling] Failed to collect profile, sentry client was never attached to the profiler.');
|
|
997
996
|
return;
|
|
998
997
|
}
|
|
999
998
|
|
|
1000
999
|
const transport = this._client.getTransport();
|
|
1001
1000
|
if (!transport) {
|
|
1002
|
-
DEBUG_BUILD &&
|
|
1001
|
+
DEBUG_BUILD && core.logger.log('[Profiling] No transport available to send profile chunk.');
|
|
1003
1002
|
return;
|
|
1004
1003
|
}
|
|
1005
1004
|
|
|
@@ -1009,7 +1008,7 @@ class ContinuousProfiler {constructor() { ContinuousProfiler.prototype.__init.ca
|
|
|
1009
1008
|
|
|
1010
1009
|
const envelope = makeProfileChunkEnvelope(chunk, _optionalChain([metadata, 'optionalAccess', _16 => _16.sdk]), tunnel, dsn);
|
|
1011
1010
|
transport.send(envelope).then(null, reason => {
|
|
1012
|
-
DEBUG_BUILD &&
|
|
1011
|
+
DEBUG_BUILD && core.logger.error('Error while sending profile chunk envelope:', reason);
|
|
1013
1012
|
});
|
|
1014
1013
|
}
|
|
1015
1014
|
|
|
@@ -1023,12 +1022,12 @@ class ContinuousProfiler {constructor() { ContinuousProfiler.prototype.__init.ca
|
|
|
1023
1022
|
const chunk = this._initializeChunk(traceId);
|
|
1024
1023
|
|
|
1025
1024
|
CpuProfilerBindings.startProfiling(chunk.id);
|
|
1026
|
-
DEBUG_BUILD &&
|
|
1025
|
+
DEBUG_BUILD && core.logger.log(`[Profiling] starting profiling chunk: ${chunk.id}`);
|
|
1027
1026
|
|
|
1028
1027
|
chunk.timer = global.setTimeout(() => {
|
|
1029
|
-
DEBUG_BUILD &&
|
|
1028
|
+
DEBUG_BUILD && core.logger.log(`[Profiling] Stopping profiling chunk: ${chunk.id}`);
|
|
1030
1029
|
this._chunkStop();
|
|
1031
|
-
DEBUG_BUILD &&
|
|
1030
|
+
DEBUG_BUILD && core.logger.log('[Profiling] Starting new profiling chunk.');
|
|
1032
1031
|
setImmediate(this._chunkStart.bind(this));
|
|
1033
1032
|
}, CHUNK_INTERVAL_MS);
|
|
1034
1033
|
|
|
@@ -1043,13 +1042,13 @@ class ContinuousProfiler {constructor() { ContinuousProfiler.prototype.__init.ca
|
|
|
1043
1042
|
_setupSpanChunkInstrumentation() {
|
|
1044
1043
|
if (!this._client) {
|
|
1045
1044
|
DEBUG_BUILD &&
|
|
1046
|
-
|
|
1045
|
+
core.logger.log(
|
|
1047
1046
|
'[Profiling] Failed to initialize span profiling, sentry client was never attached to the profiler.',
|
|
1048
1047
|
);
|
|
1049
1048
|
return;
|
|
1050
1049
|
}
|
|
1051
1050
|
|
|
1052
|
-
this._profilerId =
|
|
1051
|
+
this._profilerId = core.uuid4();
|
|
1053
1052
|
core.getGlobalScope().setContext('profile', {
|
|
1054
1053
|
profiler_id: this._profilerId,
|
|
1055
1054
|
});
|
|
@@ -1077,7 +1076,7 @@ class ContinuousProfiler {constructor() { ContinuousProfiler.prototype.__init.ca
|
|
|
1077
1076
|
*/
|
|
1078
1077
|
_initializeChunk(traceId) {
|
|
1079
1078
|
this._chunkData = {
|
|
1080
|
-
id:
|
|
1079
|
+
id: core.uuid4(),
|
|
1081
1080
|
startTraceID: traceId,
|
|
1082
1081
|
timer: undefined,
|
|
1083
1082
|
};
|
|
@@ -1119,7 +1118,7 @@ class ContinuousProfiler {constructor() { ContinuousProfiler.prototype.__init.ca
|
|
|
1119
1118
|
/** Exported only for tests. */
|
|
1120
1119
|
const _nodeProfilingIntegration = (() => {
|
|
1121
1120
|
if (![16, 18, 20, 22].includes(NODE_MAJOR)) {
|
|
1122
|
-
|
|
1121
|
+
core.consoleSandbox(() => {
|
|
1123
1122
|
// eslint-disable-next-line no-console
|
|
1124
1123
|
console.warn(
|
|
1125
1124
|
`[Sentry Profiling] You are using a Node.js version that does not have prebuilt binaries (${NODE_VERSION}).`,
|
|
@@ -1134,7 +1133,7 @@ const _nodeProfilingIntegration = (() => {
|
|
|
1134
1133
|
name: 'ProfilingIntegration',
|
|
1135
1134
|
_profiler: new ContinuousProfiler(),
|
|
1136
1135
|
setup(client) {
|
|
1137
|
-
DEBUG_BUILD &&
|
|
1136
|
+
DEBUG_BUILD && core.logger.log('[Profiling] Profiling integration setup.');
|
|
1138
1137
|
const options = client.getOptions();
|
|
1139
1138
|
|
|
1140
1139
|
const mode =
|
|
@@ -1146,19 +1145,19 @@ const _nodeProfilingIntegration = (() => {
|
|
|
1146
1145
|
: 'span';
|
|
1147
1146
|
switch (mode) {
|
|
1148
1147
|
case 'continuous': {
|
|
1149
|
-
DEBUG_BUILD &&
|
|
1148
|
+
DEBUG_BUILD && core.logger.log('[Profiling] Continuous profiler mode enabled.');
|
|
1150
1149
|
this._profiler.initialize(client);
|
|
1151
1150
|
break;
|
|
1152
1151
|
}
|
|
1153
1152
|
// Default to span profiling when no mode profiler mode is set
|
|
1154
1153
|
case 'span':
|
|
1155
1154
|
case undefined: {
|
|
1156
|
-
DEBUG_BUILD &&
|
|
1155
|
+
DEBUG_BUILD && core.logger.log('[Profiling] Span profiler mode enabled.');
|
|
1157
1156
|
setupAutomatedSpanProfiling(client);
|
|
1158
1157
|
break;
|
|
1159
1158
|
}
|
|
1160
1159
|
default: {
|
|
1161
|
-
DEBUG_BUILD &&
|
|
1160
|
+
DEBUG_BUILD && core.logger.warn(`[Profiling] Unknown profiler mode: ${mode}, profiler was not initialized`);
|
|
1162
1161
|
}
|
|
1163
1162
|
}
|
|
1164
1163
|
},
|
package/lib/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/lib/esm/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { _nullishCoalesce, _optionalChain, _optionalChainDelete } from '@sentry/
|
|
2
|
-
import { spanIsSampled, spanToJSON, defineIntegration, getRootSpan, getCurrentScope, getIsolationScope, getGlobalScope } from '@sentry/core';
|
|
3
|
-
import { logger, GLOBAL_OBJ, parseSemver, forEachEnvelopeItem, createEnvelope, getDebugImagesForResources, uuid4, dsnToString, LRUMap, consoleSandbox } from '@sentry/utils';
|
|
1
|
+
import { _nullishCoalesce, _optionalChain, _optionalChainDelete } from '@sentry/core';
|
|
2
|
+
import { logger, GLOBAL_OBJ, parseSemver, forEachEnvelopeItem, createEnvelope, getDebugImagesForResources, uuid4, dsnToString, spanIsSampled, spanToJSON, LRUMap, defineIntegration, consoleSandbox, getRootSpan, getCurrentScope, getIsolationScope, getGlobalScope } from '@sentry/core';
|
|
4
3
|
import { platform as platform$1, arch as arch$1 } from 'node:os';
|
|
5
4
|
import cjsPath, { resolve, join } from 'node:path';
|
|
6
5
|
import { versions, env } from 'node:process';
|
package/lib/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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","sideEffects":false}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spanProfileUtils.d.ts","sourceRoot":"","sources":["../../src/spanProfileUtils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"spanProfileUtils.d.ts","sourceRoot":"","sources":["../../src/spanProfileUtils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,qBAAqB,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAIjE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAGnD,eAAO,MAAM,uBAAuB,QAAY,CAAC;AAEjD;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,UAAU,GAAG,SAAS,EAC9B,IAAI,EAAE,IAAI,EACV,qBAAqB,CAAC,EAAE,qBAAqB,GAC5C,MAAM,GAAG,SAAS,CAkFpB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,mBAAmB,GAAG,IAAI,CAsBtG"}
|
package/lib/types/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,MAAM,EAEN,0BAA0B,EAC1B,UAAU,EACV,aAAa,EACb,QAAQ,EACR,KAAK,EACL,oBAAoB,EACpB,OAAO,EACP,YAAY,EACZ,oBAAoB,EAEpB,OAAO,EACP,gBAA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AAQ,EAAE,OAAO,EAAE,GAAG,QAAQ,CAUvF;AAED;;;;GAIG;AACH,wBAAgB,oCAAoC,CAAC,QAAQ,EAAE,QAAQ,GAAG,KAAK,EAAE,CA2BhF;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,OAAO,GAAG,SAAS,EAC5B,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,GAAG,CAAC,EAAE,aAAa,GAClB,oBAAoB,CAOtB;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,YAAY,EACnB,OAAO,EAAE,OAAO,GAAG,SAAS,EAC5B,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,GAAG,CAAC,EAAE,aAAa,GAClB,oBAAoB,CAQtB;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,UAAU,EAAE,CAQtG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/profiling-node",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.41.0-beta.0",
|
|
4
4
|
"description": "Official Sentry SDK for Node.js Profiling",
|
|
5
5
|
"repository": "git://github.com/getsentry/sentry-javascript.git",
|
|
6
6
|
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/profiling-node",
|
|
@@ -75,10 +75,9 @@
|
|
|
75
75
|
"test": "cross-env SENTRY_PROFILER_BINARY_DIR=lib jest --config jest.config.js"
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
|
-
"@sentry/core": "8.
|
|
79
|
-
"@sentry/node": "8.
|
|
80
|
-
"@sentry/types": "8.
|
|
81
|
-
"@sentry/utils": "8.39.0",
|
|
78
|
+
"@sentry/core": "8.41.0-beta.0",
|
|
79
|
+
"@sentry/node": "8.41.0-beta.0",
|
|
80
|
+
"@sentry/types": "8.41.0-beta.0",
|
|
82
81
|
"detect-libc": "^2.0.2",
|
|
83
82
|
"node-abi": "^3.61.0"
|
|
84
83
|
},
|