[PGBouncer] Adds support for 1.8 new metrics #1011
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Pulls in PGBouncer column names when running query to more easily identify available metrics. Adds in new metrics to be submitted.
Motivation
Users ran into an issue when using PGBouncer 1.8. There are now more metrics available for "SHOW STATS" and "SHOW POOLS"
Previous metrics available - http://web.archive.org/web/20170623115443/https://pgbouncer.github.io/usage.html
Newly available metrics - https://pgbouncer.github.io/usage.html
Since we were indexing the columns using a specific order, the addition of new metrics caused the check to crash.
Testing Guidelines
An overview on testing
is available in our contribution guidelines.
Versioning
manifest.json
datadog_checks/{integration}/__init__.py
CHANGELOG.md
. Please useUnreleased
as the date in the titlefor the new section.
Additional Notes
Instead of just submitting every column available as a metric, I continue to use the SHOW STATS and SHOW POOLS object so that we have a finer control over what metric names and types are when they are submitted. Should future versions provide additional metrics, or change names, we just need to add to those two objects.
Finally, some metric names changed between pre 1.8 and post. Due to this, there may be duplicate metric names in the SHOW STATS object, but with different key/column names.