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

Refactor test/integration/master/ with metric #83833

Merged
merged 1 commit into from
Oct 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/integration/master/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ go_library(
"//staging/src/k8s.io/apiserver/pkg/storage/storagebackend:go_default_library",
"//staging/src/k8s.io/apiserver/pkg/storage/value:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes:go_default_library",
"//staging/src/k8s.io/component-base/metrics/legacyregistry:go_default_library",
"//test/integration:go_default_library",
"//test/integration/framework:go_default_library",
"//vendor/github.com/coreos/etcd/clientv3:go_default_library",
"//vendor/github.com/prometheus/client_golang/prometheus:go_default_library",
"//vendor/k8s.io/klog:go_default_library",
"//vendor/sigs.k8s.io/yaml:go_default_library",
] + select({
Expand Down
4 changes: 2 additions & 2 deletions test/integration/master/transformation_testcase.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"k8s.io/klog"

"github.com/coreos/etcd/clientv3"
"github.com/prometheus/client_golang/prometheus"
"k8s.io/component-base/metrics/legacyregistry"
Copy link
Member

Choose a reason for hiding this comment

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

This is not -1 against this PR at all, just a question:

The name "legacy" makes me unconfident because that seems deprecated component.
I tried to find that is deprecated or not on component-base side, but I cannot.

One more thing is the component-base contains KubeRegistry interface which also implements prometheus.Gatherer interfance like https://github.com/kubernetes/component-base/blob/e1c485d3541add9d20eaf26c84602e13d76f3421/metrics/registry.go#L60

Can we use it instead for stable interface?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks your review. maybe the name "legacy" looks like unconfident. you can see example

Copy link
Member Author

Choose a reason for hiding this comment

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

@RainbowMango can you explain this to oomichi ? Thanks !!!

Copy link
Member

Choose a reason for hiding this comment

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

looks like there are more PRs coming in that also use the legacyregistry path.
perhaps @logicalhan and @sttts can confirm if this is correct.

"sigs.k8s.io/yaml"

corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -241,7 +241,7 @@ func (e *transformTest) readRawRecordFromETCD(path string) (*clientv3.GetRespons

func (e *transformTest) printMetrics() error {
e.logger.Logf("Transformation Metrics:")
metrics, err := prometheus.DefaultGatherer.Gather()
metrics, err := legacyregistry.DefaultGatherer.Gather()
if err != nil {
return fmt.Errorf("failed to gather metrics: %s", err)
}
Expand Down