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

Bug 1874521: connectivity check metrics cannot be aggregated across components #933

Merged

Conversation

sanchezl
Copy link
Contributor

@sanchezl sanchezl commented Aug 18, 2020

Implement changes to the metric names and labels as discovered during reviews for better usability.

  • Names changed to no longer be specific to the component check-endpoints is being run in. They will always be:
pod_network_connectivity_check_count
pod_network_connectivity_check_tcp_connect_latency_gauge
pod_network_connectivity_check_dns_resolve_latency_gauge
  • endpoint labels renamed to targetEndpoint to avoid collisions with default label of the same name.
  • component label added (e.g. openshift-kube-apiserver or openshift-apiserver)
  • checkName label added

@sanchezl
Copy link
Contributor Author

/test verify-deps

@sanchezl
Copy link
Contributor Author

/test images

@tkashem
Copy link
Contributor

tkashem commented Aug 19, 2020

pod_network_connectivity_check_count
pod_network_connectivity_check_tcp_connect_latency_gauge
pod_network_connectivity_check_dns_resolve_latency_gauge

The metric naming convention followed by k8s is `{namespace}_{sub system}_name
{namespace} : this is the component name, for example: apiserver (kube-apiserver), etcd, kubelet etc.

what do you think about renaming the metrics to connectivity_pod_network_check_*. In future you could have something like connectivity_sdn_* or connectivity_lb_*.

component label added (e.g. openshift-kube-apiserver or openshift-apiserver)

We are already using the label value kube-apiserver to refer to kube-apiserver. I would recommend using the same value to keep it consistent.

Copy link
Contributor

@tkashem tkashem left a comment

Choose a reason for hiding this comment

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

looks good, just have a couple of minor comments.

func (m *metricsContext) getCounterMetricLabels(targetEndpoint string, latency *trace.LatencyInfo, checkErr error) map[string]string {
labels := m.getMetricLabels(targetEndpoint)
labels["dnsResolve"] = ""
labels["tcpConnect"] = ""
Copy link
Contributor

Choose a reason for hiding this comment

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

we can think about choosing a non-empty value to indicate the default/initial condition? In general, it's safer to avoid an empty string - no need to worry about how prometheus handles non existing and empty label.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels:

A label with an empty label value is considered equivalent to a label that does not exist.

@sanchezl
Copy link
Contributor Author

/test images

@sanchezl
Copy link
Contributor Author

The metric naming convention followed by k8s is `{namespace}_{sub system}_name
{namespace} : this is the component name, for example: apiserver (kube-apiserver), etcd, kubelet etc.

what do you think about renaming the metrics to connectivity_pod_network_check_*. In future you could have something like connectivity_sdn_* or connectivity_lb_*.

component label added (e.g. openshift-kube-apiserver or openshift-apiserver)

We are already using the label value kube-apiserver to refer to kube-apiserver. I would recommend using the same value to keep it consistent.

@sanchezl sanchezl closed this Aug 21, 2020
@sanchezl sanchezl reopened this Aug 21, 2020
@tkashem
Copy link
Contributor

tkashem commented Aug 21, 2020

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 21, 2020
@sanchezl
Copy link
Contributor Author

/test e2e-aws-upgrade

4 similar comments
@sanchezl
Copy link
Contributor Author

/test e2e-aws-upgrade

@sanchezl
Copy link
Contributor Author

/test e2e-aws-upgrade

@sanchezl
Copy link
Contributor Author

/test e2e-aws-upgrade

@sanchezl
Copy link
Contributor Author

/test e2e-aws-upgrade

@sanchezl sanchezl changed the title check-endpoints: refactor metric names and labels Bug 1874521: connectivity check metrics cannot be aggregated across components Sep 1, 2020
@openshift-ci-robot openshift-ci-robot added the bugzilla/severity-unspecified Referenced Bugzilla bug's severity is unspecified for the PR. label Sep 1, 2020
@openshift-ci-robot
Copy link

@sanchezl: This pull request references Bugzilla bug 1874521, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.6.0) matches configured target release for branch (4.6.0)
  • bug is in the state NEW, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1874521: connectivity check metrics cannot be aggregated across components

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot added the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label Sep 1, 2020
@sanchezl
Copy link
Contributor Author

sanchezl commented Sep 1, 2020

/bugzilla refresh

@openshift-ci-robot
Copy link

@sanchezl: This pull request references Bugzilla bug 1874521, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.6.0) matches configured target release for branch (4.6.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

/bugzilla refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@sanchezl
Copy link
Contributor Author

sanchezl commented Sep 1, 2020

/bugzilla refresh

@openshift-ci-robot openshift-ci-robot removed the bugzilla/severity-unspecified Referenced Bugzilla bug's severity is unspecified for the PR. label Sep 1, 2020
@openshift-ci-robot
Copy link

@sanchezl: This pull request references Bugzilla bug 1874521, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.6.0) matches configured target release for branch (4.6.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

/bugzilla refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot added the bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. label Sep 1, 2020
@deads2k
Copy link
Contributor

deads2k commented Sep 1, 2020

/approve

@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deads2k, sanchezl, tkashem

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

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 1, 2020
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit fa89e5a into openshift:master Sep 1, 2020
@openshift-ci-robot
Copy link

@sanchezl: All pull requests linked via external trackers have merged:

Bugzilla bug 1874521 has been moved to the MODIFIED state.

In response to this:

Bug 1874521: connectivity check metrics cannot be aggregated across components

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

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. bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants