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

Add Ingress usage metrics #976

Merged
merged 1 commit into from
Jan 6, 2020
Merged

Conversation

skmatti
Copy link
Contributor

@skmatti skmatti commented Dec 23, 2019

This exports the following ingress related usage metrics at a periodic interval(currently set to 10 mins),

  1. Count of ingresses for each feature.
  2. Count of service-port pairs for each feature.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 23, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @skmatti. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Dec 23, 2019
@skmatti
Copy link
Contributor Author

skmatti commented Dec 23, 2019

/assign @freehan

Copy link
Contributor

@freehan freehan left a comment

Choose a reason for hiding this comment

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

  • Add more V(6) logging for this PR.
  • Add comments for functions.

pkg/metrics/metrics.go Outdated Show resolved Hide resolved
pkg/metrics/metrics.go Show resolved Hide resolved
pkg/metrics/metrics.go Outdated Show resolved Hide resolved
return ingCount, svcPortCount
}

func updateServicePortCount(svcPortCount map[Feature]int, features []Feature) map[Feature]int {
Copy link
Contributor

Choose a reason for hiding this comment

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

no need to return map. Just reuse svcPortCount from caller

Copy link
Contributor

Choose a reason for hiding this comment

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

Alternative Idea:

Make map[Feature]int into a type. And add member function for the type.

pkg/metrics/metrics.go Show resolved Hide resolved
@skmatti skmatti force-pushed the metrics branch 2 times, most recently from b6c25d9 to 532b38f Compare December 24, 2019 01:59
@bowei
Copy link
Member

bowei commented Dec 24, 2019

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 24, 2019
pkg/metrics/features.go Outdated Show resolved Hide resolved
pkg/metrics/features.go Show resolved Hide resolved
pkg/metrics/features.go Outdated Show resolved Hide resolved
pkg/metrics/features.go Outdated Show resolved Hide resolved
pkg/controller/controller_test.go Outdated Show resolved Hide resolved
pkg/metrics/metrics.go Outdated Show resolved Hide resolved
pkg/metrics/metrics.go Outdated Show resolved Hide resolved
pkg/metrics/metrics.go Outdated Show resolved Hide resolved
cmd/glbc/main.go Outdated Show resolved Hide resolved
@skmatti skmatti force-pushed the metrics branch 3 times, most recently from 3fd78ad to 5649c20 Compare January 2, 2020 23:41
Copy link
Contributor

@freehan freehan left a comment

Choose a reason for hiding this comment

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

Just nits

@bowei to take a final look

cmd/glbc/main.go Outdated Show resolved Hide resolved
pkg/metrics/types.go Outdated Show resolved Hide resolved
pkg/context/context.go Show resolved Hide resolved
pkg/metrics/types.go Outdated Show resolved Hide resolved
@skmatti
Copy link
Contributor Author

skmatti commented Jan 3, 2020

/assign @bowei

@freehan
Copy link
Contributor

freehan commented Jan 6, 2020

I think it is very low risk to merge
/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 6, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: freehan, skmatti

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 6, 2020
@k8s-ci-robot k8s-ci-robot merged commit 5729ae0 into kubernetes:master Jan 6, 2020
@skmatti skmatti deleted the metrics branch January 8, 2020 02:13
k8s-ci-robot added a commit that referenced this pull request Feb 8, 2020
Cherrypick #976, #984, #990 and #1012 [Ingress Usage metrics] into release 1.8
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants