Skip to content

Commit 8907578

Browse files
committed
feat: Add a way to download raw envelopes
Fixes #655.
1 parent 97dfa76 commit 8907578

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

.changeset/lemon-yaks-hammer.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
'@spotlightjs/spotlight': minor
3+
'@spotlightjs/electron': minor
4+
'@spotlightjs/overlay': minor
5+
'@spotlightjs/astro': minor
6+
---
7+
8+
Make event id a link to raw envelope on envelope details page

packages/overlay/src/integrations/sentry/components/explore/envelopes/EnvelopeDetails.tsx

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Envelope } from '@sentry/types';
1+
import type { Envelope } from '@sentry/core';
22
import { useState } from 'react';
33
import type { RawEventContext } from '~/integrations/integration';
44
import SidePanel, { SidePanelHeader } from '~/ui/SidePanel';
@@ -9,16 +9,19 @@ export default function EnvelopeDetails({ data }: { data: { envelope: Envelope;
99
const { envelope, rawEnvelope } = data;
1010
const header = envelope[0];
1111
const items = envelope[1];
12+
const downloadUrl = URL.createObjectURL(new Blob([rawEnvelope.data], { type: rawEnvelope.contentType }));
13+
const downloadName = `${header.event_id}-${rawEnvelope.contentType}.bin`;
1214
return (
1315
<SidePanel backto="/explore/envelopes">
1416
<SidePanelHeader
1517
title="Envelope Details"
1618
subtitle={
17-
header.event_id ? (
18-
<>
19-
Event Id <span className="text-primary-500">&mdash;</span> {header.event_id}
20-
</>
21-
) : undefined
19+
<>
20+
Event Id <span className="text-primary-500">&mdash;</span>{' '}
21+
<a href={downloadUrl} download={downloadName}>
22+
{String(header.event_id)}
23+
</a>
24+
</>
2225
}
2326
backto="/explore/envelopes"
2427
/>

0 commit comments

Comments
 (0)