Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow users to specify Kafka topic name prefix in values.yaml #1544

Merged
merged 16 commits into from
Oct 25, 2024

Conversation

nadecancode
Copy link
Contributor

Instructed per #1359 (comment), this PR adds a new section called kafkaTopicOverrides.prefix for users to specify their own kafka topic name prefix. This can avoid Sentry using an overly generic kafka topic name and allows for more rooms of customizations.

@patsevanton
Copy link
Contributor

Hi! How to check? Could you write example values.yaml.

@nadecancode
Copy link
Contributor Author

Hi! How to check? Could you write example values.yaml.

Hello, an example would just be the prefix you want. i.e. "sentry.dev."

@patsevanton
Copy link
Contributor

patsevanton commented Oct 15, 2024

I test with:

kafkaTopicOverrides:
  prefix: "sentry.dev."

and get error pod

k get pod -n test | grep -v Running
NAME                                                              READY   STATUS             RESTARTS      AGE
sentry-generic-metrics-consumer-75c9cfbbd-5p9mb                   0/1     CrashLoopBackOff   2 (25s ago)   75s
sentry-ingest-consumer-attachments-5f5f68b4b6-hbkff               0/1     Error              3 (36s ago)   74s
sentry-ingest-occurrences-7d6d55f4d-z2wnc                         0/1     Error              3 (34s ago)   71s
sentry-ingest-replay-recordings-dfdd7444-9gqkm                    0/1     CrashLoopBackOff   2 (28s ago)   70s
sentry-post-process-forward-errors-7d64865947-qwwgc               0/1     CrashLoopBackOff   2 (27s ago)   68s
sentry-post-process-forward-issue-platform-5b5c7ff798-s9dkk       0/1     CrashLoopBackOff   2 (25s ago)   68s
sentry-post-process-forward-transactions-fb7d496b-6rstd           0/1     CrashLoopBackOff   2 (21s ago)   67s
sentry-snuba-outcomes-billing-consumer-66c66c797-c2h6c            0/1     Error              3 (32s ago)   59s

logs:

│ arroyo.errors.ConsumerError: KafkaError{code=UNKNOWN_TOPIC_OR_PART,val=3,str="Subscribed topic not available: sentry.dev.ingest-performance-metrics: Broke │
│ r: Unknown topic or partition"}                                                                                                                            │
│ Stream closed EOF for test/sentry-generic-metrics-consumer-75c9cfbbd-5p9mb (sentry-generic-metrics-consumer) 

and

│ arroyo.errors.ConsumerError: KafkaError{code=UNKNOWN_TOPIC_OR_PART,val=3,str="Subscribed topic not available: sentry.dev.ingest-attachments: Broker: Unkno │
│ wn topic or partition"}                                                                                                                                    │
│ Stream closed EOF for test/sentry-ingest-consumer-attachments-5f5f68b4b6-hbkff (sentry-ingest-consumer-attachments)

and other pod get same error

@nadecancode
Copy link
Contributor Author

I test with:

kafkaTopicOverrides:
  prefix: "sentry.dev."

and get error pod

k get pod -n test | grep -v Running
NAME                                                              READY   STATUS             RESTARTS      AGE
sentry-generic-metrics-consumer-75c9cfbbd-5p9mb                   0/1     CrashLoopBackOff   2 (25s ago)   75s
sentry-ingest-consumer-attachments-5f5f68b4b6-hbkff               0/1     Error              3 (36s ago)   74s
sentry-ingest-occurrences-7d6d55f4d-z2wnc                         0/1     Error              3 (34s ago)   71s
sentry-ingest-replay-recordings-dfdd7444-9gqkm                    0/1     CrashLoopBackOff   2 (28s ago)   70s
sentry-post-process-forward-errors-7d64865947-qwwgc               0/1     CrashLoopBackOff   2 (27s ago)   68s
sentry-post-process-forward-issue-platform-5b5c7ff798-s9dkk       0/1     CrashLoopBackOff   2 (25s ago)   68s
sentry-post-process-forward-transactions-fb7d496b-6rstd           0/1     CrashLoopBackOff   2 (21s ago)   67s
sentry-snuba-outcomes-billing-consumer-66c66c797-c2h6c            0/1     Error              3 (32s ago)   59s

logs:

│ arroyo.errors.ConsumerError: KafkaError{code=UNKNOWN_TOPIC_OR_PART,val=3,str="Subscribed topic not available: sentry.dev.ingest-performance-metrics: Broke │
│ r: Unknown topic or partition"}                                                                                                                            │
│ Stream closed EOF for test/sentry-generic-metrics-consumer-75c9cfbbd-5p9mb (sentry-generic-metrics-consumer) 

and

│ arroyo.errors.ConsumerError: KafkaError{code=UNKNOWN_TOPIC_OR_PART,val=3,str="Subscribed topic not available: sentry.dev.ingest-attachments: Broker: Unkno │
│ wn topic or partition"}                                                                                                                                    │
│ Stream closed EOF for test/sentry-ingest-consumer-attachments-5f5f68b4b6-hbkff (sentry-ingest-consumer-attachments)

and other pod get same error

I think I commented above the section but you need to adjust the Kafka subchart’s provision topic names with prefixed ones as well.

@patsevanton
Copy link
Contributor

Could you write example values.yaml?

@nadecancode
Copy link
Contributor Author

Could you write example values.yaml?

https://github.com/sentry-kubernetes/charts/actions/runs/11339298915/job/31533866902?pr=1544

Hello, I updated the example yaml and ran the E2E. I'll revert the commit now

This reverts commit 6db7087.
@patsevanton
Copy link
Contributor

git clone you repo

git clone https://github.com/nadecancode/sentry-charts.git

install

helm install -n test --wait sentry . --values values.yaml --timeout=1000s

get error

k get pod -n test | grep -v Running
NAME                                                              READY   STATUS             RESTARTS      AGE
sentry-post-process-forward-issue-platform-677d8fc4dd-pd58r       0/1     CrashLoopBackOff   4 (74s ago)   3m32s
sentry-post-process-forward-transactions-58bf8cbfd4-4nxpc         0/1     CrashLoopBackOff   4 (78s ago)   3m31s
sentry-snuba-outcomes-billing-consumer-7f757746c6-dktgh           0/1     CrashLoopBackOff   5 (16s ago)   3m22s

@nadecancode
Copy link
Contributor Author

git clone you repo

git clone https://github.com/nadecancode/sentry-charts.git

install

helm install -n test --wait sentry . --values values.yaml --timeout=1000s

get error

k get pod -n test | grep -v Running
NAME                                                              READY   STATUS             RESTARTS      AGE
sentry-post-process-forward-issue-platform-677d8fc4dd-pd58r       0/1     CrashLoopBackOff   4 (74s ago)   3m32s
sentry-post-process-forward-transactions-58bf8cbfd4-4nxpc         0/1     CrashLoopBackOff   4 (78s ago)   3m31s
sentry-snuba-outcomes-billing-consumer-7f757746c6-dktgh           0/1     CrashLoopBackOff   5 (16s ago)   3m22s

What's the error message? They are working in mine..

@nadecancode
Copy link
Contributor Author

@patsevanton I did a dry-run and inspected the deployment manifest, seemed to be an issue with template and I corrected it.

@patsevanton
Copy link
Contributor

patsevanton commented Oct 15, 2024

works, but may be comments code?

kafkaTopicOverrides:
  prefix: ""

@nadecancode
Copy link
Contributor Author

works, but may be comments code?

kafkaTopicOverrides:
  prefix: ""

Done!

@patsevanton
Copy link
Contributor

patsevanton commented Oct 15, 2024

k get pod -n test | grep -v Running
NAME                                                              READY   STATUS             RESTARTS      AGE
sentry-billing-metrics-consumer-5f4f9f9dd4-x46r4                  0/1     CrashLoopBackOff   2 (26s ago)   66s
sentry-generic-metrics-consumer-67bbd4565b-2kpsr                  0/1     CrashLoopBackOff   2 (23s ago)   65s
sentry-ingest-consumer-events-686dd9c69-jcgxc                     0/1     CrashLoopBackOff   2 (24s ago)   63s
sentry-ingest-consumer-transactions-74986f4585-n57k5              0/1     CrashLoopBackOff   2 (23s ago)   62s
sentry-ingest-occurrences-758b75bc6d-gz7rb                        0/1     CrashLoopBackOff   2 (15s ago)   60s
sentry-ingest-replay-recordings-bc48bbd7b-pcbk7                   0/1     CrashLoopBackOff   2 (23s ago)   59s
sentry-metrics-consumer-66587b644-67xkk                           0/1     CrashLoopBackOff   2 (18s ago)   58s
sentry-post-process-forward-errors-db678f6d9-rbxbs                0/1     Error              2 (33s ago)   57s
sentry-post-process-forward-issue-platform-74dcfc945b-7mxxv       0/1     Error              2 (29s ago)   57s
sentry-post-process-forward-transactions-c57789768-dqbcn          0/1     Error              2 (32s ago)   56s
sentry-subscription-consumer-events-f7577694d-tdncp               0/1     CrashLoopBackOff   2 (15s ago)   54s
sentry-subscription-consumer-generic-metrics-ff64d5995-whq8n      0/1     CrashLoopBackOff   2 (17s ago)   52s
sentry-subscription-consumer-metrics-66bdbb59f5-xl27h             0/1     CrashLoopBackOff   2 (15s ago)   51s
sentry-subscription-consumer-transactions-6fdd4878d-kkq6m         0/1     Error              2 (32s ago)   50s

arroyo.errors.ConsumerError: KafkaError{code=UNKNOWN_TOPIC_OR_PART,val=3,str="Subscribed topic not available: snuba-generic-metrics: Broker: Unknown topic  or partition"}

and

arroyo.errors.ConsumerError: KafkaError{code=UNKNOWN_TOPIC_OR_PART,val=3,str="Subscribed topic not available: ingest-performance-metrics: Broker: Unknown topic or partition"

my config:
https://gist.github.com/patsevanton/efe60dc61af7cdfb1fc286750e076f7d

@nadecancode
Copy link
Contributor Author

k get pod -n test | grep -v Running
NAME                                                              READY   STATUS             RESTARTS      AGE
sentry-billing-metrics-consumer-5f4f9f9dd4-x46r4                  0/1     CrashLoopBackOff   2 (26s ago)   66s
sentry-generic-metrics-consumer-67bbd4565b-2kpsr                  0/1     CrashLoopBackOff   2 (23s ago)   65s
sentry-ingest-consumer-events-686dd9c69-jcgxc                     0/1     CrashLoopBackOff   2 (24s ago)   63s
sentry-ingest-consumer-transactions-74986f4585-n57k5              0/1     CrashLoopBackOff   2 (23s ago)   62s
sentry-ingest-occurrences-758b75bc6d-gz7rb                        0/1     CrashLoopBackOff   2 (15s ago)   60s
sentry-ingest-replay-recordings-bc48bbd7b-pcbk7                   0/1     CrashLoopBackOff   2 (23s ago)   59s
sentry-metrics-consumer-66587b644-67xkk                           0/1     CrashLoopBackOff   2 (18s ago)   58s
sentry-post-process-forward-errors-db678f6d9-rbxbs                0/1     Error              2 (33s ago)   57s
sentry-post-process-forward-issue-platform-74dcfc945b-7mxxv       0/1     Error              2 (29s ago)   57s
sentry-post-process-forward-transactions-c57789768-dqbcn          0/1     Error              2 (32s ago)   56s
sentry-subscription-consumer-events-f7577694d-tdncp               0/1     CrashLoopBackOff   2 (15s ago)   54s
sentry-subscription-consumer-generic-metrics-ff64d5995-whq8n      0/1     CrashLoopBackOff   2 (17s ago)   52s
sentry-subscription-consumer-metrics-66bdbb59f5-xl27h             0/1     CrashLoopBackOff   2 (15s ago)   51s
sentry-subscription-consumer-transactions-6fdd4878d-kkq6m         0/1     Error              2 (32s ago)   50s
arroyo.errors.ConsumerError: KafkaError{code=UNKNOWN_TOPIC_OR_PART,val=3,str="Subscribed topic not available: snuba-generic-metrics: Broker: Unknown topic  or partition"}

and

arroyo.errors.ConsumerError: KafkaError{code=UNKNOWN_TOPIC_OR_PART,val=3,str="Subscribed topic not available: ingest-performance-metrics: Broker: Unknown topic or partition"

my config: https://gist.github.com/patsevanton/efe60dc61af7cdfb1fc286750e076f7d

Updated again.. https://paste.gg/p/anonymous/4e7302ba7f2946cd8fdf6969f77fde0f is generated dry-run manifest I observed. It looks like prefixes are getting updated properly now.

@patsevanton
Copy link
Contributor

Do you test the code before you submit it?

@nadecancode
Copy link
Contributor Author

Do you test the code before you submit it?

$ k get pods -n sentry
NAME                                                              READY   STATUS             RESTARTS      AGE
sentry-billing-metrics-consumer-7fd45cbbf7-5z29n                  1/1     Running            0             2m11s
sentry-clickhouse-0                                               1/1     Running            0             13m
sentry-cron-8ff9b9c86-4qsrm                                       1/1     Running            1 (12m ago)   13m
sentry-generic-metrics-consumer-58997c6785-695rw                  1/1     Running            0             2m11s
sentry-ingest-consumer-attachments-d578c8987-dp88s                1/1     Running            0             2m11s
sentry-ingest-consumer-events-7947db7b68-6b2z8                    1/1     Running            0             2m10s
sentry-ingest-consumer-transactions-7786df9c56-xbzzr              1/1     Running            0             2m10s
sentry-ingest-monitors-5fd95fcdf5-r8kng                           1/1     Running            0             2m10s
sentry-ingest-occurrences-54ff8f5667-95nnc                        1/1     Running            0             2m9s
sentry-ingest-replay-recordings-6899ff9ddc-7rv4z                  1/1     Running            0             2m9s
sentry-issue-occurrence-consumer-89d4cbd49-rxc8c                  1/1     Running            0             117s
sentry-kafka-controller-0                                         1/1     Running            0             13m
sentry-kafka-controller-1                                         1/1     Running            0             13m
sentry-kafka-controller-2                                         1/1     Running            0             13m
sentry-metrics-consumer-785b844657-bhb2b                          1/1     Running            0             2m9s
sentry-nginx-567ff7b8-kbcl5                                       1/1     Running            0             13m
sentry-post-process-forward-errors-7d7689798d-vr7tl               1/1     Running            0             2m8s
sentry-post-process-forward-issue-platform-64b9b57cdf-5q2rm       1/1     Running            0             2m8s
sentry-post-process-forward-transactions-66ccccc8dc-6c4v4         1/1     Running            0             2m7s
sentry-rabbitmq-0                                                 1/1     Running            0             13m
sentry-relay-6df74d779-76rc9                                      1/1     Running            0             114s
sentry-sentry-postgresql-0                                        1/1     Running            0             13m
sentry-sentry-redis-master-0                                      1/1     Running            0             13m
sentry-sentry-redis-replicas-0                                    1/1     Running            0             13m
sentry-snuba-api-567c59845b-vrfgq                                 1/1     Running            0             13m
sentry-snuba-consumer-556b5544cf-k7n5w                            1/1     Running            0             2m7s
sentry-snuba-generic-metrics-counters-consumer-678567c8c9-rmcbd   1/1     Running            0             2m3s
sentry-snuba-generic-metrics-distributions-consumer-59d854lg7gv   1/1     Running            0             2m2s
sentry-snuba-generic-metrics-sets-consumer-8659db854c-xkbsb       1/1     Running            0             2m2s
sentry-snuba-group-attributes-consumer-54f5b7797-jj2td            1/1     Running            0             2m1s
sentry-snuba-metrics-consumer-fc66449c4-99khw                     1/1     Running            0             2m
sentry-snuba-outcomes-billing-consumer-5f68d45cdf-wn6zd           0/1     CrashLoopBackOff   3 (35s ago)   2m
sentry-snuba-outcomes-consumer-6f857c795d-5jn4w                   1/1     Running            0             117s
sentry-snuba-replacer-57fd86969d-vtmhb                            1/1     Running            0             116s
sentry-snuba-replays-consumer-794db87894-8qgxs                    1/1     Running            0             119s
sentry-snuba-spans-consumer-564649bf89-q6fmc                      1/1     Running            0             119s
sentry-snuba-subscription-consumer-events-799b96f5d9-78s6b        1/1     Running            0             115s
sentry-snuba-subscription-consumer-metrics-55994847f4-pqsfn       1/1     Running            0             115s
sentry-snuba-subscription-consumer-transactions-77f45ff965wmmkg   1/1     Running            0             114s
sentry-snuba-transactions-consumer-57458c7467-9xbvn               1/1     Running            0             118s
sentry-subscription-consumer-events-78cc6f7f85-6zj8g              1/1     Running            0             2m6s
sentry-subscription-consumer-generic-metrics-8564b8df66-nc76m     1/1     Running            0             2m5s
sentry-subscription-consumer-metrics-744d485fdb-nk9qp             1/1     Running            0             2m4s
sentry-subscription-consumer-transactions-7f8f46759c-rjhrf        1/1     Running            0             2m4s
sentry-web-6796fffdb8-mjbb5                                       1/1     Running            1 (12m ago)   13m
sentry-worker-d99cd4967-r8f28                                     1/1     Running            1 (12m ago)   13m
sentry-zookeeper-clickhouse-0                                     1/1     Running            0             13m

Fixed one more issue related to argument name then it should be good to go

@patsevanton
Copy link
Contributor

patsevanton commented Oct 17, 2024

I install sentry by command

helm install -n test --wait sentry . --values values.yaml --timeout=1000s

All pods are in the Running state

@Mokto @adonskoy @MemberIT @2005wind @iamyogeshg @paulDashkevich could you help to review?

spans: "{{ default "" .Values.kafkaTopicOverrides.prefix }}snuba-spans"
metrics_summaries: "{{ default "" .Values.kafkaTopicOverrides.prefix }}snuba-metrics-summaries"
cogs: "{{ default "" .Values.kafkaTopicOverrides.prefix }}shared-resources-usage"
feedback: "{{ default "" .Values.kafkaTopicOverrides.prefix }}ingest-feedback-events"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you tell me, what is this topic ingest-feedback-events? I don't see the provisioning of this topic here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#1359 (comment) has ingest-feedback-events, if it's not needed then it could be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MemberIT
Copy link
Contributor

@nadecancode, am I correct in understanding that prefixes are added only to the following topics:
test-for-commit- - is prefix for test

      topics:
        metrics_sessions: "test-for-commit-ingest-metrics"
        events: "test-for-commit-ingest-attachments"
        transactions: "test-for-commit-ingest-transactions"
        outcomes: "test-for-commit-ingest-outcomes"
        outcomes_billing: "test-for-commit-ingest-outcomes"
        metrics_generic: "test-for-commit-ingest-performance-metrics"
        profiles: "test-for-commit-profiles"
        replay_events: "test-for-commit-ingest-replay-events"
        replay_recordings: "test-for-commit-ingest-replay-recordings"
        monitors: "test-for-commit-ingest-monitors"
        spans: "test-for-commit-snuba-spans"
        metrics_summaries: "test-for-commit-snuba-metrics-summaries"
        cogs: "test-for-commit-shared-resources-usage"
        feedback: "test-for-commit-ingest-feedback-events"

and not to all the ones that are created in Kafka here?

If that's the case, then we should add a comment for the corresponding topics, something like this:

@@ -2058,7 +2058,7 @@ kafka:
         config:
           "message.timestamp.type": LogAppendTime
       - name: profiles-call-tree
-      - name: ingest-replay-events
+      - name: ingest-replay-events  # Set here same topic prefix if set .Values.kafkaTopicOverrides.prefix
         config:
           "message.timestamp.type": LogAppendTime
           "max.message.bytes": "15000000"
@@ -2095,20 +2095,20 @@ kafka:
       - name: snuba-dead-letter-generic-events
       - name: snuba-dead-letter-querylog
       - name: snuba-dead-letter-group-attributes
-      - name: ingest-attachments
-      - name: ingest-transactions
+      - name: ingest-attachments  # Set here same topic prefix if set .Values.kafkaTopicOverrides.prefix
+      - name: ingest-transactions  # Set here same topic prefix if set .Values.kafkaTopicOverrides.prefix
       - name: ingest-events
         ## If the number of exceptions increases, it is recommended to increase the number of partitions for ingest-events
         # partitions: 1
-      - name: ingest-replay-recordings
-      - name: ingest-metrics
-      - name: ingest-performance-metrics
-      - name: ingest-monitors
-      - name: profiles
+      - name: ingest-replay-recordings  # Set here same topic prefix if set .Values.kafkaTopicOverrides.prefix
+      - name: ingest-metrics  # Set here same topic prefix if set .Values.kafkaTopicOverrides.prefix
+      - name: ingest-performance-metrics  # Set here same topic prefix if set .Values.kafkaTopicOverrides.prefix
+      - name: ingest-monitors  # Set here same topic prefix if set .Values.kafkaTopicOverrides.prefix
+      - name: profiles  # Set here same topic prefix if set .Values.kafkaTopicOverrides.prefix
       - name: ingest-occurrences
-      - name: snuba-spans
-      - name: shared-resources-usage
-      - name: snuba-metrics-summaries
+      - name: snuba-spans  # Set here same topic prefix if set .Values.kafkaTopicOverrides.prefix
+      - name: shared-resources-usage  # Set here same topic prefix if set .Values.kafkaTopicOverrides.prefix
+      - name: snuba-metrics-summaries  # Set here same topic prefix if set .Values.kafkaTopicOverrides.prefix

Or group them under one comment by highlighting them in a separate section.

@nadecancode
Copy link
Contributor Author

@nadecancode, am I correct in understanding that prefixes are added only to the following topics: test-for-commit- - is prefix for test

      topics:
        metrics_sessions: "test-for-commit-ingest-metrics"
        events: "test-for-commit-ingest-attachments"
        transactions: "test-for-commit-ingest-transactions"
        outcomes: "test-for-commit-ingest-outcomes"
        outcomes_billing: "test-for-commit-ingest-outcomes"
        metrics_generic: "test-for-commit-ingest-performance-metrics"
        profiles: "test-for-commit-profiles"
        replay_events: "test-for-commit-ingest-replay-events"
        replay_recordings: "test-for-commit-ingest-replay-recordings"
        monitors: "test-for-commit-ingest-monitors"
        spans: "test-for-commit-snuba-spans"
        metrics_summaries: "test-for-commit-snuba-metrics-summaries"
        cogs: "test-for-commit-shared-resources-usage"
        feedback: "test-for-commit-ingest-feedback-events"

and not to all the ones that are created in Kafka here?

If that's the case, then we should add a comment for the corresponding topics, something like this:

@@ -2058,7 +2058,7 @@ kafka:
         config:
           "message.timestamp.type": LogAppendTime
       - name: profiles-call-tree
-      - name: ingest-replay-events
+      - name: ingest-replay-events  # Set here same topic prefix if set .Values.kafkaTopicOverrides.prefix
         config:
           "message.timestamp.type": LogAppendTime
           "max.message.bytes": "15000000"
@@ -2095,20 +2095,20 @@ kafka:
       - name: snuba-dead-letter-generic-events
       - name: snuba-dead-letter-querylog
       - name: snuba-dead-letter-group-attributes
-      - name: ingest-attachments
-      - name: ingest-transactions
+      - name: ingest-attachments  # Set here same topic prefix if set .Values.kafkaTopicOverrides.prefix
+      - name: ingest-transactions  # Set here same topic prefix if set .Values.kafkaTopicOverrides.prefix
       - name: ingest-events
         ## If the number of exceptions increases, it is recommended to increase the number of partitions for ingest-events
         # partitions: 1
-      - name: ingest-replay-recordings
-      - name: ingest-metrics
-      - name: ingest-performance-metrics
-      - name: ingest-monitors
-      - name: profiles
+      - name: ingest-replay-recordings  # Set here same topic prefix if set .Values.kafkaTopicOverrides.prefix
+      - name: ingest-metrics  # Set here same topic prefix if set .Values.kafkaTopicOverrides.prefix
+      - name: ingest-performance-metrics  # Set here same topic prefix if set .Values.kafkaTopicOverrides.prefix
+      - name: ingest-monitors  # Set here same topic prefix if set .Values.kafkaTopicOverrides.prefix
+      - name: profiles  # Set here same topic prefix if set .Values.kafkaTopicOverrides.prefix
       - name: ingest-occurrences
-      - name: snuba-spans
-      - name: shared-resources-usage
-      - name: snuba-metrics-summaries
+      - name: snuba-spans  # Set here same topic prefix if set .Values.kafkaTopicOverrides.prefix
+      - name: shared-resources-usage  # Set here same topic prefix if set .Values.kafkaTopicOverrides.prefix
+      - name: snuba-metrics-summaries  # Set here same topic prefix if set .Values.kafkaTopicOverrides.prefix

Or group them under one comment by highlighting them in a separate section.

No, all topics provisioned need to be prefixed. Relay only uses some of the topics so we specify manually in yaml. Snubs and sentry use python so I iterated all topics in enum and overlaid an override.

@patsevanton
Copy link
Contributor

why are we not using all these kafka topics? what is needed to use all these kafka topics? maybe we need to update sentry?

@nadecancode
Copy link
Contributor Author

why are we not using all these kafka topics? what is needed to use all these kafka topics? maybe we need to update sentry?

I believe it’s more like relay only needs these topics, since its role is closer to a proxy (hence “relay”)

Copy link
Contributor

@adonskoy adonskoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are dozens of topics and consumers in Sentry, I don’t see a universal solution so that a prefix can be assigned to all topic names, with this PR this can only be done for some topics

I believe that this PR is blocked by another problem - we first need our own job to create topics in Kafka, because the current implementation has many shortcomings and then adding features like this

@nadecancode
Copy link
Contributor Author

There are dozens of topics and consumers in Sentry, I don’t see a universal solution so that a prefix can be assigned to all topic names, with this PR this can only be done for some topics

I believe that this PR is blocked by another problem - we first need our own job to create topics in Kafka, because the current implementation has many shortcomings and then adding features like this

I am not sure about this, that “dozen of topics” are basically all in the Sentry Topic enum so I don’t see a problem with assigning prefix through iteration. The topics that we provision via values.yaml should cover all topics that we need to get Sentry up and running.

The main difference that people need to keep in mind is some of Sentry’s components do not use all topics provisioned.

@nadecancode
Copy link
Contributor Author

I also tested this PR in my company’s deployment, there is no problem with getting that instance running and ingesting transactions, errors, etc.

@nadecancode
Copy link
Contributor Author

@nadecancode, am I correct in understanding that prefixes are added only to the following topics: test-for-commit- - is prefix for test

      topics:
        metrics_sessions: "test-for-commit-ingest-metrics"
        events: "test-for-commit-ingest-attachments"
        transactions: "test-for-commit-ingest-transactions"
        outcomes: "test-for-commit-ingest-outcomes"
        outcomes_billing: "test-for-commit-ingest-outcomes"
        metrics_generic: "test-for-commit-ingest-performance-metrics"
        profiles: "test-for-commit-profiles"
        replay_events: "test-for-commit-ingest-replay-events"
        replay_recordings: "test-for-commit-ingest-replay-recordings"
        monitors: "test-for-commit-ingest-monitors"
        spans: "test-for-commit-snuba-spans"
        metrics_summaries: "test-for-commit-snuba-metrics-summaries"
        cogs: "test-for-commit-shared-resources-usage"
        feedback: "test-for-commit-ingest-feedback-events"

and not to all the ones that are created in Kafka here?

If that's the case, then we should add a comment for the corresponding topics, something like this:

@@ -2058,7 +2058,7 @@ kafka:
         config:
           "message.timestamp.type": LogAppendTime
       - name: profiles-call-tree
-      - name: ingest-replay-events
+      - name: ingest-replay-events  # Set here same topic prefix if set .Values.kafkaTopicOverrides.prefix
         config:
           "message.timestamp.type": LogAppendTime
           "max.message.bytes": "15000000"
@@ -2095,20 +2095,20 @@ kafka:
       - name: snuba-dead-letter-generic-events
       - name: snuba-dead-letter-querylog
       - name: snuba-dead-letter-group-attributes
-      - name: ingest-attachments
-      - name: ingest-transactions
+      - name: ingest-attachments  # Set here same topic prefix if set .Values.kafkaTopicOverrides.prefix
+      - name: ingest-transactions  # Set here same topic prefix if set .Values.kafkaTopicOverrides.prefix
       - name: ingest-events
         ## If the number of exceptions increases, it is recommended to increase the number of partitions for ingest-events
         # partitions: 1
-      - name: ingest-replay-recordings
-      - name: ingest-metrics
-      - name: ingest-performance-metrics
-      - name: ingest-monitors
-      - name: profiles
+      - name: ingest-replay-recordings  # Set here same topic prefix if set .Values.kafkaTopicOverrides.prefix
+      - name: ingest-metrics  # Set here same topic prefix if set .Values.kafkaTopicOverrides.prefix
+      - name: ingest-performance-metrics  # Set here same topic prefix if set .Values.kafkaTopicOverrides.prefix
+      - name: ingest-monitors  # Set here same topic prefix if set .Values.kafkaTopicOverrides.prefix
+      - name: profiles  # Set here same topic prefix if set .Values.kafkaTopicOverrides.prefix
       - name: ingest-occurrences
-      - name: snuba-spans
-      - name: shared-resources-usage
-      - name: snuba-metrics-summaries
+      - name: snuba-spans  # Set here same topic prefix if set .Values.kafkaTopicOverrides.prefix
+      - name: shared-resources-usage  # Set here same topic prefix if set .Values.kafkaTopicOverrides.prefix
+      - name: snuba-metrics-summaries  # Set here same topic prefix if set .Values.kafkaTopicOverrides.prefix

Or group them under one comment by highlighting them in a separate section.

Sorry I just reread the change request - I might have been less clear than I intended to.

So basically, all topics in the provisioning section need to be prefixed, they are ALL being used. But it does not make sense to comment them individually when all of them need to be treated the same way. Would it be better if we just add a comment at the top of provisioning section?

@MemberIT
Copy link
Contributor

@nadecancode
Yes, I meant that in this part of the variables, it would be good to add a comment stating that a prefix value should be added if it's enabled and specified, or to group them under a single comment.

As for the whole PR, unfortunately, I can't recommend approving or not approving it as a whole, because I lack the knowledge of how Sentry and its components interact with Kafka. I just tried to point out the parts of the code that, in my opinion, could be improved.

@nadecancode
Copy link
Contributor Author

@nadecancode Yes, I meant that in this part of the variables, it would be good to add a comment stating that a prefix value should be added if it's enabled and specified, or to group them under a single comment.

As for the whole PR, unfortunately, I can't recommend approving or not approving it as a whole, because I lack the knowledge of how Sentry and its components interact with Kafka. I just tried to point out the parts of the code that, in my opinion, could be improved.

Thank you, @Mokto may I ask if it’s possible to get it merged? I already tested the change in my company’s sentry instance and it’s working as intended - but we would like this to go to the upstream so we don’t have to maintain a separate helm chart.

@Mokto
Copy link
Contributor

Mokto commented Oct 25, 2024

There are conflicts right now.

Thanks

@Mokto
Copy link
Contributor

Mokto commented Oct 25, 2024

👋 Hi, @nadecancode,
I detected conflicts against the base branch 🙊
You'll want to sync 🔄 your branch with upstream!

@nadecancode
Copy link
Contributor Author

There are conflicts right now.

Thanks

Resolved

@Mokto Mokto removed the conflicts label Oct 25, 2024
@Mokto Mokto merged commit 5693406 into sentry-kubernetes:develop Oct 25, 2024
2 of 3 checks passed
@Mokto Mokto mentioned this pull request Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants