Set commit sha as release
This commit is contained in:
@@ -20,6 +20,10 @@ Sentry.init({
|
||||
],
|
||||
replaysOnErrorSampleRate: 1,
|
||||
replaysSessionSampleRate: 0.02,
|
||||
release:
|
||||
document
|
||||
.querySelector("meta[name='commit_sha']")
|
||||
?.getAttribute("content") ?? undefined,
|
||||
sendDefaultPii: true,
|
||||
tracesSampleRate: 0.1,
|
||||
tunnel: "/api/st",
|
||||
|
||||
@@ -130,6 +130,7 @@ export async function loader({
|
||||
}): Promise<{ [k: string]: any }> {
|
||||
let data: { [k: string]: string } = {};
|
||||
|
||||
if (context.env.COMMIT_SHA) data.commit_sha = context.env.COMMIT_SHA;
|
||||
if (context.data.current_user) data = { ...context.data.current_user };
|
||||
if (context.env.REMIX_DSN) data.dsn = context.env.REMIX_DSN;
|
||||
if (context.data.nonce) data.nonce = context.data.nonce;
|
||||
@@ -202,6 +203,9 @@ function DocumentWrapper(props: {
|
||||
/>
|
||||
))}
|
||||
<meta charSet="UTF-8" />
|
||||
{loaderData.commit_sha ? (
|
||||
<meta name="commit_sha" content={loaderData.commit_sha} />
|
||||
) : null}
|
||||
{loaderData.dsn ? (
|
||||
<meta name="dsn" content={loaderData.dsn} />
|
||||
) : null}
|
||||
|
||||
@@ -383,6 +383,7 @@ async function setTheme(context: RequestContext) {
|
||||
export const onRequest = [
|
||||
Sentry.sentryPagesPlugin((context: RequestContext) => ({
|
||||
dsn: context.env.FUNCTIONS_DSN,
|
||||
release: context.env.COMMIT_SHA,
|
||||
sendDefaultPii: true,
|
||||
})),
|
||||
setAuth,
|
||||
|
||||
Reference in New Issue
Block a user