@sentry/profiling-node 8.22.0 → 8.24.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/bindings/cpu_profiler.cc +1 -0
- package/lib/cjs/index.js +25 -10
- package/lib/cjs/index.js.map +1 -1
- package/lib/esm/index.js +25 -10
- package/lib/esm/index.js.map +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-linux-arm64-glibc-108.node +0 -0
- package/lib/sentry_cpu_profiler-linux-arm64-glibc-115.node +0 -0
- package/lib/sentry_cpu_profiler-linux-arm64-glibc-127.node +0 -0
- package/lib/sentry_cpu_profiler-linux-arm64-glibc-93.node +0 -0
- package/lib/sentry_cpu_profiler-linux-arm64-musl-108.node +0 -0
- package/lib/sentry_cpu_profiler-linux-arm64-musl-115.node +0 -0
- package/lib/sentry_cpu_profiler-linux-arm64-musl-127.node +0 -0
- package/lib/sentry_cpu_profiler-linux-arm64-musl-93.node +0 -0
- package/lib/sentry_cpu_profiler-linux-x64-glibc-108.node +0 -0
- package/lib/sentry_cpu_profiler-linux-x64-glibc-115.node +0 -0
- package/lib/sentry_cpu_profiler-linux-x64-glibc-127.node +0 -0
- package/lib/sentry_cpu_profiler-linux-x64-glibc-93.node +0 -0
- package/lib/sentry_cpu_profiler-linux-x64-musl-108.node +0 -0
- package/lib/sentry_cpu_profiler-linux-x64-musl-115.node +0 -0
- package/lib/sentry_cpu_profiler-linux-x64-musl-127.node +0 -0
- package/lib/sentry_cpu_profiler-linux-x64-musl-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/integration.d.ts.map +1 -1
- package/lib/types/utils.d.ts +1 -1
- package/lib/types/utils.d.ts.map +1 -1
- package/lib/types-ts3.8/utils.d.ts +1 -1
- package/package.json +5 -5
package/bindings/cpu_profiler.cc
CHANGED
|
@@ -28,6 +28,7 @@ enum ProfileFormat {
|
|
|
28
28
|
kFormatThread = 0,
|
|
29
29
|
kFormatChunk = 1,
|
|
30
30
|
};
|
|
31
|
+
|
|
31
32
|
// Allow users to override the default logging mode via env variable. This is
|
|
32
33
|
// useful because sometimes the flow of the profiled program can be to execute
|
|
33
34
|
// many sequential transaction - in that case, it may be preferable to set eager
|
package/lib/cjs/index.js
CHANGED
|
@@ -366,6 +366,7 @@ function createProfileChunkPayload(
|
|
|
366
366
|
trace_id,
|
|
367
367
|
profiler_id,
|
|
368
368
|
chunk_id,
|
|
369
|
+
sdk,
|
|
369
370
|
}
|
|
370
371
|
|
|
371
372
|
,
|
|
@@ -381,6 +382,10 @@ function createProfileChunkPayload(
|
|
|
381
382
|
|
|
382
383
|
const profile = {
|
|
383
384
|
chunk_id: chunk_id,
|
|
385
|
+
client_sdk: {
|
|
386
|
+
name: _nullishCoalesce$1(_optionalChain$1([sdk, 'optionalAccess', _4 => _4.name]), () => ( 'sentry.javascript.node')),
|
|
387
|
+
version: _nullishCoalesce$1(_optionalChain$1([sdk, 'optionalAccess', _5 => _5.version]), () => ( '0.0.0')),
|
|
388
|
+
},
|
|
384
389
|
profiler_id: profiler_id,
|
|
385
390
|
platform: 'node',
|
|
386
391
|
version: CONTINUOUS_FORMAT_VERSION,
|
|
@@ -403,6 +408,7 @@ function createProfilingChunkEvent(
|
|
|
403
408
|
client,
|
|
404
409
|
options,
|
|
405
410
|
profile,
|
|
411
|
+
sdk,
|
|
406
412
|
identifiers,
|
|
407
413
|
) {
|
|
408
414
|
if (!isValidProfileChunk(profile)) {
|
|
@@ -415,6 +421,7 @@ function createProfilingChunkEvent(
|
|
|
415
421
|
trace_id: _nullishCoalesce$1(identifiers.trace_id, () => ( '')),
|
|
416
422
|
chunk_id: identifiers.chunk_id,
|
|
417
423
|
profiler_id: identifiers.profiler_id,
|
|
424
|
+
sdk,
|
|
418
425
|
});
|
|
419
426
|
}
|
|
420
427
|
|
|
@@ -529,7 +536,7 @@ function findProfiledTransactionsFromEnvelope(envelope) {
|
|
|
529
536
|
}
|
|
530
537
|
|
|
531
538
|
// @ts-expect-error profile_id is not part of the metadata type
|
|
532
|
-
const profile_id = _optionalChain$1([(event.contexts ), 'optionalAccess',
|
|
539
|
+
const profile_id = _optionalChain$1([(event.contexts ), 'optionalAccess', _6 => _6['profile'], 'optionalAccess', _7 => _7['profile_id']]);
|
|
533
540
|
|
|
534
541
|
if (event && profile_id) {
|
|
535
542
|
events.push(item[j] );
|
|
@@ -771,6 +778,8 @@ var ProfileFormat;(function (ProfileFormat) {
|
|
|
771
778
|
const CHUNK = 1; ProfileFormat[ProfileFormat["CHUNK"] = CHUNK] = "CHUNK";
|
|
772
779
|
})(ProfileFormat || (ProfileFormat = {}));
|
|
773
780
|
|
|
781
|
+
/* eslint-disable max-lines */
|
|
782
|
+
|
|
774
783
|
const CHUNK_INTERVAL_MS = 5000;
|
|
775
784
|
const PROFILE_MAP = new utils.LRUMap(50);
|
|
776
785
|
const PROFILE_TIMEOUTS = {};
|
|
@@ -969,11 +978,17 @@ class ContinuousProfiler {constructor() { ContinuousProfiler.prototype.__init.ca
|
|
|
969
978
|
}
|
|
970
979
|
|
|
971
980
|
DEBUG_BUILD && utils.logger.log(`[Profiling] Profile chunk ${this._chunkData.id} sent to Sentry.`);
|
|
972
|
-
const chunk = createProfilingChunkEvent(
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
981
|
+
const chunk = createProfilingChunkEvent(
|
|
982
|
+
this._client,
|
|
983
|
+
this._client.getOptions(),
|
|
984
|
+
profile,
|
|
985
|
+
_optionalChain([this, 'access', _12 => _12._client, 'access', _13 => _13.getSdkMetadata, 'call', _14 => _14(), 'optionalAccess', _15 => _15.sdk]),
|
|
986
|
+
{
|
|
987
|
+
chunk_id: this._chunkData.id,
|
|
988
|
+
trace_id: this._chunkData.startTraceID,
|
|
989
|
+
profiler_id: this._profilerId,
|
|
990
|
+
},
|
|
991
|
+
);
|
|
977
992
|
|
|
978
993
|
if (!chunk) {
|
|
979
994
|
DEBUG_BUILD && utils.logger.log(`[Profiling] Failed to create profile chunk for: ${this._chunkData.id}`);
|
|
@@ -1010,7 +1025,7 @@ class ContinuousProfiler {constructor() { ContinuousProfiler.prototype.__init.ca
|
|
|
1010
1025
|
const metadata = this._client.getSdkMetadata();
|
|
1011
1026
|
const tunnel = this._client.getOptions().tunnel;
|
|
1012
1027
|
|
|
1013
|
-
const envelope = makeProfileChunkEnvelope(chunk, _optionalChain([metadata, 'optionalAccess',
|
|
1028
|
+
const envelope = makeProfileChunkEnvelope(chunk, _optionalChain([metadata, 'optionalAccess', _16 => _16.sdk]), tunnel, dsn);
|
|
1014
1029
|
transport.send(envelope).then(null, reason => {
|
|
1015
1030
|
DEBUG_BUILD && utils.logger.error('Error while sending profile chunk envelope:', reason);
|
|
1016
1031
|
});
|
|
@@ -1086,7 +1101,7 @@ class ContinuousProfiler {constructor() { ContinuousProfiler.prototype.__init.ca
|
|
|
1086
1101
|
* Assigns thread_id and thread name context to a profiled event.
|
|
1087
1102
|
*/
|
|
1088
1103
|
_assignThreadIdContext(event) {
|
|
1089
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
1104
|
+
if (!_optionalChain([event, 'optionalAccess', _17 => _17['contexts'], 'optionalAccess', _18 => _18['profile']])) {
|
|
1090
1105
|
return;
|
|
1091
1106
|
}
|
|
1092
1107
|
|
|
@@ -1097,9 +1112,9 @@ class ContinuousProfiler {constructor() { ContinuousProfiler.prototype.__init.ca
|
|
|
1097
1112
|
// @ts-expect-error the trace fallback value is wrong, though it should never happen
|
|
1098
1113
|
// and in case it does, we dont want to override whatever was passed initially.
|
|
1099
1114
|
event.contexts['trace'] = {
|
|
1100
|
-
...(_nullishCoalesce(_optionalChain([event, 'access',
|
|
1115
|
+
...(_nullishCoalesce(_optionalChain([event, 'access', _19 => _19.contexts, 'optionalAccess', _20 => _20['trace']]), () => ( {}))),
|
|
1101
1116
|
data: {
|
|
1102
|
-
...(_nullishCoalesce(_optionalChain([event, 'access',
|
|
1117
|
+
...(_nullishCoalesce(_optionalChain([event, 'access', _21 => _21.contexts, 'optionalAccess', _22 => _22['trace'], 'optionalAccess', _23 => _23['data']]), () => ( {}))),
|
|
1103
1118
|
['thread.id']: PROFILER_THREAD_ID_STRING,
|
|
1104
1119
|
['thread.name']: PROFILER_THREAD_NAME,
|
|
1105
1120
|
},
|