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

Improve flexibility for the dispatcher, and provide an example on adding metrics #103

Merged
merged 14 commits into from
Sep 2, 2023

Conversation

PaulSonOfLars
Copy link
Owner

What

Multiple changes in this PR, namely:

  • extend and improves the Dispatcher to allow for a way to change or influence the update processing logic. This allows for a simple way to plug in various metrics and monitoring solutions.
  • add new example bots that make use of these new dispatcher features (and demonstrate how to add monitoring to a bot!)
  • rework the Bot/BaseBotClient structs, as well as the BotClient interface, to reduce coupling and move the token to a more logical place. The client should not be handling auth, just the connection itself.
  • Remove the overly-complex middleware logic for the bot struct; this can be replaced with a custom bot client instead, which avoid ordering issues and is easier to understand without needing weird anonymous wrapper functions.

Impact

  • Are your changes backwards compatible? No - multiple lib changes
  • Have you included documentation, or updated existing documentation? Y
  • Do errors and log messages provide enough context? Y

@PaulSonOfLars PaulSonOfLars force-pushed the paul/improve-monitoring-capabilities branch from 2b379bd to ef20da7 Compare August 21, 2023 07:23
samples/metricsBot/metricsMiddleware.go Outdated Show resolved Hide resolved
@PaulSonOfLars PaulSonOfLars force-pushed the paul/improve-monitoring-capabilities branch 3 times, most recently from 6a86511 to 2d1039b Compare August 23, 2023 14:17
@PaulSonOfLars PaulSonOfLars force-pushed the paul/improve-monitoring-capabilities branch from 2d1039b to 9ce74b9 Compare September 2, 2023 12:24
@PaulSonOfLars PaulSonOfLars force-pushed the paul/improve-monitoring-capabilities branch from 9ce74b9 to 7591724 Compare September 2, 2023 12:59
@PaulSonOfLars PaulSonOfLars merged commit e5cacff into v2 Sep 2, 2023
3 checks passed
@PaulSonOfLars PaulSonOfLars deleted the paul/improve-monitoring-capabilities branch September 2, 2023 14:44
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.

None yet

2 participants