MGDAPI-5082 - fix issue with metrics creation #675
Merged
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.
Overview
MGDAPI-5082
What
Discovered an issue in v1.0.0 - metrics were added during the cloudmetrics_controller initialisation here for GCP
553f8d9
(#671) but the result was that the original metrics created by AWS were registered twice. Once the Postgres instance is created, the metric is re-registered when setting for the first time here but without the help message. This results in a conflict and the pod was crash looping.The change here is to add all initially registered metrics from the cloudmetrics controller to the overall metrics vector so that any subsequent calls to SetMetric do not try to re-register the metric.
Verification
make cluster/prepare
make run