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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not add these metrics in the OperationTask.submitJob that's where actual job submission happens and that is the triggering point. This is basically processing data and data preparation step. This is common for all the job type and some may not be relevant some job type which are not interested. This could also lead to more cardinality. We could also enable metrics emission for on specific job type going forward.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also I commented on the other PR and this metric may not be needed to start with. We are emitting the final status and that should capture the status of a triggered job. We can actually avoid this additional metric.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In cases where the maintenance job is skipped, the operationTask is not submitted. This method simply returns an empty Task list without submitting the task. So, operationTask.submitJob is not called at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maintenance_job_skipped + maintenance_job_completed should give the total number. We can submit maintenance_job_skipped to get skip count if needed. Skip maintenance is based on config or policy is not present etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, yes. But there is one more code path where the reportJobStatus is not called. In this case, the maintenance_job_completed would not be registered. Given this, I feel like having all the 3 metrics makes debugging easier. Thoughts ?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty state is rare failure scenario and skipped is returned for that. So we can report SKIPPED. That way we can avoid one additional metric. I am mainly concern on the cardinality and scrapping limit. We can incrementally add additional metrics by observing how it behaves.