mirror of
https://github.com/hyperdxio/hyperdx
synced 2026-04-21 13:37:15 +00:00
Add Sentry integration info (#116)

This commit is contained in:
parent
df19eef14c
commit
f205ed5b14
5 changed files with 44 additions and 2 deletions
5
.changeset/light-zoos-add.md
Normal file
5
.changeset/light-zoos-add.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'@hyperdx/app': patch
|
||||
---
|
||||
|
||||
feat: Add Sentry Integration section to Team Settings
|
||||
|
|
@ -32,6 +32,7 @@ describe('team router', () => {
|
|||
Object {
|
||||
"allowedAuthMethods": Array [],
|
||||
"name": "fake@deploysentinel.com's Team",
|
||||
"sentryDSN": "",
|
||||
"teamInvites": Array [],
|
||||
"users": Array [
|
||||
Object {
|
||||
|
|
|
|||
|
|
@ -71,6 +71,20 @@ router.post('/', isUserAuthenticated, async (req, res, next) => {
|
|||
}
|
||||
});
|
||||
|
||||
const getSentryDSN = (apiKey: string, ingestorApiUrl: string) => {
|
||||
try {
|
||||
const url = new URL(ingestorApiUrl);
|
||||
url.username = apiKey.replaceAll('-', '');
|
||||
url.pathname = '0';
|
||||
// TODO: Set up hostname from env variable
|
||||
url.hostname = 'localhost';
|
||||
return url.toString();
|
||||
} catch (e) {
|
||||
logger.error(serializeError(e));
|
||||
return '';
|
||||
}
|
||||
};
|
||||
|
||||
router.get('/', isUserAuthenticated, async (req, res, next) => {
|
||||
try {
|
||||
const teamId = req.user?.team;
|
||||
|
|
@ -114,6 +128,7 @@ router.get('/', isUserAuthenticated, async (req, res, next) => {
|
|||
name: ti.name,
|
||||
url: `${config.FRONTEND_URL}/join-team?token=${ti.token}`,
|
||||
})),
|
||||
sentryDSN: getSentryDSN(team.apiKey, config.INGESTOR_API_URL),
|
||||
});
|
||||
} catch (e) {
|
||||
next(e);
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ export default function MyApp({ Component, pageProps }: AppProps) {
|
|||
<Head>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css"
|
||||
href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.0/font/bootstrap-icons.css"
|
||||
/>
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/Icon32.png" />
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
|
|
|
|||
|
|
@ -258,7 +258,7 @@ export default function TeamPage() {
|
|||
<div className="my-5">
|
||||
<h2>Slack Webhooks</h2>
|
||||
<div className="text-muted">
|
||||
Lean how to set up a Slack webhook{' '}
|
||||
Learn how to set up a Slack webhook{' '}
|
||||
<a
|
||||
href="https://api.slack.com/messaging/webhooks"
|
||||
target="_blank"
|
||||
|
|
@ -341,6 +341,27 @@ export default function TeamPage() {
|
|||
</Modal.Body>
|
||||
</Modal>
|
||||
</div>
|
||||
|
||||
{team.sentryDSN && (
|
||||
<div className="my-5">
|
||||
<h2>Sentry Integration</h2>
|
||||
<div className="mb-2 text-muted">
|
||||
To setup Sentry integration, use your Sentry DSN below.
|
||||
</div>
|
||||
<div>
|
||||
<strong>{team.sentryDSN}</strong>
|
||||
<CopyToClipboard text={team.sentryDSN}>
|
||||
<Button
|
||||
variant="link"
|
||||
className="px-0 text-muted-hover text-decoration-none fs-7 ms-3"
|
||||
>
|
||||
📋 Copy URL
|
||||
</Button>
|
||||
</CopyToClipboard>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{hasAllowedAuthMethods && (
|
||||
<>
|
||||
<h2>Security Policies</h2>
|
||||
|
|
|
|||
Loading…
Reference in a new issue