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

separate openshift_template_instance_status_condition_total and openshift_template_instance_total metrics #16588

Conversation

jim-minter
Copy link
Contributor

@jim-minter jim-minter commented Sep 27, 2017

follow-up from #16455

@smarterclayton @bparees ptal
@gabemontero fyi

@openshift-ci-robot openshift-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 27, 2017
Copy link
Contributor

@bparees bparees left a comment

Choose a reason for hiding this comment

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

A couple of comments basically just soliciting @smarterclayton's confirmation that this is really what we want to do, but if so then it lgtm.

Name: "openshift_template_instance_total",
Help: "Counts TemplateInstance objects by condition type and status",
Name: "openshift_template_instance_info",
Help: "Information about templateinstance.",
Copy link
Contributor

Choose a reason for hiding this comment

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

i know this is copied from KSM but i just want to call @smarterclayton's attention to it because it seems like an unhelpful name+description for a metric that is really "total number of template instances".

Copy link
Contributor

Choose a reason for hiding this comment

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

Lack of sleep may be impairing my judgment, but I'll say it:, KSM is just wrong IMO in this regard; it should end in _total

templateInstancesTotal.WithLabelValues(string(cond.Type), string(cond.Status)).Inc()
templateInstanceStatusCondition.WithLabelValues(templateInstance.Namespace, templateInstance.Name, string(cond.Type), "true").Set(boolFloat64(cond.Status == kapi.ConditionTrue))
templateInstanceStatusCondition.WithLabelValues(templateInstance.Namespace, templateInstance.Name, string(cond.Type), "false").Set(boolFloat64(cond.Status == kapi.ConditionFalse))
templateInstanceStatusCondition.WithLabelValues(templateInstance.Namespace, templateInstance.Name, string(cond.Type), "unknown").Set(boolFloat64(cond.Status == kapi.ConditionUnknown))
Copy link
Contributor

Choose a reason for hiding this comment

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

again i understand (after talking to @jim-minter) that this follows KSM, but it seems weird to guarantee we are going to report a datapoint for every combination of condition values, for each template instance. Reporting "0" doesn't seem terribly interesting for a condition=foo if we're also reporting "1" for condition=bar.

Copy link
Contributor

Choose a reason for hiding this comment

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

(and on that same note it seems heavy handed to report N datapoints for every template instance, rather than just a few datapoints that roll up the totals for each condition). Again, understand this follows the KSM pattern, but want to call @smarterclayton's attention to it.

@openshift-ci-robot openshift-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 28, 2017
@jim-minter jim-minter changed the title updates to templateinstance metrics to more closely match ksm separate openshift_template_instance_status_condition_total and openshift_template_instance_total metrics Sep 28, 2017
@jim-minter
Copy link
Contributor Author

@bparees @smarterclayton updated...

@bparees
Copy link
Contributor

bparees commented Sep 28, 2017

@smarterclayton so the reason we (or at least I?) prefer this implementation is that creating a metric per condition would mean having to change metric code if we add new conditions. Whereas this implementation is dynamic w/ respect to the set of valid conditions.

So given the choice of 2 metrics (one for total, one that includes the condition+conditional_value labels) or N metrics (one metric per condition, each metric having a condition_value label), I prefer 2 metrics.

@jim-minter
Copy link
Contributor Author

/retest

@jim-minter jim-minter closed this Sep 29, 2017
@jim-minter jim-minter reopened this Sep 29, 2017
@jim-minter
Copy link
Contributor Author

/retest

1 similar comment
@jim-minter
Copy link
Contributor Author

/retest

@jim-minter
Copy link
Contributor Author

@bparees bump

@bparees
Copy link
Contributor

bparees commented Oct 3, 2017

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 3, 2017
@bparees bparees added the kind/bug Categorizes issue or PR as related to a bug. label Oct 3, 2017
@openshift-merge-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bparees, jim-minter

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 3, 2017
@openshift-merge-robot
Copy link
Contributor

Automatic merge from submit-queue.

@openshift-merge-robot openshift-merge-robot merged commit 79da86b into openshift:master Oct 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants