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

fix: open connections metrics increment #74

Merged
merged 1 commit into from
Aug 29, 2023

Conversation

alencardc
Copy link
Contributor

Fixes #73

When a new connection was opened, the mobc_pool_connections_opened_total metric was incremented as a gauge, and mobc_pool_connections_open was incremented as a counter. However, mobc_pool_connections_opened_total was described as a counter while mobc_pool_connections_open was described as a gauge. Simultaneously, mobc_pool_connections_open is decremented as a gauge when a connection is closed. Therefore,

  • mobc_pool_connections_opened_total was incorrectly registered as a gauge instead of a counter.
  • mobc_pool_connections_open was divided into two different metrics, where the gauge represented the negative number of closed connections, and the counter represented the total number of opened connections.

So, this PR increments mobc_pool_connections_opened_total as a counter and mobc_pool_connections_open as a gauge when a new pool connection is opened.

Copy link
Collaborator

@garrensmith garrensmith left a comment

Choose a reason for hiding this comment

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

@alencardc Nice catch.

@garrensmith garrensmith merged commit 11e055e into importcjj:main Aug 29, 2023
1 check passed
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.

Metrics related to opened connections are registered incorrectly
2 participants