Skip to content

Commit

Permalink
preprod -> main (#606)
Browse files Browse the repository at this point in the history
  • Loading branch information
achauve authored Nov 8, 2024
2 parents d4cd75f + 8c88c63 commit 7a79849
Show file tree
Hide file tree
Showing 5 changed files with 232 additions and 87 deletions.
10 changes: 9 additions & 1 deletion .kontinuous/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pg:
limits:
cpu: "1"
memory: 1Gi
annotations:
clusterExtraLabels:
oblik.socialgouv.io/enabled: "false"

backend:
Expand All @@ -18,6 +18,8 @@ backend:
imagePackage: backend
host: "api-{{ .Values.global.host }}"
containerPort: 3000
labels:
oblik.socialgouv.io/enabled: "false"
resources:
requests:
cpu: 200m
Expand Down Expand Up @@ -77,6 +79,8 @@ frontend-usagers:
imagePackage: frontend-usagers
host: "{{ .Values.global.host }}"
containerPort: 8080
labels:
oblik.socialgouv.io/enabled: "false"
resources:
requests:
cpu: 50m
Expand All @@ -98,6 +102,8 @@ frontend-bo:
imagePackage: frontend-bo
host: "bo-{{ .Values.global.host }}"
containerPort: 8080
labels:
oblik.socialgouv.io/enabled: "false"
resources:
requests:
cpu: 50m
Expand Down Expand Up @@ -312,6 +318,8 @@ migrate-s3:
~needs: [build-migrations, init-db]
imagePackage: migrations
entrypoint: ["tail", "-f", "/dev/null"]
labels:
oblik.socialgouv.io/enabled: "false"
resources:
requests:
cpu: "1"
Expand Down
4 changes: 2 additions & 2 deletions packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
},
"dependencies": {
"@aws-sdk/client-s3": "^3.649.0",
"@sentry/node": "~8.31.0",
"@sentry/profiling-node": "^8.20.0",
"@sentry/node": "~8.35.0",
"@sentry/profiling-node": "^8.35.0",
"axios": "^1.7.4",
"body-parser": "~1.20.3",
"cookie-parser": "^1.4.6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ const yup = require("yup");
const DemandeSejour = require("../../services/DemandeSejour");
const logger = require("../../utils/logger");
const ValidationAppError = require("../../utils/validation-error");
const Sentry = require("@sentry/node");

const log = logger(module.filename);

module.exports = async function getByDepartementCodes(req, res, next) {
async function getByDepartementCodes(req, res, next) {
log.i("IN");
const { decoded } = req;
const { id: adminId } = decoded ?? {};
Expand Down Expand Up @@ -66,4 +67,19 @@ module.exports = async function getByDepartementCodes(req, res, next) {
} catch (error) {
return next(error);
}
}

module.exports = async function get(req, res, next) {
// create new Sentry trace manually to enable profiler for its nested span
Sentry.startNewTrace(async () => {
Sentry.startSpan(
{
name: `Profile ${req.method} ${req.baseUrl}${req.path}`,
op: "http",
},
async () => {
await getByDepartementCodes(req, res, next);
},
);
});
};
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
const Hebergement = require("../../services/Hebergement");

const logger = require("../../utils/logger");
const Sentry = require("@sentry/node");

const log = logger(module.filename);

module.exports = async function get(req, res) {
async function getByDepartements(req, res) {
log.i("IN");
const departements = req.departements.map((d) => d.value);
const { limit = 20, offset = 0, search = "", sort = "nom" } = req.query;
Expand Down Expand Up @@ -48,4 +49,19 @@ module.exports = async function get(req, res) {
"une erreur est survenue durant la récupération des hebergements",
});
}
}

module.exports = async function get(req, res) {
// create new Sentry trace manually to enable profiler for its nested span
Sentry.startNewTrace(async () => {
Sentry.startSpan(
{
name: `Profile ${req.method} ${req.baseUrl}${req.path}`,
op: "http",
},
async () => {
await getByDepartements(req, res);
},
);
});
};
Loading

0 comments on commit 7a79849

Please sign in to comment.