-
Notifications
You must be signed in to change notification settings - Fork 743
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unify Gatekeeper and controller-runtime metrics into a single endpoint (
#1482) * Unify Gatekeeper and controller-runtime metrics into a single endpoint Fixes #1420 Signed-off-by: Oren Shomron <shomron@gmail.com> * Suppress rest_client_request_latency_* metrics due to cardinality concerns Signed-off-by: Oren Shomron <shomron@gmail.com> * Resolve lint warning Signed-off-by: Oren Shomron <shomron@gmail.com> Co-authored-by: Rita Zhang <rita.z.zhang@gmail.com>
- Loading branch information
Showing
401 changed files
with
22,259 additions
and
5,348 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
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 metrics | ||
|
||
import ( | ||
"net/url" | ||
"time" | ||
|
||
clientmetrics "k8s.io/client-go/tools/metrics" | ||
_ "sigs.k8s.io/controller-runtime/pkg/metrics" // Needed for init() side effect | ||
) | ||
|
||
// DisableRESTClientMetrics disables the rest client latency histograms configured by | ||
// controller-runtime in sigs.k8s.io/controller-runtime/pkg/metrics/client_go_adapter.go#registerClientMetrics. | ||
func DisableRESTClientMetrics() { | ||
clientmetrics.RequestLatency = noopLatency{} | ||
} | ||
|
||
type noopLatency struct{} | ||
|
||
func (noopLatency) Observe(string, url.URL, time.Duration) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
123 changes: 123 additions & 0 deletions
123
vendor/contrib.go.opencensus.io/exporter/prometheus/.golangci.yml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
vendor/contrib.go.opencensus.io/exporter/prometheus/.travis.yml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
65 changes: 10 additions & 55 deletions
65
vendor/contrib.go.opencensus.io/exporter/prometheus/Makefile
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.