Commit Graph

18 Commits

Author SHA1 Message Date
Markus Thömmes 980a33719a
Fix revive related linting issues (#2131) 2021-05-26 01:10:28 -07:00
Stavros Kontopoulos 84c98f3c3e
remove reflector metrics (#2020) 2021-02-15 08:55:23 -08:00
Stavros Kontopoulos 448ae657fb
Metric unit fixes (#2018)
* metric unit fixes

* additional fixes
2021-02-12 12:38:35 -08:00
rusde 3154117dcf
Add tags to knative provided reconcile metrics (#1916)
* Add  tags to knative provided reconcile metrics

* Remove resource tag to reduce metric cardinality

* Removing unknown tags

* Update controller/testing/fake_stats_reporter.go

Co-authored-by: Victor Agababov <vagababov@gmail.com>

Co-authored-by: Victor Agababov <vagababov@gmail.com>
2020-11-24 12:42:35 -08:00
Zbynek Roubalik 2d4efecc6b
bump to k8s 1.18 (#1428)
* bump to k8s 1.18.8

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>

* plumbing ctx through

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>

* add more ctx plumbing

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>

* ctx WithCancel()

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2020-09-11 07:54:00 -07:00
Lance Liu e863db0344
Remove key in tags to reduce metrics count (#1494)
* Remove key in tags to reduce metrics count
Issue: https://github.com/knative/serving/issues/8609

Signed-off-by: Lance Liu <xuliuxl@cn.ibm.com>

* remove tag key for OpenCensus

Signed-off-by: Lance Liu <xuliuxl@cn.ibm.com>
2020-07-15 01:29:32 -07:00
Victor Agababov 41aec11a3c
Use new RecordBatch method to join metric reporting (#1029)
* Use new RecordBatch method to join metric reporting

* review
2020-02-03 16:27:30 -08:00
Markus Thömmes 56c2594e4f Assorted linting fixes. (#840)
* Remove unused code.

* Remove unneeded loops.

* Remove unneeded Printf calls.

* Use time.Since instead of time.Now().Sub.

* Remove unused values.

* Rename error variable according to conventions.

* Return error last.

* Simplify array allocations.

* Remove leaky ticker.

* Remove Yoda conditions.

* Remove deprecated function to talk to GKE.

* Remove dot import.

* Remove empty critical section and replace with a channel operation.

* Add linter directives to explicitly state wanted weirdness.

* Update deps.

* Fix broken line.
2019-11-01 12:49:12 -07:00
Matt Moore e4ac97c252 Update our dependency on K8s libs to 1.15.3 (#686)
With a minimum K8s version of 1.14 (starting in 0.10), 1.15.3 puts us in the center of the +/-1 version window of support.
2019-09-18 13:36:48 -07:00
Matt Moore 3c828cf99f Hook into two other Kubernetes metric subsystems. (#682)
This adds logic to hook into two other metric systems:
1. `cache.SetReflectorMetricsProvider`, which doesn't seem hooked up in Kubernetes yet, but would theoretically give us metrics about the mechanisms underpinning informers.
2. `metrics.Register`, which hooks us into the rest client infrastructure to give us metrics about low-level API server calls.

Fixes: https://github.com/knative/pkg/issues/679
Fixes: https://github.com/knative/pkg/issues/680
2019-09-16 10:46:43 -07:00
Matt Moore ecb98001f2 Implement workqueue.MetricsProvider (#678)
The kubernetes workqueue provides a facility for collecting metrics by registering a workqueue.MetricsProvider
via workqueue.SetProvider.

This change implements that interface to expose the workqueue metrics into opencensus.

This is loosely based on some work started by @grantr [here](https://github.com/kubernetes-sigs/controller-runtime/compare/master...grantr:opencensus-replace#diff-bb94124aff8d568cb4e82854c7d44fd1)

Fixes: https://github.com/knative/pkg/issues/522
2019-09-16 09:55:41 -07:00
savitaashture 7b67118970 Use tag.MustNewKey instead tag.NewKey (#654) 2019-09-10 18:23:29 -07:00
mattmoor-sockpuppet 1864f499dc golang format tools (#497)
Produced via:
  `gofmt -s -w $(find -path './vendor' -prune -o -type f -name '*.go' -print))`
  `goimports -w $(find -name '*.go' | grep -v vendor)`
/assign @mattmoor
2019-06-27 07:37:08 -07:00
Matt Moore 222dd25986 Migrate pkg to use the knative.dev/pkg import path (#489)
* Manual changes.

* scripted changes.
2019-06-26 13:02:06 -07:00
Matt Moore 985bff446d Simplify the default controller.Impl constructor. (#427)
A while back we added a "StatsReporter" argument to `controller.NewImpl`,
but in serving every callsite of this is passing:
```
controller.NewImpl(r, logger, "my-string", MustNewStatsReporter("my-string", logger))
```

Where `MustNewStatsReporter` is just a form of knative/pkg's `controller.NewStatsReporter`
that logs fatally when an error is returned.  It is notable that Serving's logic has been
duplicated to both Build and Eventing.

There are a handful of changes here:
1. Move MustNewStatsReporter into knative/pkg
2. Expose the current interface as NewImplWithStats
3. Drop the StatsReporter from NewImpl and default to `MustNewStatsReporter()`

This is a breaking change for downstream repositories, but should make their callsites universally simpler.
2019-05-28 13:16:31 -07:00
Yanwei Guo b4a3bde045 Decide whether to record metrics according to current metrics config (#292)
* split and update

* bug fixed

* change the copyright year

* use fake metadata in tests

* exclude test coverage for gcp_metadata

* add record

* add tests

* revert 2019 and add a new var

* change documents

* address comment

* change line
2019-03-07 10:26:42 -08:00
Mustafa Demirhan 53b1235c2a Use different reporting periods based on the metrics backend (#182)
* Use different reporting periods based on the metrics backend. Original implementation was setting this value to 1 min to accommodate the minimum allowed value for stackdriver, but that is a sub optimal behavior for Prometheus. The change also allows operator to override the default values.

* Fix the units of reconciler latency from nano seconds to milliseconds.

* Address PR comments.

* Add better logging for reconciliation.

* Remove unnecessary lock in the UT.

* Address PR comments.
2018-12-04 15:16:25 -08:00
Mustafa Demirhan 6c3ae54dda Add reconciler metrics (#127)
* Add reconciler metrics for queue depth, reconcile count & reconcile latency.

* Update deps.

* Change queue depth measurement type to int64 from float64

* Address PR comments

* Add extra unit tests.

* Minor fixes.

* Address PR comments by adding extra documentation

* Add tests for testing/fake_stats_reporter

* Addressed PR comments.

* Address PR comments.
2018-10-22 14:34:30 -07:00