Skip to content

Commit

Permalink
feat(sentry): upgrade to V8 + use default setup configuration to use …
Browse files Browse the repository at this point in the history
…`opentelemetry` (#5960)

* fix: sentry secret

* fix: sentry secret

* fix: sentry secret

* fix: sentry secret

* fix: docker v

* fix: error msg

* fix: instrumentation

* fix: sentry secret

* fix: sentry secret

* fix: credentials

* fix: url
  • Loading branch information
maxgfr authored Jun 17, 2024
1 parent 1af11e9 commit 146f8f2
Show file tree
Hide file tree
Showing 20 changed files with 798 additions and 1,263 deletions.
2 changes: 1 addition & 1 deletion .kontinuous/env/dev/templates/www.sealed-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spec:
encryptedData:
ELASTICSEARCH_URL: AgAUJaPLaiM5gyJSFwbPwfZauAtxMMmW85PhhA85jAmz1z2k3MS/tgc0hzdwLJ6psJcivAONP11BcJ3uXuz7MvOsdXKhkKbU03nb4lB/jDhYh3dAj2Keuz0TMKgZSZUxj8rETucDRgusJ6I35tVFshXG3tbqlP/K290CrmlqA2hWVAHoR9HtdBdbRjW3vBxiOjjSvcUo7bWCU/9/TmMhWskkgVLG6bQOSUWZBS+9ab2yzg/2aqNN7ZwzZc5yzurLjdkk/vJhPTSMbmdCy3DIxTaDMt4fcJ6ONxQZtOW5MZqlhdMEmYbW+/OuHQlDt8kYR5hIn35WIRWOXa5109GyyI9UXFOHtRn4AxrxuWlyzzwiuQsWk147ozqU1bV1j80HFDJtFmopP2jDCRK9ijmLsBThBBqyPzFrfPZWQsLEj+xAb+jc2fuwKtfeNYnzoY9p0/IKwrUFkBjzjrggCSkm87bVPZGFUBK0tnL1l4OYB3qJhyWEVlL1nPFDCxIXOO3nIwC9XH6wUKe5VIIR/XZDWPnYFI+kktHFgPgGCqsHEujwp8w+aVpQy+L3r5kSuWonUguUIUDuvGYc/I5nXzpy25yKpSXjq/1d1vvx66pD8AngyDSGowGVX3nfvf2dAq1K/UQQUvWq2Aaf5Bh03tA0RVPczgtAQZ7iwueoMVWzBddGAywcIJ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gfqIrGoI9MDaSSEB9w4PBLTZsuLdaFZJgiWtzVPud1cnYSaYC4tsfG3qhHbKOUJXOA+BvJR2TZEdzHZCWMGUVg0slUjGCCbkvD7HDEswXYATDj3RzhkNbwhvbWp2HSfS8awlzTbOOhP3SQGr3EiuD0OVgBW/fRBAY77cq6NnNqpiK4STutN9uC801Zxd9uPsWiY5nv0XtMzS6No4ZutyKR6gI10ZSQqvRrdcYbAPoYbOBIUR2zXyzd1bx+wCnojRofTf/gHptKq9FopKDlTmxj040rTW42CIQzXgf5kVRUxKZrDB0LICLwRNU+YYdK8kuBIvisOQ9dx2P6Ez4nAfWdnO93z87tt7306a9kIyuw/diN75t6ai6uJhF0ac+FiIEDJTNexVg7CQg2kPzgpH4M5H7RgsxnKxPm1qnbDMJ7KG3Vzu4BG4vc/fa6fgihpN+t0b5PqHbuWaskhqUSEPsKdx8Q2cRgL0+27JCpdWRDQDX8wF3MTgdWWxE3TYZmjGq42u9TNfHBBmr/PCDfhPI3PFV+WZkwayV3K3LIjQf9H8GcpZD7w5OyL44oAYcL6Iye6Y1420A6mq5b1a9rayO6wWlLQQwtX78haGVcMv7RXo+bK/CXu+IR
template:
metadata:
annotations:
Expand Down
2 changes: 1 addition & 1 deletion .kontinuous/env/dev/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
NEXT_PUBLIC_SITE_URL: "https://{{.Values.global.host}}"
NEXT_PUBLIC_SENTRY_ORG: "incubateur"
NEXT_PUBLIC_SENTRY_PROJECT: "code-du-travail-numerique"
NEXT_PUBLIC_SENTRY_URL: "https://sentry.fabrique.social.gouv.fr/"
NEXT_PUBLIC_SENTRY_URL: "https://sentry.fabrique.social.gouv.fr"
NEXT_PUBLIC_ES_INDEX_PREFIX: "cdtn-preprod"
NEXT_PUBLIC_BRANCH_NAME_SLUG: "{{.Values.global.branchSlug32}}"
secrets:
Expand Down
2 changes: 1 addition & 1 deletion .kontinuous/env/preprod/templates/www.sealed-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spec:
encryptedData:
ELASTICSEARCH_URL: AgAUJaPLaiM5gyJSFwbPwfZauAtxMMmW85PhhA85jAmz1z2k3MS/tgc0hzdwLJ6psJcivAONP11BcJ3uXuz7MvOsdXKhkKbU03nb4lB/jDhYh3dAj2Keuz0TMKgZSZUxj8rETucDRgusJ6I35tVFshXG3tbqlP/K290CrmlqA2hWVAHoR9HtdBdbRjW3vBxiOjjSvcUo7bWCU/9/TmMhWskkgVLG6bQOSUWZBS+9ab2yzg/2aqNN7ZwzZc5yzurLjdkk/vJhPTSMbmdCy3DIxTaDMt4fcJ6ONxQZtOW5MZqlhdMEmYbW+/OuHQlDt8kYR5hIn35WIRWOXa5109GyyI9UXFOHtRn4AxrxuWlyzzwiuQsWk147ozqU1bV1j80HFDJtFmopP2jDCRK9ijmLsBThBBqyPzFrfPZWQsLEj+xAb+jc2fuwKtfeNYnzoY9p0/IKwrUFkBjzjrggCSkm87bVPZGFUBK0tnL1l4OYB3qJhyWEVlL1nPFDCxIXOO3nIwC9XH6wUKe5VIIR/XZDWPnYFI+kktHFgPgGCqsHEujwp8w+aVpQy+L3r5kSuWonUguUIUDuvGYc/I5nXzpy25yKpSXjq/1d1vvx66pD8AngyDSGowGVX3nfvf2dAq1K/UQQUvWq2Aaf5Bh03tA0RVPczgtAQZ7iwueoMVWzBddGAywcIJOW1lJQJ6kQZ6flt1dnDosLSU7Ra6KdRAElopLjqNzEUFJpGzv+Di72mcrOWDkUxqz2qFssfwDuPaQ/HLS0+mgt8qHFJLgQxCOCuhyz2GWv
ELASTICSEARCH_TOKEN_API: AgC4tRnPP5Rq9G12mvlWjt/m8w4Z6AAZPQwbLxK2sYHEfF7KuH+QVeknaX6x861lGHSZq4r1bJJJUBInCG1gwV8j8ndt6g4GfAul+fouRoYVCoyCyRZ063qXm+OsTvaihlbi8hAPoTt+iDWkX6PRkMMrWrBTgxGHpoTizeqLYyu2EXz5nSmF1UfzIgXf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IvisOQ9dx2P6Ez4nAfWdnO93z87tt7306a9kIyuw/diN75t6ai6uJhF0ac+FiIEDJTNexVg7CQg2kPzgpH4M5H7RgsxnKxPm1qnbDMJ7KG3Vzu4BG4vc/fa6fgihpN+t0b5PqHbuWaskhqUSEPsKdx8Q2cRgL0+27JCpdWRDQDX8wF3MTgdWWxE3TYZmjGq42u9TNfHBBmr/PCDfhPI3PFV+WZkwayV3K3LIjQf9H8GcpZD7w5OyL44oAYcL6Iye6Y1420A6mq5b1a9rayO6wWlLQQwtX78haGVcMv7RXo+bK/CXu+IR
template:
metadata:
annotations:
Expand Down
2 changes: 1 addition & 1 deletion .kontinuous/env/preprod/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
NEXT_PUBLIC_IS_PREPRODUCTION_DEPLOYMENT: "true"
NEXT_PUBLIC_SENTRY_ORG: "incubateur"
NEXT_PUBLIC_SENTRY_PROJECT: "code-du-travail-numerique"
NEXT_PUBLIC_SENTRY_URL: "https://sentry.fabrique.social.gouv.fr/"
NEXT_PUBLIC_SENTRY_URL: "https://sentry.fabrique.social.gouv.fr"
NEXT_PUBLIC_ES_INDEX_PREFIX: "cdtn-preprod"
secrets:
sentry_auth_token:
Expand Down
2 changes: 1 addition & 1 deletion .kontinuous/env/prod/templates/www.sealed-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
encryptedData:
ELASTICSEARCH_TOKEN_API: AgA09RFGyeQx/ZHlO7QCNBVidD3gHJpCSgJpp304PwFmxHD3C2mOcTDaTo1nqwuiwmeTYi290tHasYBftNd54GF3LTkhwhpxo06ntUszY5bHoVKUj4bpSrXyRl52BMIGVgeg5u0DKJ+h376n3c8mPO3xmABBIuSFNM7WNRqileCw25R1LskTCIwQcA9r1yd8Mwlf7fDfVqB9Ltp5FXYg0X1dwR2VjZb4i84jHqVazzgFFvHeTp32GpUZoPH3mrSqhRqqITQXQ61VMU5R1ka7WoNtwV34P1cAZ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/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
NEXT_PUBLIC_SITE_URL: https://code.travail.gouv.fr
NEXT_PUBLIC_SENTRY_ORG: "incubateur"
NEXT_PUBLIC_SENTRY_PROJECT: "code-du-travail-numerique"
NEXT_PUBLIC_SENTRY_URL: "https://sentry.fabrique.social.gouv.fr/"
NEXT_PUBLIC_SENTRY_URL: "https://sentry.fabrique.social.gouv.fr"
NEXT_PUBLIC_ES_INDEX_PREFIX: "cdtn-prod"
secrets:
sentry_auth_token:
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@ COPY --from=dist --chown=1000:1000 /dep/packages/code-du-travail-frontend/.next
COPY --from=dist --chown=1000:1000 /dep/packages/code-du-travail-frontend/package.json /app/packages/code-du-travail-frontend/package.json
COPY --from=dist --chown=1000:1000 /dep/packages/code-du-travail-frontend/public /app/packages/code-du-travail-frontend/public
COPY --from=dist --chown=1000:1000 /dep/packages/code-du-travail-frontend/next.config.js /app/packages/code-du-travail-frontend/next.config.js
COPY --from=dist --chown=1000:1000 /dep/packages/code-du-travail-frontend/sentry.client.config.js /app/packages/code-du-travail-frontend/sentry.client.config.js
COPY --from=dist --chown=1000:1000 /dep/packages/code-du-travail-frontend/sentry.server.config.js /app/packages/code-du-travail-frontend/sentry.server.config.js
COPY --from=dist --chown=1000:1000 /dep/packages/code-du-travail-frontend/instrumentation.ts /app/packages/code-du-travail-frontend/instrumentation.ts
COPY --from=dist --chown=1000:1000 /dep/packages/code-du-travail-frontend/sentry.client.config.ts /app/packages/code-du-travail-frontend/sentry.client.config.ts
COPY --from=dist --chown=1000:1000 /dep/packages/code-du-travail-frontend/sentry.server.config.ts /app/packages/code-du-travail-frontend/sentry.server.config.ts
COPY --from=dist --chown=1000:1000 /dep/packages/code-du-travail-frontend/redirects.json /app/packages/code-du-travail-frontend/redirects.json
COPY --from=dist --chown=1000:1000 /dep/packages/code-du-travail-frontend/scripts /app/packages/code-du-travail-frontend/scripts
COPY --from=dist --chown=1000:1000 /dep/package.json /app/package.json
Expand Down
22 changes: 0 additions & 22 deletions packages/code-du-travail-frontend/instrumentation.node.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/code-du-travail-frontend/instrumentation.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export async function register() {
if (process.env.NEXT_RUNTIME === "nodejs") {
await import("./instrumentation.node");
await import("./sentry.server.config");
}
}
3 changes: 3 additions & 0 deletions packages/code-du-travail-frontend/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ const customJestConfig = {
"<rootDir>/cypress/",
],
testTimeout: 20000,
moduleNameMapper: {
"^@sentry/nextjs$": "<rootDir>/test/mockSentry.js",
},
};

module.exports = createJestConfig(customJestConfig);
18 changes: 8 additions & 10 deletions packages/code-du-travail-frontend/next.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
const ContentSecurityPolicy = `
default-src 'self' *.travail.gouv.fr *.data.gouv.fr *.fabrique.social.gouv.fr;
img-src 'self' data: *.fabrique.social.gouv.fr https://travail-emploi.gouv.fr https://mon-entreprise.urssaf.fr https://www.service-public.fr https://cdtn-prod-public.s3.gra.io.cloud.ovh.net;
script-src 'self' https://mon-entreprise.urssaf.fr *.fabrique.social.gouv.fr https://cdnjs.cloudflare.com ${process.env.NEXT_PUBLIC_APP_ENV !== "production" && "'unsafe-eval'"
};
script-src 'self' https://mon-entreprise.urssaf.fr *.fabrique.social.gouv.fr https://cdnjs.cloudflare.com ${
process.env.NEXT_PUBLIC_APP_ENV !== "production" && "'unsafe-eval'"
};
frame-src 'self' https://mon-entreprise.urssaf.fr https://matomo.fabrique.social.gouv.fr *.dailymotion.com https://cdtn-prod-public.s3.gra.io.cloud.ovh.net;
style-src 'self' 'unsafe-inline';
font-src 'self' data: blob:;
Expand All @@ -13,21 +14,18 @@ child-src 'self' blob:;
const { withSentryConfig } = require("@sentry/nextjs");
const MappingReplacement = require("./redirects");

// See config here : https://github.com/getsentry/sentry-webpack-plugin#options
const sentryConfig = {
org: process.env.NEXT_PUBLIC_SENTRY_ORG,
project: process.env.NEXT_PUBLIC_SENTRY_PROJECT,
authToken: process.env.SENTRY_AUTH_TOKEN,
release: process.env.NEXT_PUBLIC_SENTRY_RELEASE,
url: process.env.NEXT_PUBLIC_SENTRY_URL,
release: { name: process.env.NEXT_PUBLIC_SENTRY_RELEASE },
sentryUrl: process.env.NEXT_PUBLIC_SENTRY_URL,
hideSourceMaps: true,
widenClientFileUpload: true,
};

const nextConfig = {
poweredByHeader: false,
sentry: {
hideSourceMaps: true,
widenClientFileUpload: true,
},
compiler: {
reactRemoveProperties:
process.env.NEXT_PUBLIC_APP_ENV === "production"
Expand All @@ -39,7 +37,7 @@ const nextConfig = {
ignoreDuringBuilds: true,
},
staticPageGenerationTimeout: 60 * 5, // 5 minutes
experimental: { instrumentationHook: true }, // for sentry opentelemtry instrumentation
experimental: { instrumentationHook: true },
};

const moduleExports = {
Expand Down
10 changes: 2 additions & 8 deletions packages/code-du-travail-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,10 @@
"@elastic/elasticsearch": "^8.13.1",
"@matejmazur/react-katex": "^3.1.3",
"@next/bundle-analyzer": "^13.0.0",
"@opentelemetry/auto-instrumentations-node": "^0.47.0",
"@opentelemetry/exporter-trace-otlp-http": "^0.52.0",
"@opentelemetry/instrumentation-generic-pool": "^0.37.0",
"@opentelemetry/instrumentation-http": "^0.52.0",
"@opentelemetry/instrumentation-net": "^0.37.0",
"@opentelemetry/resources": "^1.25.0",
"@opentelemetry/sdk-node": "^0.52.0",
"@opentelemetry/sdk-trace-node": "^1.25.0",
"@opentelemetry/semantic-conventions": "^1.25.0",
"@sentry/nextjs": "^7.114.0",
"@sentry/opentelemetry-node": "^7.114.0",
"@sentry/nextjs": "^8.9.2",
"@socialgouv/cdtn-elasticsearch": "^2.44.2",
"@socialgouv/cdtn-logger": "^2.0.0",
"@socialgouv/cdtn-types": "^2.42.3",
Expand Down
49 changes: 8 additions & 41 deletions packages/code-du-travail-frontend/pages/_error.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
import * as Sentry from "@sentry/nextjs";
import { Button, Container, Section, theme } from "@socialgouv/cdtn-ui";
import NextErrorComponent from "next/error";
import React from "react";
import styled from "styled-components";
import Error from "next/error";

import { Layout } from "../src/layout/Layout";

const MyError = ({ statusCode, hasGetInitialPropsRun, err }) => {
if (!hasGetInitialPropsRun && err) {
// getInitialProps is not called in case of
// https://github.com/vercel/next.js/issues/8592. As a workaround, we pass
// err via _app.js so it can be captured
Sentry.captureException(err);
// Flushing is not required in this case as it only happens on the client
}

const MyError = ({ statusCode }) => {
return (
<Layout>
<CenteredContainer>
Expand All @@ -31,38 +23,13 @@ const MyError = ({ statusCode, hasGetInitialPropsRun, err }) => {
);
};

MyError.getInitialProps = async ({ res, err, asPath }) => {
const errorInitialProps: any = {
message: err && err.message,
...(await NextErrorComponent.getInitialProps({
err,
res,
} as any)),
};

// Workaround for https://github.com/vercel/next.js/issues/8592, mark when
// getInitialProps has run
errorInitialProps.hasGetInitialPropsRun = true;

if (err) {
Sentry.captureException(err);

// Flushing before returning is necessary if deploying to Vercel, see
// https://vercel.com/docs/platform/limits#streaming-responses
await Sentry.flush(2000);

return errorInitialProps;
}

// If this point is reached, getInitialProps was called without any
// information about what the error might be. This is unexpected and may
// indicate a bug introduced in Next.js, so record it in Sentry
Sentry.captureException(
new Error(`_error.js getInitialProps missing data at path: ${asPath}`)
);
await Sentry.flush(2000);
MyError.getInitialProps = async (contextData) => {
// In case this is running in a serverless function, await this in order to give Sentry
// time to send the error before the lambda exits
await Sentry.captureUnderscoreErrorException(contextData);

return errorInitialProps;
// This will contain the status code of the response
return Error.getInitialProps(contextData);
};

export default MyError;
Expand Down
Loading

0 comments on commit 146f8f2

Please sign in to comment.