Skip to content

Commit

Permalink
feat: add Sentry integration (#525)
Browse files Browse the repository at this point in the history
  • Loading branch information
Diego Rodríguez Baquero authored Jan 30, 2024
1 parent cd2ac7e commit ac7d831
Show file tree
Hide file tree
Showing 5 changed files with 121 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ jobs:
NETWORK=${{ env.NETWORK }}
VERSION=${{ github.run_number }}_${{ steps.git.outputs.sha_short }}
VERSION_HASH=${{ env.VERSION_HASH }}
SENTRY_DSN=${{ secrets.SENTRY_DSN }}
LASSIE_EVENT_RECORDER_URL=${{ secrets.LASSIE_EVENT_RECORDER_URL }}
LASSIE_EVENT_RECORDER_AUTH=${{ secrets.LASSIE_EVENT_RECORDER_AUTH }}
LASSIE_EXCLUDE_PROVIDERS=bafzbeibhqavlasjc7dvbiopygwncnrtvjd2xmryk5laib7zyjor6kf3avm,12D3KooW9tKveruEsVduQotTn4y1JveEHG3oFtGLWfuQqVoG1LLT,12D3KooWT3dCAgHpMCSscSw4EKzNqcSjutEeB7TVqfedsK29CjfR,12D3KooWKBRcG1YF58DdbEkcmXi2gEPJL3hCD83Jz1VVYhB9Dajc,12D3KooWMui2xmPnUESnPgYF8iqjCnwuZiJC27ffQsbB2LLmSwip,12D3KooWEQu9bN4G6jCGUPehELV9uMKFsfx8pYtgyGnYCQE2j6er,12D3KooWMkBZYybPgHMr7Se5P2qecu4oz34V1TMgsLPJbNeBCekz,12D3KooWGW4U4iN6tcvFKcQD3Ay2i6LDdEAEJgZgdHUNasGGq8bb,12D3KooWNpqZzgepBsdeVQ4AfnNM2SeBVr5Mp2GcW1v5o3eghPTv,12D3KooWB9veWuW6rJ5YeTSYt5NSdTtJj6KzzriWwWPLv9SNnvph,12D3KooWFWZ7sZfgJH5FVNsN16p9JtN5MGJim5SejL6XweAM9Gv9,12D3KooWA9KoQ8NP6AtENpzzGUpCXLWnMQhJ5wjoyKKwVhUu6MtL,12D3KooWConjatXecCbhiRCnQYr5zFrJx87mamCCT5UFL7aZksG6,12D3KooWFH8QrpQNXMbGu7X6Tfa9m8WU7gZCgRspa43YzekkhmMv,12D3KooWPU4qxSwahNDLM4hBL2SCYE53g2XxyePQWWUBvgBZ8cJy,12D3KooWPJTPLqpnY1vbxg73BWqbs15YSoCvQogmfshM2zNB9AuD,12D3KooWCkLbm3Z4TUJGXZLqKiH3kRBJLpm7mdyYwZrrVDcQXBfH,12D3KooWH6WVTtcwN9eKvFGNh91Sx6ARoLz1abJkVfMpRtntKTXe,12D3KooWQKskLpVqHr3UqmgbJP7RA3JEXyYyfdWfxVft9kAutbtH,12D3KooWLVWPGedVvY1HtqKaxYQnsuW74biNhAaau6HNkW7peyKC,12D3KooWD7PXStjeFGB2mPyp5PrVufSUMT5uGfBL6e86a9S3f6k3,12D3KooWNkTg4b96FU3KhBJu32RDVjSeH2mkAP7QqAtMdZP4XRWc,12D3KooWL5TJ1VhqZmicWsXtCyge1ZDqTqwYMTUBMPVoy55YQwgG,12D3KooWRZsu7ZeT8k3td6MRkaPMofEjJSspbJXfampDCXtWcrcr,12D3KooWSu8A6YwQiLphJyovsnFxXtzSyiPAubNVu666uTtk9Fw5,12D3KooWN454hCZ32YaGVbggLYefq2AJfHjae42bUdMj6Lv736J3,12D3KooW9uThNo3MNB9aYF1xzjqy7RGjBQjiQpeyA77u3TohcFc6,12D3KooWEZS1tHX2Jkwypz9nSMN9BhAKPQRpLqQGReR7f7hjbeSj,12D3KooWCUSCGzM8VzM3puoAidEzwzRxxeRxLneSaxy6Z78ui9hV,12D3KooWCAj1azMhgLMWkbF12igcgsR1vJGVoe3qPN1agarF9qVZ,12D3KooWAqNJ3PzGsqed5FvQsQ4aaD5e51bjWYQFupvobqEGNqbE,12D3KooWSzpTV5rLhdXVR9nduCE6Paxykdhh9xd5bmqR7aY6Fgaw,12D3KooWLFm2zkAFwmR9qMSVHyfpKNdzrbfYw2X4iWgBwqfb482r,12D3KooWQgmve2ZyEUWkLDJQPDk51fLh7NrxN3wMBhxrGAeKKs26,12D3KooWD7mJuPuTtp5UD7e3wquFFaMPGMoS15TaaFairokPizem,12D3KooWAwKr1jKoQjtDwJE7doNchM2D3VCkSWJuWjRCcVDCs4Kr,12D3KooWMeq37zVhzBvup7Nbdjj4psrnDoJQJeQZJUoSpcgLZWdB,12D3KooWNTbe6ucTJ6mH2a4T1anGSPfKr551sxRfDqS4c4cQgyK3,12D3KooWQQGgeHxmiMNFeaUjuPQsR17G7xXnnw6oreoAU6eywqXV,12D3KooWHXm8475RYy5dzeKWWmptEq6VKNgU9cAA1Vec73cYxBme,12D3KooWAk1KGYrx9PRMX7WfgCisWwJ4BGETbZLhaeP9rMJhtXmg,12D3KooWC3pPyVdBjVFybrqe68Bu5Uv9Z1D3k3VmXv6Pj81e5tET,12D3KooWLgBdE5oY3RU8fF2NgL6gFxYDSsFXyuVeXmETEUURMkue,12D3KooWKf44xjkFQBWELgZM5L92rCyjCKApqZyNYbbqCuKUrDXY,12D3KooWMLU6uqcqq4Y46Zee5RYRVzEa1orUWBCZmSVHKCWZssdc,12D3KooWAMbdhjBwUh2yyKVcZmFfoRGazgnado7Zqt7MpmX8jkEq,12D3KooWPjZVVSVsjipCDchaMgYFj3sffuJF92u3VG8q5ZLmzC5Y,12D3KooWFGdUCssa2VCpgPvLmMLREhE7F22ei8ocYsZDwHq6odkm,12D3KooWJLa2R6XQjEackRT5s3n9TLuns3TBx5XY59axw8CAywBs,12D3KooWPkJZsSDzVXMxXLqpBpDWJKM8JRR1XMSS51W7h5bXjGKx,12D3KooWKxXUg5skmwC26t8puqo67Af8oe3vWWsi9pw6oQ2EtMRm,12D3KooWK6EKk5igwpvgrgc6NnjT8ng3Jba4osUKiZuZRFemLRof,12D3KooWCXp3pkDoq1tRrof6EL1TkGooAK4PkgtrfriFGk28dV47,12D3KooWAHRVN5emAjfGxpPK7ToQkKb3dLdSRLsrrsbDSgVKFDzT,12D3KooWFxyALpNkGvyCJhUUhmQRgT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nEUDa18EVFwtpMFzJgtE43PaZLTpEwuokv,12D3KooWMbioHP8KuXHoa932q1hcUfhaN8KNyn9WuMiAF4tSrGMh,12D3KooWSv9VQ2EZiokN8dZLsoE9vzGxw79pQmoBfDWMPQHBvLxv,12D3KooWShsGKn1wfYYzneopXR4zvQU6YQsarKoKmEc71aboEnWj
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ ARG NETWORK="local"
ARG VERSION="0_dev"
ARG VERSION_HASH="b0a8b2780294b01b0221d0f6f37f97498cc4aac1e73808a472e11d2a1919037e"
ARG ORCHESTRATOR_URL
ARG SENTRY_DSN

ARG LASSIE_EVENT_RECORDER_AUTH
ARG LASSIE_EXCLUDE_PROVIDERS
Expand All @@ -212,6 +213,8 @@ ENV VERSION=$VERSION
ENV VERSION_HASH=$VERSION_HASH
ENV ORCHESTRATOR_URL=$ORCHESTRATOR_URL

ENV SENTRY_DSN=$SENTRY_DSN

ENV LASSIE_EVENT_RECORDER_AUTH=$LASSIE_EVENT_RECORDER_AUTH
ENV LASSIE_EXCLUDE_PROVIDERS=$LASSIE_EXCLUDE_PROVIDERS
ENV LASSIE_BITSWAP_CONCURRENCY=$LASSIE_BITSWAP_CONCURRENCY
Expand Down
102 changes: 102 additions & 0 deletions container/shim/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions container/shim/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"dependencies": {
"@glif/filecoin-address": "^3.0.0",
"@ipld/car": "^5.2.6",
"@sentry/node": "^7.98.0",
"asn1.js-rfc2560": "^5.0.1",
"asn1.js-rfc5280": "^3.0.0",
"debug": "^4.3.4",
Expand Down
15 changes: 14 additions & 1 deletion container/shim/src/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import fsPromises from "node:fs/promises";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
import * as Sentry from "@sentry/node";
import express from "express";
import asyncHandler from "express-async-handler";
import mimeTypes from "mime-types";
import { CID } from "multiformats";
import serverTiming from "server-timing";
import { IS_CORE_L1, TESTING_CID } from "./config.js";
import { IS_CORE_L1, NETWORK, NODE_ID, ORCHESTRATOR_REGISTRATION, TESTING_CID } from "./config.js";
import { respondFromLassie } from "./fetchers/lassie.js";
import { addRegisterCheckRoute } from "./modules/registration.js";
import { getResponseFormat } from "./utils/http.js";
Expand All @@ -16,6 +17,18 @@ const rootCidRegex = /^\/ip[fn]s\/[^/]+$/;

const app = express();

Sentry.init({
enabled: ["main", "test"].includes(NETWORK) && ORCHESTRATOR_REGISTRATION,
integrations: [
new Sentry.Integrations.Http(),
new Sentry.Integrations.Express({ app }),
new Sentry.Integrations.OnUncaughtException(),
new Sentry.Integrations.OnUnhandledRejection(),
],
environment: NETWORK,
serverName: NODE_ID,
});

const testCAR = await fsPromises.readFile(
join(dirname(fileURLToPath(import.meta.url)), "..", "public", `${TESTING_CID}.car`)
);
Expand Down

0 comments on commit ac7d831

Please sign in to comment.