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

ref(crons): Include message_type in kafka message #2723

Conversation

evanpurkhiser
Copy link
Member

@evanpurkhiser evanpurkhiser commented Nov 14, 2023

There are two types of messages that end up in the ingest-monitors kafka topic, "check_in" (the ones produced here in relay) and "clock_pulse" messages, which are produced externally and are intended to ensure the clock continues to run even when ingestion volume drops.

Currently we have some shim logic in our producer which handles adding in this message type when it is missing

https://github.com/getsentry/sentry/blob/07522eb8c43828deee6a74de2bb72cf989ec907d/src/sentry/monitors/consumers/monitor_consumer.py#L591-L595

This change introduces the message_type key for the check-in messages so we no longer need to shim this.

#skip-changelog

@evanpurkhiser evanpurkhiser requested review from a team November 14, 2023 21:30
Comment on lines 1032 to 1039
/// Discriminate tag used to differentiate these messages from clock pulse messages that are
/// also placed into the topic.
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we reword this to meet relay coding guidelines (internal)? Thanks!

ensure that there is a precise first line, followed by more information

Copy link
Member Author

Choose a reason for hiding this comment

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

I think I fixed this

@evanpurkhiser evanpurkhiser force-pushed the evanpurkhiser/ref-crons-include-message-type-in-kafka-message branch from 066b953 to 2795d2a Compare November 18, 2023 00:21
There are two types of messages that end up in the ingest-monitors kafka
topic, "check_in" (the ones produced here in relay) and "clock_pulse"
messages, which are produced externally and are intended to ensure the
clock continues to run even when ingestion volume drops.

Currently we have some shim logic in our producer which handles adding
in this message type when it is missing

https://github.com/getsentry/sentry/blob/07522eb8c43828deee6a74de2bb72cf989ec907d/src/sentry/monitors/consumers/monitor_consumer.py#L591-L595

This change introduces the `message_type` key for the check-in messages
so we no longer need to shim this.
@evanpurkhiser evanpurkhiser force-pushed the evanpurkhiser/ref-crons-include-message-type-in-kafka-message branch from 2795d2a to e029d69 Compare November 21, 2023 21:24
@evanpurkhiser
Copy link
Member Author

Gonna get one more look over this just to be safe.

#[allow(dead_code)]
#[derive(Debug, Serialize)]
#[serde(rename_all = "snake_case")]
enum CheckInMessageType {
Copy link
Member

@Dav1dde Dav1dde Nov 22, 2023

Choose a reason for hiding this comment

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

The first sentence of your issue would be nice here. Documenting the use of the values and that relay is only supposed to ever send CheckIn's

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll add it in in a diff PR 👍

Copy link
Contributor

@iker-barriocanal iker-barriocanal left a comment

Choose a reason for hiding this comment

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

🚀

@evanpurkhiser evanpurkhiser merged commit c7b996c into master Nov 27, 2023
20 of 21 checks passed
@evanpurkhiser evanpurkhiser deleted the evanpurkhiser/ref-crons-include-message-type-in-kafka-message branch November 27, 2023 19:15
jan-auer added a commit that referenced this pull request Nov 29, 2023
* master: (27 commits)
  ref(metric-meta): Add metric for total incoming metric meta (#2784)
  feat(server): Return global config status for downstream requests (#2765)
  ref(processor): Create event processor sub-module with related code (#2779)
  fix(metrics): Temporarily restore previous configuration keys for bucket splitting (#2780)
  feat(metrics): Add source context to code locations (#2781)
  ref(processor): Split off profile processor code into separate sub-module (#2778)
  ref(processor): Split off replay processing code into separate sub-module (#2776)
  ref(metrics): Partition and split metrics buckets just before sending (#2682)
  feat(spans): Allow well-known path segments in resource URLs (#2770)
  ref(processor): Move user and client reports processing into separate submodule (#2772)
  ref(crons): Include message_type in kafka message (#2723)
  ref(spans): Split tag mapping in specific configs (#2773)
  release: 23.11.2
  feat(metric-meta): Normalize invalid metric names (#2769)
  feat(spans): Extract main_thread tag for spans (#2761)
  Add DE Deployments (#2746)
  ref(processor): Move sessions related code into separate sub-module (#2768)
  ref(metric-meta): Capture envelope payload in a sentry issue (#2767)
  release: 0.8.38
  ref(normalization): Restore span processing to transactionprocessor (#2764)
  ...
evanpurkhiser added a commit to getsentry/sentry that referenced this pull request Nov 30, 2023
After getsentry/relay#2723 this field is
guaranteed to exist in the CheckinMessage. We no longer need to add this
in and have it marked as NotRequired.
evanpurkhiser added a commit to getsentry/sentry that referenced this pull request Nov 30, 2023
After getsentry/relay#2723 this field is
guaranteed to exist in the CheckinMessage. We no longer need to add this
in and have it marked as NotRequired.
ArthurKnaus pushed a commit to getsentry/sentry that referenced this pull request Dec 1, 2023
After getsentry/relay#2723 this field is
guaranteed to exist in the CheckinMessage. We no longer need to add this
in and have it marked as NotRequired.
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.

3 participants