* Add metrics to webhook package
Add metricstest package for shared helper functions for testing metrics
* Address PR
* Cleanup
* Fix import paths to fix build issues
* Fix import package path for test file
* Remove unnecessary formatting from error message
* Remove helper function only used once
* Add metric name to all error messages, make checkRowTags testing helper function
* Add common histogram bucket generator function to metrics package
* Fix CheckStatsNotReported check
* Reset metrics before each test so the tests are idempotent
* Make CheckStatsNotReported conditional clearer
* 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
* split and update
* bug fixed
* change the copyright year
* use fake metadata in tests
* exclude test coverage for gcp_metadata
* revert 2019 change on existing files
* Some fixes to the spoof.go and exporter.go
While reviewing some other CL, I saw some avenues for improving
spoof.go, to log the URL that's being fetched, which would help in test
debugging and to use switch construct, rather than nested if's.
While testing the change, I noticed some shifty loggin from the
exporter, so I fixed that as well while I was there.
* Continuation of the previous cleanups.
* 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.
* fix flaky test
* relax the requirement for stackdriver project id
* improve log
* add comment for stackdriverProjectIDKey not provided case
* minor format
* simplify the map access
* update dep golang.org/x/net
* Add stackdriver exporter support in pkg
* fix race and tests
* Use thread safe newMetricsExporter in tests
* address cr comments
* minor fix
* checkpoint
* Address cr comments
* add test for UpdateExporterFromConfigMap
* Move lock position
* add a test case for stackdriver error check
* minor change
* removing one test case since it seems app default creds exists for presubmit tests
* replace promSrvChan with promSrv as cr suggsted
* use a local var server for ListenAndServe
* add getter and setter for shared variables
* add func isMetricsConfigChanged and test
* address cr comments
* Update opencensus-go-exporter-stackdriver to v0.7.0
* Revert "Update opencensus-go-exporter-stackdriver to v0.7.0"
This reverts commit 9825f641f8.
* run update-deps.sh
* merge conflict
* run update-deps.sh
* Update Gopkg.toml so it doesn't have stackdriver exporter
* remove regex for metrics domain at pkg repo per cr comments
* merge conflict