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

feat: Implement basic producer #33

Merged
merged 5 commits into from
Jun 11, 2024
Merged

feat: Implement basic producer #33

merged 5 commits into from
Jun 11, 2024

Conversation

wedamija
Copy link
Member

@wedamija wedamija commented Jun 7, 2024

This implements the basics of a producer for sending results back to sentry.

@wedamija wedamija requested a review from evanpurkhiser June 7, 2024 01:45
src/producer.rs Outdated
Comment on lines 22 to 23
topic: Topic,
config: KafkaConfig,
Copy link
Member Author

Choose a reason for hiding this comment

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

It might make sense for this to not have to accept the topic/config, and for us to have it set up somewhere

Copy link
Member

Choose a reason for hiding this comment

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

Yeah I agree, we can just put this method on a struct and load it in there

src/producer.rs Outdated Show resolved Hide resolved
src/producer.rs Outdated Show resolved Hide resolved
src/producer.rs Outdated Show resolved Hide resolved
src/checker.rs Outdated Show resolved Hide resolved
src/producer.rs Outdated Show resolved Hide resolved
src/producer.rs Outdated Show resolved Hide resolved
wedamija added 2 commits June 11, 2024 09:33
This implements the basics of a producer for sending results back to sentry.
@wedamija wedamija force-pushed the danf/result-producer branch from 7c3c435 to da568f7 Compare June 11, 2024 16:35
src/producer.rs Outdated Show resolved Hide resolved
src/scheduler.rs Outdated
// TODO: Producer should be instantiated with these values and shared
let config = KafkaConfig::new_config(["0.0.0.0".to_string()].to_vec(), None);
let topic = Topic::new("uptime-checker-results");
let _ = produce_checker_result(&check_result, topic, config).await;
Copy link
Member

Choose a reason for hiding this comment

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

nice, let's move the config outside of the function though I think.

If you address the earlier comment of making a ResultsProducer struct we can pull that out also (will need to wrap in Arc)

Once #43 is merged we can pass the config into run_scheduler and it can construct the KafkaConfig from that

@wedamija wedamija merged commit e55f154 into main Jun 11, 2024
5 checks passed
@wedamija wedamija deleted the danf/result-producer branch June 11, 2024 17:41
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.

2 participants