From 3c6307e93f0785ccdc9ec352f7b3e13a8c911a31 Mon Sep 17 00:00:00 2001 From: Volodymyr Stoiko Date: Tue, 10 Sep 2024 02:40:08 +0300 Subject: [PATCH] Add sentry related configurations (#1606) * Add sentry configuration * get helm values * Add sentry configuration --------- Co-authored-by: tiptophelmet --- config/configStructs/tapConfig.go | 6 ++++++ helm-chart/README.md | 2 ++ helm-chart/templates/04-hub-deployment.yaml | 4 ++++ helm-chart/templates/06-front-deployment.yaml | 4 ++++ helm-chart/templates/09-worker-daemon-set.yaml | 4 ++++ helm-chart/values.yaml | 3 +++ 6 files changed, 23 insertions(+) diff --git a/config/configStructs/tapConfig.go b/config/configStructs/tapConfig.go index a94412d20..0b6b1704c 100644 --- a/config/configStructs/tapConfig.go +++ b/config/configStructs/tapConfig.go @@ -144,6 +144,11 @@ type TelemetryConfig struct { Enabled bool `yaml:"enabled" json:"enabled" default:"true"` } +type SentryConfig struct { + Enabled bool `yaml:"enabled" json:"enabled" default:"false"` + Environment string `yaml:"environment" json:"environment" default:"production"` +} + type CapabilitiesConfig struct { NetworkCapture []string `yaml:"networkCapture" json:"networkCapture" default:"[]"` ServiceMeshCapture []string `yaml:"serviceMeshCapture" json:"serviceMeshCapture" default:"[]"` @@ -209,6 +214,7 @@ type TapConfig struct { Debug bool `yaml:"debug" json:"debug" default:"false"` KernelModule KernelModuleConfig `yaml:"kernelModule" json:"kernelModule"` Telemetry TelemetryConfig `yaml:"telemetry" json:"telemetry"` + Sentry SentryConfig `yaml:"sentry" json:"sentry"` DefaultFilter string `yaml:"defaultFilter" json:"defaultFilter" default:"!dns and !tcp"` ScriptingDisabled bool `yaml:"scriptingDisabled" json:"scriptingDisabled" default:"false"` TargetedPodsUpdateDisabled bool `yaml:"targetedPodsUpdateDisabled" json:"targetedPodsUpdateDisabled" default:"false"` diff --git a/helm-chart/README.md b/helm-chart/README.md index 90d283f5c..58d16f55a 100644 --- a/helm-chart/README.md +++ b/helm-chart/README.md @@ -172,6 +172,8 @@ Please refer to [metrics](./metrics.md) documentation for details. | `tap.kernelModule.image` | Container image containing PF_RING kernel module with supported kernel version([details](PF_RING.md)) | "kubeshark/pf-ring-module:all" | | `tap.kernelModule.unloadOnDestroy` | Create additional container which watches for pod termination and unloads PF_RING kernel module. | `false`| | `tap.telemetry.enabled` | Enable anonymous usage statistics collection | `true` | +| `tap.sentry.enabled` | Enable sending of error logs to Sentry | `false` | +| `tap.sentry.environment` | Sentry environment to label error logs with | `production` | | `tap.defaultFilter` | Sets the default dashboard KFL filter (e.g. `http`). By default, this value is set to filter out DNS and TCP entries. The user can easily change this in the Dashboard. | `"!dns and !tcp"` | | `tap.globalFilter` | Prepends to any KFL filter and can be used to limit what is visible in the dashboard. For example, `redact("request.headers.Authorization")` will redact the appropriate field. Another example `!dns` will not show any DNS traffic. | `""` | | `tap.metrics.port` | Pod port used to expose Prometheus metrics | `49100` | diff --git a/helm-chart/templates/04-hub-deployment.yaml b/helm-chart/templates/04-hub-deployment.yaml index 33a761474..dbf2d1571 100644 --- a/helm-chart/templates/04-hub-deployment.yaml +++ b/helm-chart/templates/04-hub-deployment.yaml @@ -43,6 +43,10 @@ spec: valueFrom: fieldRef: fieldPath: metadata.namespace + - name: SENTRY_ENABLED + value: '{{ .Values.tap.sentry.enabled }}' + - name: SENTRY_ENVIRONMENT + value: '{{ .Values.tap.sentry.environment }}' - name: KUBESHARK_CLOUD_API_URL value: 'https://api.kubeshark.co' - name: PROFILING_ENABLED diff --git a/helm-chart/templates/06-front-deployment.yaml b/helm-chart/templates/06-front-deployment.yaml index 31f3e9472..347cda694 100644 --- a/helm-chart/templates/06-front-deployment.yaml +++ b/helm-chart/templates/06-front-deployment.yaml @@ -62,6 +62,10 @@ spec: value: '{{ and .Values.supportChatEnabled .Values.internetConnectivity | ternary "true" "false" }}' - name: REACT_APP_DISSECTORS_UPDATING_ENABLED value: '{{ .Values.dissectorsUpdatingEnabled | ternary "true" "false" }}' + - name: REACT_APP_SENTRY_ENABLED + value: '{{ .Values.tap.sentry.enabled }}' + - name: REACT_APP_SENTRY_ENVIRONMENT + value: '{{ .Values.tap.sentry.environment }}' {{- if .Values.tap.docker.overrideTag.front }} image: '{{ .Values.tap.docker.registry }}/front:{{ .Values.tap.docker.overrideTag.front }}' {{ else }} diff --git a/helm-chart/templates/09-worker-daemon-set.yaml b/helm-chart/templates/09-worker-daemon-set.yaml index 22b6526a1..99117b7fa 100644 --- a/helm-chart/templates/09-worker-daemon-set.yaml +++ b/helm-chart/templates/09-worker-daemon-set.yaml @@ -191,6 +191,10 @@ spec: fieldPath: metadata.namespace - name: PROFILING_ENABLED value: '{{ .Values.tap.pprof.enabled }}' + - name: SENTRY_ENABLED + value: '{{ .Values.tap.sentry.enabled }}' + - name: SENTRY_ENVIRONMENT + value: '{{ .Values.tap.sentry.environment }}' resources: limits: cpu: {{ .Values.tap.resources.tracer.limits.cpu }} diff --git a/helm-chart/values.yaml b/helm-chart/values.yaml index 2f79e3cb0..34e605ae6 100644 --- a/helm-chart/values.yaml +++ b/helm-chart/values.yaml @@ -97,6 +97,9 @@ tap: unloadOnDestroy: false telemetry: enabled: true + sentry: + enabled: false + environment: production defaultFilter: "!dns and !tcp" scriptingDisabled: false targetedPodsUpdateDisabled: false