Versions

  • v119

    11/26/2024
    Open: Version
    Changes from v118 to v119
    +0
    -0
    ⦚ 101 unchanged lines ⦚
    ⦚ 101 unchanged lines ⦚
  • v118

    11/26/2024
    Open: Version
    Changes from v117 to v118
    +1
    -1
    import { Hono } from "npm:hono";
    import { html } from "npm:hono/html";
    import { sentryTunnel } from "./elatedApricotOrca";

    const app = new Hono();
    ⦚ 96 unchanged lines ⦚
    import { Hono } from "npm:hono";
    import { html } from "npm:hono/html";
    import { sentryTunnel } from "./sentryTunnel";

    const app = new Hono();
    ⦚ 96 unchanged lines ⦚
  • v117

    11/26/2024
    Open: Version
    Changes from v116 to v117
    +3
    -3
    ⦚ 94 unchanged lines ⦚
    });

    app.post("/tunnel2", async (c) => {
    return await sentryTunnel({ request: c.req.raw, host: SENTRY_HOST, projectIds: [SENTRY_PROJECT_ID] });
    });

    export default app.fetch;
    ⦚ 94 unchanged lines ⦚
    });

    // app.post("/tunnel", async (c) => {
    // return await sentryTunnel({ request: c.req.raw, host: SENTRY_HOST, projectIds: [SENTRY_PROJECT_ID] });
    // });

    export default app.fetch;
  • v116

    11/26/2024
    Open: Version
    Changes from v115 to v116
    +1
    -1
    ⦚ 41 unchanged lines ⦚
    dsn: "https://${SENTRY_KEY}@${SENTRY_HOST}/${SENTRY_PROJECT_ID}",
    integrations: [Sentry.browserTracingIntegration(), Sentry.replayIntegration()],
    tunnel: "/tunnel2",
    release: "1",
    tracesSampleRate: 1.0,
    ⦚ 55 unchanged lines ⦚
    ⦚ 41 unchanged lines ⦚
    dsn: "https://${SENTRY_KEY}@${SENTRY_HOST}/${SENTRY_PROJECT_ID}",
    integrations: [Sentry.browserTracingIntegration(), Sentry.replayIntegration()],
    tunnel: "/tunnel",
    release: "1",
    tracesSampleRate: 1.0,
    ⦚ 55 unchanged lines ⦚
  • v115

    11/26/2024
    Open: Version
    Changes from v114 to v115
    +1
    -1
    ⦚ 41 unchanged lines ⦚
    dsn: "https://${SENTRY_KEY}@${SENTRY_HOST}/${SENTRY_PROJECT_ID}",
    integrations: [Sentry.browserTracingIntegration(), Sentry.replayIntegration()],
    tunnel: "/tunnel",
    release: "1",
    tracesSampleRate: 1.0,
    ⦚ 55 unchanged lines ⦚
    ⦚ 41 unchanged lines ⦚
    dsn: "https://${SENTRY_KEY}@${SENTRY_HOST}/${SENTRY_PROJECT_ID}",
    integrations: [Sentry.browserTracingIntegration(), Sentry.replayIntegration()],
    tunnel: "/tunnel2",
    release: "1",
    tracesSampleRate: 1.0,
    ⦚ 55 unchanged lines ⦚
  • v114

    11/26/2024
    Open: Version
    Changes from v113 to v114
    +1
    -1
    ⦚ 94 unchanged lines ⦚
    });

    app.post("/tunnel", async (c) => {
    return await sentryTunnel({ request: c.req.raw, host: SENTRY_HOST, projectIds: [SENTRY_PROJECT_ID] });
    });

    export default app.fetch;
    ⦚ 94 unchanged lines ⦚
    });

    app.post("/tunnel2", async (c) => {
    return await sentryTunnel({ request: c.req.raw, host: SENTRY_HOST, projectIds: [SENTRY_PROJECT_ID] });
    });

    export default app.fetch;
  • v113

    11/26/2024
    Open: Version
    Changes from v112 to v113
    +30
    -30
    ⦚ 59 unchanged lines ⦚
    });

    // app.post("/tunnel", async c => {
    // const SENTRY_PROJECT_IDS = [SENTRY_PROJECT_ID];

    // try {
    // const envelopeBytes = await c.req.arrayBuffer();
    // const envelope = new TextDecoder().decode(envelopeBytes);
    // const piece = envelope.split("\n")[0];
    // const header = JSON.parse(piece);
    // const dsn = new URL(header["dsn"]);
    // const project_id = dsn.pathname?.replace("/", "");

    // if (dsn.hostname !== SENTRY_HOST) {
    // throw new Error(`Invalid sentry hostname: ${dsn.hostname}`);
    // }

    // if (!project_id || !SENTRY_PROJECT_IDS.includes(project_id)) {
    // throw new Error(`Invalid sentry project id: ${project_id}`);
    // }

    // const upstream_sentry_url = `https://${SENTRY_HOST}/api/${project_id}/envelope/`;
    // const res = await fetch(upstream_sentry_url, {
    // method: "POST",
    // body: envelopeBytes,
    // });

    // return Response.json({}, { status: 200 });
    // } catch (e) {
    // console.error("error tunneling to sentry", e);
    // return Response.json(
    // { error: "error tunneling to sentry" },
    // { status: 500 },
    // );
    ⦚ 59 unchanged lines ⦚
    });

    app.post("/tunnel", async c => {
    const SENTRY_PROJECT_IDS = [SENTRY_PROJECT_ID];

    try {
    const envelopeBytes = await c.req.arrayBuffer();
    const envelope = new TextDecoder().decode(envelopeBytes);
    const piece = envelope.split("\n")[0];
    const header = JSON.parse(piece);
    const dsn = new URL(header["dsn"]);
    const project_id = dsn.pathname?.replace("/", "");

    if (dsn.hostname !== SENTRY_HOST) {
    throw new Error(`Invalid sentry hostname: ${dsn.hostname}`);
    }

    if (!project_id || !SENTRY_PROJECT_IDS.includes(project_id)) {
    throw new Error(`Invalid sentry project id: ${project_id}`);
    }

    const upstream_sentry_url = `https://${SENTRY_HOST}/api/${project_id}/envelope/`;
    const res = await fetch(upstream_sentry_url, {
    method: "POST",
    body: envelopeBytes,
    });

    return Response.json({}, { status: 200 });
    } catch (e) {
    console.error("error tunneling to sentry", e);
    return Response.json(
    { error: "error tunneling to sentry" },
    { status: 500 },
    );
  • v112

    11/26/2024
    Open: Version
    Changes from v111 to v112
    +1
    -1
    ⦚ 94 unchanged lines ⦚
    // });

    app.post("/tunnel", async (c) => {
    return await sentryTunnel({ request: c.req.raw, host: SENTRY_HOST, projectIds: [SENTRY_PROJECT_ID] });
    });

    export default app.fetch;
    ⦚ 94 unchanged lines ⦚
    // });

    app.post("/tunnel2", async (c) => {
    return await sentryTunnel({ request: c.req.raw, host: SENTRY_HOST, projectIds: [SENTRY_PROJECT_ID] });
    });

    export default app.fetch;
  • v111

    11/26/2024
    Open: Version
    +101
    -0

    import { Hono } from "npm:hono";
    import { html } from "npm:hono/html";
    import { sentryTunnel } from "./elatedApricotOrca";

    const app = new Hono();

    const SENTRY_KEY = Deno.env.get("SENTRY_KEY") as string;
    const SENTRY_HOST = Deno.env.get("SENTRY_HOST") as string;
    const SENTRY_PROJECT_ID = Deno.env.get("SENTRY_PROJECT_ID") as string;
    const jsEndpoint = "sentry.js";

    app.get("/", c =>
    c.html(html`<html lang="en">
    <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <style>
    body {
    font-family: Arial, sans-serif;
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    text-align: center;
    }
    h1 {
    color: #333;
    }
    </style>
    <title>Sentry Tracking Demo</title>
    <script type="module" src="/${jsEndpoint}"></script>
    </head>
    <body>
    <h1>🐞 Sentry Tracking Demo</h1>
    </body>
    </html>
    `));
nbbaier-sentrytesting.web.val.run
Updated: November 26, 2024