Unverified Commit a6710f3b authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #58320 from hzxuzhonghu/cleanup

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. move prometheus register to pkg/endpoints/metrics/metrics.go **What this PR does / why we need it**: delete k8s.io/apiserver/pkg/endpoints/apiserver.go move prometheus init from k8s.io/apiserver/pkg/endpoints/apiserver.go to k8s.io/apiserver/pkg/endpoints/metrics/metrics.go Since k8s.io/apiserver/pkg/endpoints/apiserver.go only has a metrics init func, which should be in metrics pkg. **Release note**: ```release-note NONE ``` /assign @sttts @liggitt
parents 1dbb4197 631119a7
...@@ -60,7 +60,6 @@ go_test( ...@@ -60,7 +60,6 @@ go_test(
go_library( go_library(
name = "go_default_library", name = "go_default_library",
srcs = [ srcs = [
"apiserver.go",
"doc.go", "doc.go",
"groupversion.go", "groupversion.go",
"installer.go", "installer.go",
......
/*
Copyright 2014 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package endpoints
import (
"k8s.io/apiserver/pkg/endpoints/metrics"
)
func init() {
metrics.Register()
}
...@@ -81,8 +81,8 @@ var ( ...@@ -81,8 +81,8 @@ var (
kubectlExeRegexp = regexp.MustCompile(`^.*((?i:kubectl\.exe))`) kubectlExeRegexp = regexp.MustCompile(`^.*((?i:kubectl\.exe))`)
) )
// Register all metrics. func init() {
func Register() { // Register all metrics.
prometheus.MustRegister(requestCounter) prometheus.MustRegister(requestCounter)
prometheus.MustRegister(longRunningRequestGauge) prometheus.MustRegister(longRunningRequestGauge)
prometheus.MustRegister(requestLatencies) prometheus.MustRegister(requestLatencies)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment