Skip to content

Commit

Permalink
fix: Add missing ingest for feedback events (#1630)
Browse files Browse the repository at this point in the history
  • Loading branch information
phillipcaofph authored Dec 11, 2024
1 parent a9b6b61 commit 3882cae
Show file tree
Hide file tree
Showing 4 changed files with 243 additions and 0 deletions.
18 changes: 18 additions & 0 deletions charts/sentry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,24 @@ Note: this table is incomplete, so have a look at the values.yaml in case you mi
| sentry.ingestConsumerTransactions.sidecars | list | `[]` | |
| sentry.ingestConsumerTransactions.topologySpreadConstraints | list | `[]` | |
| sentry.ingestConsumerTransactions.volumes | list | `[]` | |
| sentry.ingestFeedback.affinity | object | `{}` | |
| sentry.ingestFeedback.autoscaling.enabled | bool | `false` | |
| sentry.ingestFeedback.autoscaling.maxReplicas | int | `3` | |
| sentry.ingestFeedback.autoscaling.minReplicas | int | `1` | |
| sentry.ingestFeedback.autoscaling.targetCPUUtilizationPercentage | int | `50` | |
| sentry.ingestFeedback.containerSecurityContext | object | `{}` | |
| sentry.ingestFeedback.enabled | bool | `true` | |
| sentry.ingestFeedback.env | list | `[]` | |
| sentry.ingestFeedback.livenessProbe.enabled | bool | `true` | |
| sentry.ingestFeedback.livenessProbe.initialDelaySeconds | int | `5` | |
| sentry.ingestFeedback.livenessProbe.periodSeconds | int | `320` | |
| sentry.ingestFeedback.nodeSelector | object | `{}` | |
| sentry.ingestFeedback.replicas | int | `1` | |
| sentry.ingestFeedback.resources | object | `{}` | |
| sentry.ingestFeedback.securityContext | object | `{}` | |
| sentry.ingestFeedback.sidecars | list | `[]` | |
| sentry.ingestFeedback.topologySpreadConstraints | list | `[]` | |
| sentry.ingestFeedback.volumes | list | `[]` | |
| sentry.ingestMonitors.affinity | object | `{}` | |
| sentry.ingestMonitors.autoscaling.enabled | bool | `false` | |
| sentry.ingestMonitors.autoscaling.maxReplicas | int | `3` | |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
{{- if .Values.sentry.ingestFeedback.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "sentry.fullname" . }}-ingest-feedback
labels:
app: {{ template "sentry.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
app.kubernetes.io/managed-by: "Helm"
{{- if .Values.asHook }}
{{- /* Add the Helm annotations so that deployment after asHook from true to false works */}}
annotations:
meta.helm.sh/release-name: "{{ .Release.Name }}"
meta.helm.sh/release-namespace: "{{ .Release.Namespace }}"
"helm.sh/hook": "post-install,post-upgrade"
"helm.sh/hook-weight": "10"
{{- end }}
spec:
revisionHistoryLimit: {{ .Values.revisionHistoryLimit }}
selector:
matchLabels:
app: {{ template "sentry.fullname" . }}
release: "{{ .Release.Name }}"
role: ingest-feedback
{{- if not .Values.sentry.ingestFeedback.autoscaling.enabled }}
replicas: {{ .Values.sentry.ingestFeedback.replicas }}
{{- end }}
template:
metadata:
annotations:
checksum/configYml: {{ .Values.config.configYml | toYaml | toString | sha256sum }}
checksum/sentryConfPy: {{ .Values.config.sentryConfPy | sha256sum }}
checksum/config.yaml: {{ include "sentry.config" . | sha256sum }}
{{- if .Values.sentry.ingestFeedback.annotations }}
{{ toYaml .Values.sentry.ingestFeedback.annotations | indent 8 }}
{{- end }}
labels:
app: {{ template "sentry.fullname" . }}
release: "{{ .Release.Name }}"
role: ingest-feedback
{{- if .Values.sentry.ingestFeedback.podLabels }}
{{ toYaml .Values.sentry.ingestFeedback.podLabels | indent 8 }}
{{- end }}
spec:
affinity:
{{- if .Values.sentry.ingestFeedback.affinity }}
{{ toYaml .Values.sentry.ingestFeedback.affinity | indent 8 }}
{{- end }}
{{- if .Values.sentry.ingestFeedback.nodeSelector }}
nodeSelector:
{{ toYaml .Values.sentry.ingestFeedback.nodeSelector | indent 8 }}
{{- else if .Values.global.nodeSelector }}
nodeSelector:
{{ toYaml .Values.global.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.sentry.ingestFeedback.tolerations }}
tolerations:
{{ toYaml .Values.sentry.ingestFeedback.tolerations | indent 8 }}
{{- else if .Values.global.tolerations }}
tolerations:
{{ toYaml .Values.global.tolerations | indent 8 }}
{{- end }}
{{- if .Values.sentry.ingestFeedback.topologySpreadConstraints }}
topologySpreadConstraints:
{{ toYaml .Values.sentry.ingestFeedback.topologySpreadConstraints | indent 8 }}
{{- end }}
{{- if .Values.images.sentry.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.images.sentry.imagePullSecrets | indent 8 }}
{{- end }}
{{- if .Values.dnsPolicy }}
dnsPolicy: {{ .Values.dnsPolicy | quote }}
{{- end }}
{{- if .Values.dnsConfig }}
dnsConfig:
{{ toYaml .Values.dnsConfig | indent 8 }}
{{- end }}
{{- if .Values.sentry.ingestFeedback.securityContext }}
securityContext:
{{ toYaml .Values.sentry.ingestFeedback.securityContext | indent 8 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}-ingest-feedback
image: "{{ template "sentry.image" . }}"
imagePullPolicy: {{ default "IfNotPresent" .Values.images.sentry.pullPolicy }}
command: ["sentry"]
args:
- "run"
- "consumer"
- "ingest-feedback-events"
- "--consumer-group"
- "ingest-feedback"
{{- if .Values.sentry.ingestFeedback.autoOffsetReset }}
- "--auto-offset-reset"
- "{{ .Values.sentry.ingestFeedback.autoOffsetReset }}"
{{- end }}
{{- if .Values.sentry.ingestFeedback.noStrictOffsetReset }}
- "--no-strict-offset-reset"
{{- end }}
{{- if .Values.sentry.ingestFeedback.livenessProbe.enabled }}
- "--healthcheck-file-path"
- "/tmp/health.txt"
{{- end }}
{{- if .Values.sentry.ingestFeedback.livenessProbe.enabled }}
livenessProbe:
exec:
command:
- rm
- /tmp/health.txt
initialDelaySeconds: {{ .Values.sentry.ingestFeedback.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.sentry.ingestFeedback.livenessProbe.periodSeconds }}
{{- end }}
env:
- name: C_FORCE_ROOT
value: "true"
{{ include "sentry.env" . | indent 8 }}
{{- if .Values.sentry.ingestFeedback.env }}
{{ toYaml .Values.sentry.ingestFeedback.env | indent 8 }}
{{- end }}
volumeMounts:
- mountPath: /etc/sentry
name: config
readOnly: true
- mountPath: {{ .Values.filestore.filesystem.path }}
name: sentry-data
{{- if and (eq .Values.filestore.backend "gcs") .Values.filestore.gcs.secretName }}
- name: sentry-google-cloud-key
mountPath: /var/run/secrets/google
{{ end }}
{{- if .Values.sentry.ingestFeedback.volumeMounts }}
{{ toYaml .Values.sentry.ingestFeedback.volumeMounts | indent 8 }}
{{- end }}
resources:
{{ toYaml .Values.sentry.ingestFeedback.resources | indent 12 }}
{{- if .Values.sentry.ingestFeedback.containerSecurityContext }}
securityContext:
{{ toYaml .Values.sentry.ingestFeedback.containerSecurityContext | indent 12 }}
{{- end }}
{{- if .Values.sentry.ingestFeedback.sidecars }}
{{ toYaml .Values.sentry.ingestFeedback.sidecars | indent 6 }}
{{- end }}
{{- if .Values.global.sidecars }}
{{ toYaml .Values.global.sidecars | indent 6 }}
{{- end }}
{{- if .Values.serviceAccount.enabled }}
serviceAccountName: {{ .Values.serviceAccount.name }}-ingest-feedback
{{- end }}
volumes:
- name: config
configMap:
name: {{ template "sentry.fullname" . }}-sentry
- name: sentry-data
{{- if and (eq .Values.filestore.backend "filesystem") .Values.filestore.filesystem.persistence.enabled (.Values.filestore.filesystem.persistence.persistentWorkers) }}
{{- if .Values.filestore.filesystem.persistence.existingClaim }}
persistentVolumeClaim:
claimName: {{ .Values.filestore.filesystem.persistence.existingClaim }}
{{- else }}
persistentVolumeClaim:
claimName: {{ template "sentry.fullname" . }}-data
{{- end }}
{{- else }}
emptyDir: {}
{{ end }}
{{- if and (eq .Values.filestore.backend "gcs") .Values.filestore.gcs.secretName }}
- name: sentry-google-cloud-key
secret:
secretName: {{ .Values.filestore.gcs.secretName }}
{{ end }}
{{- if .Values.sentry.ingestFeedback.volumes }}
{{ toYaml .Values.sentry.ingestFeedback.volumes | indent 6 }}
{{- end }}
{{- if .Values.global.volumes }}
{{ toYaml .Values.global.volumes | indent 6 }}
{{- end }}
{{- if .Values.sentry.ingestFeedback.priorityClassName }}
priorityClassName: "{{ .Values.sentry.ingestFeedback.priorityClassName }}"
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{{- if and .Values.serviceAccount.enabled .Values.sentry.ingestMonitors.enabled }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .Values.serviceAccount.name }}-ingest-feedback
{{- if .Values.serviceAccount.annotations }}
annotations: {{ toYaml .Values.serviceAccount.annotations | nindent 4 }}
{{- end }}
automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }}
{{- end }}
35 changes: 35 additions & 0 deletions charts/sentry/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,40 @@ sentry:
# autoOffsetReset: "earliest"
# noStrictOffsetReset: false

ingestFeedback:
enabled: false
replicas: 1
env: []
resources: {}
# requests:
# cpu: 100m
# memory: 250Mi
affinity: {}
nodeSelector: {}
securityContext: {}
containerSecurityContext: {}
# tolerations: []
# podLabels: {}
# it's better to use prometheus adapter and scale based on
# the size of the rabbitmq queue
autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 3
targetCPUUtilizationPercentage: 50
sidecars: []
topologySpreadConstraints: []
volumes: []
livenessProbe:
enabled: true
initialDelaySeconds: 5
periodSeconds: 320
# volumeMounts:
# - mountPath: /dev/shm
# name: dshm
# autoOffsetReset: "earliest"
# noStrictOffsetReset: false

ingestMonitors:
enabled: true
replicas: 1
Expand Down Expand Up @@ -2134,6 +2168,7 @@ kafka:
- name: ingest-replay-recordings
- name: ingest-metrics
- name: ingest-performance-metrics
- name: ingest-feedback-events
- name: ingest-monitors
- name: profiles
- name: ingest-occurrences
Expand Down

0 comments on commit 3882cae

Please sign in to comment.