Go 1.17 introduced a new handy API for setting env vars scoped for
a single test so we can avoid the hard to read set and reset env
loops.
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
* drop stack driver as a tracing backend
* drop stackdriver as a metrics backend
* update deps - dropping stackdriver
* fix linting issues
* drop further references to stack driver
* drop serving & eventing metric key constants
these have been moved to their respective repos
see: https://github.com/knative/pkg/issues/608
* move source metrickeys to pkg/source
We're going to move the StatsReporter downstream eventually
related:
https://github.com/knative/eventing/pull/5587https://github.com/knative/eventing/pull/5586
* fix linter
* Set reporting period for all meters
* using switch statement to simplify
* Change 60 seconds to a minute
* Add a test case for openCencus customed reporting period
* Make updating metricsConfig and updating metricsExporter atomic
This requires doing anything with a kubeclient before obtaining the
metricsMux lock.
* Address PR
* Add support for OpenCensus Agent as a destination for Knative metrics.
* Update with comments from @mattmoor and @anniefu
* Remember to register exporter.
Fix tests.
* Fix naming per discussion with @anniefu
* marking the metrics as internal as we need to pre-process them to include
pod_name and container_name...
* removing eventSource
* updates
* rollbacking changes to source
* updating changes to source
* minimizing change
* minimizing change
* Restrict Stackdriver Secret to controlled name & namespace
* Address PR comments
* Lock when reading secret name & namespace
* Export StackdriverClientConfig struct so consumers don't have to
redefine it
* Ensure metrics pkg consumers call SetStackdriverSecretLocation to set
Secret name and namespace
* Export StackdriverClientConfig consts & helper function
* Add TODO for secret watcher
* Add field to metrics config for configuring Stackdriver exporter client
options
* Fix test setting global state and interfering with other tests
* Use correct GCP metadata values & cleanup
* Some code cleanup
* Remove as much test-specific function stubbing as possible
* Remove more stubbed out test code
* Make more descriptive error when getting secret
* Use former locking pattern to avoid deadlock
There is a cyclical dependency between the metrics pkg and client-go
kubeclient where the kubeclient will attempt to read the metricsConfig
to record metrics about kubeclient requests. This prevents using a kubeclient within the metricsMux lock.
* Remove race condition between reading updates to config-observability
and updating stackdriver exporter
* Simply isNewExporterRequired if statement
* Remove unused thread-safe versions of functions
* Use a reader-writer lock & add function comment
* Make internal unlocked function names consistent
* renaming source_name and source_resource_group to name and resource_group,
as they will be used in other resources
* updating
* updates based on code review
* update
* fix
* source stats reporter... should be used by well-behaved sources
* public fields
* moving serialization/deserialization of metrics and logging maps to pkg
* nits
* adding UT
* same order
* updates
* sock-puppet
* unregistration problem?
* removing base64 encoding
* removing TODO
* comments after review
* removing the other constants
* 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
* 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