-
Couldn't load subscription status.
- Fork 1k
Description
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
In influxdata/influxdb#25911, we are discussing ways to record trace spans that distinguish between two key code paths in an implementation of ObjectStore that either retrieves objects from an object store or from a local in-memory cache. The problem we have right now is that our ObjectStore implementation has no way to receive span info passed in from the calling context.
Describe the solution you'd like
This issue is proposing the following:
- Add a new
Sessiontrait to theobject_storecrate similar to what exists in thedatafusion::catalog- This would have a single method that returns a session config similar to
datafusion::prelude::SessionConfig- This session config would have similar
set_extension,with_extension, andget_extensionmethods that allow storing and retrievingArc<dyn Any + Send + Sync + 'static>instances by type ID
- This session config would have similar
- This would have a single method that returns a session config similar to
- Add a new set of methods to the
ObjectStoretrait take&dyn Sessionas a parameter- eg
fn get_with_session(&self, session: &dyn Session, location: &Path) - these methods could have default impls that delegate to the corresponding existing method (eg
get_with_sessionwould just ignore the session parameter and callgetby default) to avoid forcing existing implementers to change
- eg
This would allow me to do some refactoring in https://github.com/influxdata/influxdb/ and https://github.com/influxdata/influxdb3_core/ that would result in passing a &dyn Session with a properly-parented child span and a custom *_with_session defined in impl ObjectStore for MemCachedObjectStore -- resulting in trace spans properly contextualized in the hierarchy of a given query which also differentiate between calls that result in cached vs object store parquet file retrieval.
Describe alternatives you've considered
I've considered:
- Using simple metrics to capture the high-level (ie not contextualized within a trace span hierarchy) difference between object store and cached parquet file retrievals.
- Doesn't help us identify when poor query performance is caused by cache misses
- Setting up
MemcachedObjectStorewith its own root hierarchy of spans- Also doesn't help us identify when poor query performance is caused by cache misses
Additional context