datafusion icon indicating copy to clipboard operation
datafusion copied to clipboard

Add and expose metrics in ObjectStore Trait

Open mingmwang opened this issue 3 years ago • 1 comments

Is your feature request related to a problem or challenge? Please describe what you are trying to do. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] (This section helps Arrow developers understand the context and why for this feature, in addition to the what)

The current ObjectStore Trait and implementations do not collect and expose any metrics. Add some metrics like read/write/delete ops counts, scan bytes, elapse times etc and expose them will be very useful in the production environment.

Describe the solution you'd like A clear and concise description of what you want to happen.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

mingmwang avatar Aug 03 '22 04:08 mingmwang

One way to do this might be to implement a wrapper around an inner Arc<dyn ObjectStore> interface that had metrics.

Much like https://github.com/apache/arrow-rs/blob/master/object_store/src/limit.rs or https://github.com/apache/arrow-rs/blob/master/object_store/src/throttle.rs

BTW I plan to release a new object_store release (from arrow-rs) mid next week

Something like

struct TracingObjectStore {
  inner: Arc<dyn ObjectStore>
}

impl ObjectStore for TracingObjectStore { 
 fn get(&self) { 
   // add whatever tracing is needed
   self.inner.get()
  }
...
}

alamb avatar Aug 03 '22 13:08 alamb