diff --git a/packages/profiling-node/src/integration.ts b/packages/profiling-node/src/integration.ts index 35243f6da396..4b384b244a17 100644 --- a/packages/profiling-node/src/integration.ts +++ b/packages/profiling-node/src/integration.ts @@ -516,7 +516,7 @@ class ContinuousProfiler { const metadata = this._client.getSdkMetadata(); const tunnel = this._client.getOptions().tunnel; - const envelope = makeProfileChunkEnvelope(chunk, metadata?.sdk, tunnel, dsn); + const envelope = makeProfileChunkEnvelope('node', chunk, metadata?.sdk, tunnel, dsn); transport.send(envelope).then(null, reason => { DEBUG_BUILD && logger.error('Error while sending profile chunk envelope:', reason); }); diff --git a/packages/profiling-node/src/utils.ts b/packages/profiling-node/src/utils.ts index 23b05f14f67b..2de8e54208db 100644 --- a/packages/profiling-node/src/utils.ts +++ b/packages/profiling-node/src/utils.ts @@ -400,6 +400,7 @@ export function createEventEnvelopeHeaders( * Creates a standalone profile_chunk envelope. */ export function makeProfileChunkEnvelope( + platform: 'node', chunk: ProfileChunk, sdkInfo: SdkInfo | undefined, tunnel: string | undefined, @@ -407,6 +408,7 @@ export function makeProfileChunkEnvelope( ): ProfileChunkEnvelope { const profileChunkHeader: ProfileChunkItem[0] = { type: 'profile_chunk', + platform, }; return createEnvelope(createEventEnvelopeHeaders(sdkInfo, tunnel, dsn), [ diff --git a/packages/profiling-node/test/integration.test.ts b/packages/profiling-node/test/integration.test.ts index 99142651312e..304aa6a9766b 100644 --- a/packages/profiling-node/test/integration.test.ts +++ b/packages/profiling-node/test/integration.test.ts @@ -643,7 +643,9 @@ describe('ProfilingIntegration', () => { Sentry.profiler.stopProfiler(); vi.advanceTimersByTime(1000); - expect(transportSpy.mock.calls?.[0]?.[0]?.[1]?.[0]?.[0]?.type).toBe('profile_chunk'); + const envelopeHeaders = transportSpy.mock.calls?.[0]?.[0]?.[1]?.[0]?.[0]; + expect(envelopeHeaders?.type).toBe('profile_chunk'); + expect(envelopeHeaders?.platform).toBe('node'); }); it('sets global profile context', async () => {