-
Notifications
You must be signed in to change notification settings - Fork 898
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
Allow to schedule disconnected container entities for perf capture #16302
Allow to schedule disconnected container entities for perf capture #16302
Conversation
a. b. [1] https://github.com/openshift/origin-metrics/blob/master/metrics.yaml#L150 |
@yaacov it was my fault, last commit fixes it, we have to keep container_project_id, which is used on the background in the query. So now it works and collect metrics for disconnected entities. :-) |
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.
Very nice!
app/models/metric/capture.rb
Outdated
@@ -20,6 +20,10 @@ def self.historical_start_time | |||
historical_days.days.ago.utc.beginning_of_day | |||
end | |||
|
|||
def self.targets_archived_from | |||
Settings.performance.targets.archived_for.to_i_with_method.seconds.ago.utc |
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.
too.long.chain.didnt.follow :)
do you mind splitting .seconds.ago.utc
to another statement?
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.
done
Use scope instead of the deleting foreign key. Node relation is required for metrics capture.
Add configurable targets_archived_for, that we use for collecting metrics.
Collect metrics for archived Container entities. We need this for shortlived entities (e.g. pods), to make sure the entity is not discovered and archived before the metrics capture was planned. The amount of time for looking back for archived items is configurable and by default is 8h.
Do not nullify container_project_id foreign key, since the project is also important for metrics collection.
Refactor targets_archived_from to be more readable
8d6f112
to
58f788b
Compare
Checked commits Ladas/manageiq@70f8620~...58f788b with ruby 2.3.3, rubocop 0.47.1, and haml-lint 0.20.0 |
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.
LGTM 👍
@Ladas can you put in a PR for kubernetes (and openshift if it would break with this change in) since we know this change breaks some spec tests there? I would like to merge these together. |
@agrare will do, it should be just the 1 reverted commit |
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.
LGTM, @Ladas I'll merge when the kubernetes PR is posted.
…ontainer_entities_for_perf_capture Allow to schedule disconnected container entities for perf capture
We use deleted_on to represent a record that is deleted. We moved over to using archived (deleted_on) from old_container_project_id see also: - f6fe251 - ManageIQ#16302
We use deleted_on to represent a record that is deleted. We moved over to using archived (deleted_on) from old_container_project_id see also: - f6fe251 - ManageIQ#16302
We use deleted_on to represent a record that is deleted. We moved over to using archived (deleted_on) from old_container_project_id Convert all_container_groups to a regular association see also: - f6fe251 - ManageIQ#16302
Collect metrics for archived Container entities. We need this
for shortlived entities (e.g. pods), to make sure the entity
is not discovered and archived before the metrics capture
was planned. The amount of time for looking back for archived
items is configurable and by default is 8h.
Partially fixes:
https://bugzilla.redhat.com/show_bug.cgi?id=1506671