Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/profiling-node/src/integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down
2 changes: 2 additions & 0 deletions packages/profiling-node/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -400,13 +400,15 @@ export function createEventEnvelopeHeaders(
* Creates a standalone profile_chunk envelope.
*/
export function makeProfileChunkEnvelope(
platform: 'node',
chunk: ProfileChunk,
sdkInfo: SdkInfo | undefined,
tunnel: string | undefined,
dsn?: DsnComponents,
): ProfileChunkEnvelope {
const profileChunkHeader: ProfileChunkItem[0] = {
type: 'profile_chunk',
platform: platform,
};

return createEnvelope<ProfileChunkEnvelope>(createEventEnvelopeHeaders(sdkInfo, tunnel, dsn), [
Expand Down
4 changes: 3 additions & 1 deletion packages/profiling-node/test/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down