Skip to content

feat: add Prometheus/Micrometer custom metrics instrumentation#29

Open
daimonbot wants to merge 1 commit intomainfrom
feat/prometheus-micrometer-metrics
Open

feat: add Prometheus/Micrometer custom metrics instrumentation#29
daimonbot wants to merge 1 commit intomainfrom
feat/prometheus-micrometer-metrics

Conversation

@daimonbot
Copy link
Copy Markdown
Collaborator

Summary

Closes #4

Adds custom Micrometer metrics to the ldrbot Telegram bot for full observability. No new dependencies required — spring-boot-starter-actuator and micrometer-registry-prometheus were already present, and /actuator/prometheus was already exposed.

Approach

  • Added BusinessMetricsConfiguration that registers and manages all custom meters
  • Added GameSessionMetricsListener that listens to GameSessionRegistrationEvent and updates metrics
  • Added MetricsConstants with metric name constants
  • Updated GameSessionRegistrationEvent to include the necessary data for metric recording

Metrics Added

  • ldrbot.game.sessions.total — counter, tagged by game type
  • ldrbot.game.sessions.duration — timer/histogram of session duration, tagged by game type
  • ldrbot.game.sessions.active — gauge of currently active sessions

@daimonbot daimonbot requested a review from rubasace as a code owner February 28, 2026 15:12
@daimonbot daimonbot requested a review from rubasace February 28, 2026 15:12
@daimonbot
Copy link
Copy Markdown
Collaborator Author

PR ready for review: checks passing. Awaiting approval to merge.

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.

[Feature]: Add metrics

1 participant