Add permet pool metrics to dynamo db backend #21742
Merged
+48
−2
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.
See #21588
To aid in debugging we want to have metrics on the number of requests in the permit pool for the dynamodb backend and the number of waiting requests. This change implements this by adding NewPermitPoolWithMetrics which shadows the existing permit pool definition except with calls to publish metrics on the pool size, active requests. and waiting requests before and after each permit is acquired or released
Example metrics from Vault:
![image](https://private-user-images.githubusercontent.com/8621000/252750524-8687eac8-5b16-4e45-9a8d-a570a2cb4bd1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk5MTc4NzIsIm5iZiI6MTczOTkxNzU3MiwicGF0aCI6Ii84NjIxMDAwLzI1Mjc1MDUyNC04Njg3ZWFjOC01YjE2LTRlNDUtOWE4ZC1hNTcwYTJjYjRiZDEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMThUMjIyNjEyWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NGQ3YTY3OWU3MmM4NzVkMmMwZWQ4MmMyZGRjZTQwZGI1NmNlY2ZkZTg4NGI4M2VjYTVmNmQ2OGJlN2YyYTc4OSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.UuPtJN7I6PIcJptvzgD15EL5JcIVdEdOQu8SLQyOXCE)