From 3d68ae9a3b7a4edc50d79e4b8e4aeac4c35163cd Mon Sep 17 00:00:00 2001 From: Dan Fuchs Date: Tue, 14 Jan 2025 14:02:18 -0600 Subject: [PATCH] mobu: sentry --- applications/mobu/Chart.yaml | 2 +- applications/mobu/README.md | 2 ++ applications/mobu/secrets.yaml | 7 +++++++ applications/mobu/templates/deployment.yaml | 7 +++++++ applications/mobu/tests/github_ci_app_enabled_test.yaml | 2 ++ applications/mobu/tests/github_disabled_test.yaml | 2 ++ .../mobu/tests/github_refresh_app_enabled_test.yaml | 2 ++ applications/mobu/values-idfdev.yaml | 1 + applications/mobu/values-idfint.yaml | 1 + applications/mobu/values-idfprod.yaml | 1 + applications/mobu/values-roundtable-dev.yaml | 1 + applications/mobu/values-roundtable-prod.yaml | 1 + applications/mobu/values-usdfdev.yaml | 1 + applications/mobu/values-usdfint.yaml | 1 + applications/mobu/values-usdfprod.yaml | 1 + applications/mobu/values.yaml | 7 +++++++ .../templates/applications/infrastructure/mobu.yaml | 2 ++ 17 files changed, 40 insertions(+), 1 deletion(-) diff --git a/applications/mobu/Chart.yaml b/applications/mobu/Chart.yaml index 9c3ab09f38..b8f937dead 100644 --- a/applications/mobu/Chart.yaml +++ b/applications/mobu/Chart.yaml @@ -5,4 +5,4 @@ description: "Continuous integration testing" home: https://mobu.lsst.io/ sources: - "https://github.com/lsst-sqre/mobu" -appVersion: 13.2.0 +appVersion: 14.0.0 diff --git a/applications/mobu/README.md b/applications/mobu/README.md index 2a3f2835b8..ea2734e0c4 100644 --- a/applications/mobu/README.md +++ b/applications/mobu/README.md @@ -25,6 +25,8 @@ Continuous integration testing | config.metrics.schemaManager.suffix | string | `""` | Suffix to add to all registered subjects. This is sometimes useful for experimentation during development. | | config.pathPrefix | string | `"/mobu"` | Prefix for mobu's API routes. | | config.profile | string | `"production"` | One of 'production' or 'development'. 'production' configures structured JSON logging, and 'development' configures unstructured human readable logging. | +| config.sentryEnvironment | string | `nil` | The environment to report to Sentry | +| config.sentryTracesSampleConfig | float | `0` | Sentry tracing config: a float to specify a percentage, or "errors" to send all transactions with errors. | | config.slackAlerts | bool | `true` | Whether to send alerts and status to Slack. | | fullnameOverride | string | `""` | Override the full name for resources (includes the release name) | | global.baseUrl | string | Set by Argo CD | Base URL for the environment | diff --git a/applications/mobu/secrets.yaml b/applications/mobu/secrets.yaml index c9257c8e5a..92e1b15e18 100644 --- a/applications/mobu/secrets.yaml +++ b/applications/mobu/secrets.yaml @@ -68,3 +68,10 @@ github-refresh-app-webhook-secret: This value is also configured in the GitHub UI for the matching GitHub application. If we need to change this value, the Phalanx secret must be updated, and the value must be changed in the GitHub UI. + +sentry-dsn: + description: >- + The Sentry DSN for the mobu Sentry project. This is a URL that includes an + authentication token that tells the Sentry SDK where to send events. It can + be found here: + https://rubin-observatory.sentry.io/settings/projects/mobu/keys/ diff --git a/applications/mobu/templates/deployment.yaml b/applications/mobu/templates/deployment.yaml index d2c196806e..f66d9cd16f 100644 --- a/applications/mobu/templates/deployment.yaml +++ b/applications/mobu/templates/deployment.yaml @@ -43,6 +43,13 @@ spec: secretKeyRef: name: {{ template "mobu.fullname" . }}-gafaelfawr-token key: "token" + - name: "MOBU_SENTRY_ENVIRONMENT" + value: {{ .Values.global.environmentName }} + - name: "MOBU_SENTRY_DSN" + valueFrom: + secretKeyRef: + name: {{ template "mobu.fullname" . }}-secret + key: "sentry-dsn" {{- if .Values.config.githubRefreshApp }} - name: "MOBU_GITHUB_REFRESH_APP_WEBHOOK_SECRET" valueFrom: diff --git a/applications/mobu/tests/github_ci_app_enabled_test.yaml b/applications/mobu/tests/github_ci_app_enabled_test.yaml index 71d655b111..e2fc066186 100644 --- a/applications/mobu/tests/github_ci_app_enabled_test.yaml +++ b/applications/mobu/tests/github_ci_app_enabled_test.yaml @@ -75,4 +75,6 @@ tests: suffix: "" pathPrefix: /mobu profile: production + sentryEnvironment: null + sentryTracesSampleConfig: 0 slackAlerts: true diff --git a/applications/mobu/tests/github_disabled_test.yaml b/applications/mobu/tests/github_disabled_test.yaml index e93b49a2f4..fc4c7f7fc5 100644 --- a/applications/mobu/tests/github_disabled_test.yaml +++ b/applications/mobu/tests/github_disabled_test.yaml @@ -28,6 +28,8 @@ tests: suffix: "" pathPrefix: /mobu profile: production + sentryEnvironment: null + sentryTracesSampleConfig: 0 slackAlerts: true - it: "Should not inject GitHub CI app secrets into the Deployment env" template: "deployment.yaml" diff --git a/applications/mobu/tests/github_refresh_app_enabled_test.yaml b/applications/mobu/tests/github_refresh_app_enabled_test.yaml index 4ca3ae67a2..7b8887a112 100644 --- a/applications/mobu/tests/github_refresh_app_enabled_test.yaml +++ b/applications/mobu/tests/github_refresh_app_enabled_test.yaml @@ -53,4 +53,6 @@ tests: suffix: "" pathPrefix: /mobu profile: production + sentryEnvironment: null + sentryTracesSampleConfig: 0 slackAlerts: true diff --git a/applications/mobu/values-idfdev.yaml b/applications/mobu/values-idfdev.yaml index 9d89c0a062..dcf3d37117 100644 --- a/applications/mobu/values-idfdev.yaml +++ b/applications/mobu/values-idfdev.yaml @@ -3,6 +3,7 @@ config: profile: development metrics: enabled: true + sentryTracesSampleConfig: errors githubRefreshApp: acceptedGithubOrgs: - lsst-sqre diff --git a/applications/mobu/values-idfint.yaml b/applications/mobu/values-idfint.yaml index ccdc43148b..663e0ea62b 100644 --- a/applications/mobu/values-idfint.yaml +++ b/applications/mobu/values-idfint.yaml @@ -1,6 +1,7 @@ config: metrics: enabled: true + sentryTracesSampleConfig: errors githubRefreshApp: acceptedGithubOrgs: - lsst-sqre diff --git a/applications/mobu/values-idfprod.yaml b/applications/mobu/values-idfprod.yaml index 59901b64df..229ce98ed4 100644 --- a/applications/mobu/values-idfprod.yaml +++ b/applications/mobu/values-idfprod.yaml @@ -1,6 +1,7 @@ config: metrics: enabled: true + sentryTracesSampleConfig: errors githubRefreshApp: acceptedGithubOrgs: - lsst-sqre diff --git a/applications/mobu/values-roundtable-dev.yaml b/applications/mobu/values-roundtable-dev.yaml index ba29bd722d..ab70228af8 100644 --- a/applications/mobu/values-roundtable-dev.yaml +++ b/applications/mobu/values-roundtable-dev.yaml @@ -1,4 +1,5 @@ config: + sentryTracesSampleConfig: errors autostart: - name: "gitlfs" count: 1 diff --git a/applications/mobu/values-roundtable-prod.yaml b/applications/mobu/values-roundtable-prod.yaml index ee13391a05..ee9c4b4775 100644 --- a/applications/mobu/values-roundtable-prod.yaml +++ b/applications/mobu/values-roundtable-prod.yaml @@ -1,4 +1,5 @@ config: + sentryTracesSampleConfig: errors autostart: - name: "gitlfs" count: 1 diff --git a/applications/mobu/values-usdfdev.yaml b/applications/mobu/values-usdfdev.yaml index 873086520e..796cbcfa3a 100644 --- a/applications/mobu/values-usdfdev.yaml +++ b/applications/mobu/values-usdfdev.yaml @@ -1,4 +1,5 @@ config: + sentryTracesSampleConfig: errors githubRefreshApp: acceptedGithubOrgs: - lsst-sqre diff --git a/applications/mobu/values-usdfint.yaml b/applications/mobu/values-usdfint.yaml index cb733ed173..fbac969826 100644 --- a/applications/mobu/values-usdfint.yaml +++ b/applications/mobu/values-usdfint.yaml @@ -1,4 +1,5 @@ config: + sentryTracesSampleConfig: errors githubRefreshApp: acceptedGithubOrgs: - lsst-sqre diff --git a/applications/mobu/values-usdfprod.yaml b/applications/mobu/values-usdfprod.yaml index d8097ed9f6..8a7c348e6c 100644 --- a/applications/mobu/values-usdfprod.yaml +++ b/applications/mobu/values-usdfprod.yaml @@ -1,4 +1,5 @@ config: + sentryTracesSampleConfig: errors autostart: - name: "firefighter" count: 1 diff --git a/applications/mobu/values.yaml b/applications/mobu/values.yaml index d7cf7a645e..598f787f87 100644 --- a/applications/mobu/values.yaml +++ b/applications/mobu/values.yaml @@ -43,6 +43,13 @@ config: # @default -- disabled. githubCiApp: null + # -- The environment to report to Sentry + sentryEnvironment: null + + # -- Sentry tracing config: a float to specify a percentage, or "errors" to + # send all transactions with errors. + sentryTracesSampleConfig: 0.0 + # -- Log level. Set to 'DEBUG' to include the output from all flocks in the # main mobu log. logLevel: INFO diff --git a/environments/templates/applications/infrastructure/mobu.yaml b/environments/templates/applications/infrastructure/mobu.yaml index cdcd785b4e..ab4c5804a4 100644 --- a/environments/templates/applications/infrastructure/mobu.yaml +++ b/environments/templates/applications/infrastructure/mobu.yaml @@ -28,6 +28,8 @@ spec: value: "https://{{ .Values.fqdn }}" - name: "global.vaultSecretsPath" value: {{ .Values.vaultPathPrefix | quote }} + - name: "global.environmentName" + value: {{ .Values.name | quote }} valueFiles: - "values.yaml" - "values-{{ .Values.name }}.yaml"