[DataLoader] Add performance observability with tags/metrics separation#540
Open
sumedhsakdeo wants to merge 2 commits intolinkedin:mainfrom
Open
[DataLoader] Add performance observability with tags/metrics separation#540sumedhsakdeo wants to merge 2 commits intolinkedin:mainfrom
sumedhsakdeo wants to merge 2 commits intolinkedin:mainfrom
Conversation
Add a pluggable PerfObserver pattern to instrument data loader stages (iter, split_iter, resolve_snapshot, build_transform_sql, apply_transform, create_transform_session, catalog.load_table) with duration tracking and typed attributes split into tags (dimensions) and metrics (values) for compatibility with Prometheus/OTEL/Kafka backends. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
273dddc to
ef2fa9b
Compare
…vability PerfConfig is a frozen, pickle-safe dataclass that carries session-level tags, observer type, and observer kwargs through TableScanContext to remote workers. bootstrap_observer() performs idempotent worker-side setup, and EnrichingObserver wraps any observer to prepend session tags to every event. This enables lipy-openhouse to inject cluster/tenant tags and custom observers without subclassing or process-global state. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PerfObserverpattern for performance instrumentation of the data loader_observability.pymodule withPerfEvent,PerfObserverprotocol,NullPerfObserver,LoggingPerfObserver,CompositeObserver, andperf_timercontext managerPerfEventseparatestags(low-cardinality dimensions) frommetrics(measured values) for Prometheus/OTEL/Kafka compatibilitydataloader.iter,dataloader.split_iter,dataloader.resolve_snapshot,dataloader.build_query,dataloader.apply_transform,dataloader.create_transform_session,catalog.load_tableLoggingPerfObserver(DEBUG level toopenhouse.dataloader.perf), auto-set on firstOpenHouseDataLoadercreation unless a custom observer is already configuredset_observer()bridges topyiceberg.observability.set_observer()when availableWhy a separate
_observability.pyinstead of importing from pyiceberg?The dataloader's
_observability.pyis intentionally independent frompyiceberg.observability(li-iceberg-python#52). The two modules share the same design (PerfEvent/PerfObserver/perf_timer) but are not coupled because:openhouse.dataloader.perfwhile pyiceberg logs topyiceberg.perf, keeping the two layers distinguishable in log output.set_observer()in the dataloader forwards topyiceberg.observability.set_observer()when available, so a single call enables both layers without a hard import dependency.observability.pyin a released version, the dataloader module can be reduced to a thin re-export + bridge. ThePerfEvent/PerfObservercontracts are identical by design to make this migration straightforward.Test plan
make verify)🤖 Generated with Claude Code