mirror of https://github.com/knative/pkg.git
				
				
				
			Add a passthrough method RegisterResourceView (#1410)
* Add a passthrough method RegisterResourceView * gofmt * Update metrics/exporter.go Co-authored-by: Evan Anderson <evan.k.anderson@gmail.com> * Address comments Co-authored-by: Evan Anderson <evan.k.anderson@gmail.com>
This commit is contained in:
		
							parent
							
								
									d289d2eef6
								
							
						
					
					
						commit
						e366b8278b
					
				|  | @ -85,6 +85,26 @@ func UpdateExporterFromConfigMap(component string, logger *zap.SugaredLogger) fu | ||||||
| 	return ConfigMapWatcher(component, nil, logger) | 	return ConfigMapWatcher(component, nil, logger) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | // RegisterResourceView is similar to view.Register(), except that it will
 | ||||||
|  | // register the view across all Resources tracked by the system, rather than
 | ||||||
|  | // simply the default view.
 | ||||||
|  | // this is a placeholder for real implementation in https://github.com/knative/pkg/pull/1392.
 | ||||||
|  | // That PR will introduce a breaking change, as we need to convert some view.Register to RegisterResourceView in
 | ||||||
|  | // all callers, in serving, eventing, and eventing-contrib.
 | ||||||
|  | // Since that PR is huge, a better approach is to introduce the breaking change up front, by creating this
 | ||||||
|  | // passthrough method, and fixing all the callers before merging that PR.
 | ||||||
|  | func RegisterResourceView(views ...*view.View) error { | ||||||
|  | 	return view.Register(views...) | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | // UnregisterResourceView is similar to view.unRegister(), except that it will
 | ||||||
|  | // unregister the view across all Resources tracked by the system, rather than
 | ||||||
|  | // simply the default view.
 | ||||||
|  | // this is a placeholder for real implementation in https://github.com/knative/pkg/pull/1392.
 | ||||||
|  | func UnregisterResourceView(views ...*view.View) { | ||||||
|  | 	view.Unregister(views...) | ||||||
|  | } | ||||||
|  | 
 | ||||||
| // ConfigMapWatcher returns a helper func which updates the exporter configuration based on
 | // ConfigMapWatcher returns a helper func which updates the exporter configuration based on
 | ||||||
| // values in the supplied ConfigMap. This method captures a corev1.SecretLister which is used
 | // values in the supplied ConfigMap. This method captures a corev1.SecretLister which is used
 | ||||||
| // to configure mTLS with the opencensus agent.
 | // to configure mTLS with the opencensus agent.
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue