add sync_agent_published_resource metric#169
Merged
Merged
Conversation
Member
Author
|
/retest because I cannot see logs anymore |
038f77a to
fb951aa
Compare
Contributor
|
LGTM label has been added. DetailsGit tree hash: 3b6b2a33a76e1de39c127c57241fe03416ac166c |
Contributor
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: xrstf The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds a metric on how many published_resources are managed by the agent. Opposed to the initial issue, a gauge was chosen instead of a counter as this metric of course can decrease if a published ressource is delete.
The updating of the metric itself is done directly in the APIExport reconciliation loop as we do trigger this for all ApiExports as well as PublishedResouces with RessourceSchemas and we already to a list call there, which is perfect for determining the number of managed Published Ressources.
With regards to testing: I think we have two options here, both are not perfect. I have split them in separate commits. The unit one is kind of superficial, it just creates fakeclients and then asserts that the metric variable has been changed by the reconciler. Maybe this is good enough? Alternatively, we can have that in a proper e2e test, there the only difficulty was obtaining a free port to fetch the metrics from and it takes a lot longer.
As said, please let me know what you prefer.
What Type of PR Is This?
/kind feature
Related Issue(s)
Fixes #160
Release Notes