Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release/v4.1.0 #62

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

release/v4.1.0 #62

wants to merge 8 commits into from

Conversation

NorseGaud
Copy link
Member

@NorseGaud
Copy link
Member Author

@gjasny , are the small changes I made ok with you? It shouldn't break your metric. It essentially uses last updated timestamp for non-Started metrics since cr_time doesn't work for those.

var instanceTime time.Time
var err error
if instance.Vm.State != "Started" {
instanceTime, err = time.Parse(time.RFC3339, instance.Vm.LastUpdateTime) // can't use CreationTime because it's not updated for non-started instances
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gjasny Please review

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea of the age was to see how old the oldest instance (of a certain template) is. If the timestamp that is used to calculate the age is now updated as well, the "birth date" of the instance is moving which defeats the purpose. E.g. in the case of pulling, the instance is now reported with a maximum value of 5 seconds.

If the cr_time field is not present for the Scheduling state (and others) we should exclude those states (or only include states which are guaranteed to have the cr_time field). Or skip all instances that don't have the cr_time field.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On my controller even a "Scheduling" instance has the cr_time filed:

      "vm": {
        "instance_id": "050823b7-ab5c-4947-77bb-06aa2a4a69d6",
        "instance_state": "Scheduling",
        "cr_time": "2025-01-30T07:55:07.334254871Z",

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arturmelanchyk , can you check to see which states use cr_time and which use ts?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in the most recent version of the controller (1.45.0) all instances in all states have both cr_time and ts

Copy link
Member Author

@NorseGaud NorseGaud Jan 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cr_time only set on an instance creation (in the DB) and never changed
ts gets updated from time to time due to different events, like save image, termination etc
both ts and cr_time are members of an Instance object, they do not depend on the vm (regardless if the vm has started or not)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants