respan-instrumentation-lancedb
Trace embedded LanceDB connection, table, merge and query execution as Respan
task spans with native database operation and collection attributes. Tested
against LanceDB 0.20.0 and 0.40.0 with released tracing dependencies.
pip install respan-instrumentation-lancedb lancedb pandas
from tempfile import TemporaryDirectory
import lancedb
from opentelemetry.sdk.trace import TracerProvider
from respan_instrumentation_lancedb import LanceDBInstrumentor
provider = TracerProvider()
instrumentor = LanceDBInstrumentor()
instrumentor.activate(tracer_provider=provider)
try:
with TemporaryDirectory() as directory:
db = lancedb.connect(directory)
table = db.create_table("documents", [{"vector": [0.1, 0.2], "text": "hello"}])
print(table.search([0.1, 0.2]).limit(1).to_list())
finally:
instrumentor.deactivate()
provider.shutdown()
Supply your provider/exporter or load the lancedb Respan instrumentation plugin.
Activation is idempotent and shared across instrumentor instances with matching
configuration. capture_content=False, Respan/Traceloop context flags, both
suppression flags, and RESPAN_TRACE_CONTENT/TRACELOOP_TRACE_CONTENT environment
vetoes prevent payload capture. A veto cannot subsequently widen, including
observed active/finished ancestors. Unknown local ancestors fail closed.
Supported execution includes connection create/open/drop/list; table
add/update/delete, indexes and optimize; merge execution; and native vector,
scan, full-text, hybrid and take query to_list, to_arrow, to_pandas,
explain_plan and to_batches. Search/merge builder construction and modifiers
retain their native synchronous/async behavior and do not emit execution spans.
Async merge's synchronous public execute dispatch remains native; its awaited
AsyncTable._do_merge boundary records the actual result. Internal SDK nesting
emits one operation span. Existing deprecated convenience methods retain native
warnings; current LanceDB recommends create_index(config=...) and list_tables.
Full known builtin JSON, numpy vectors, native Arrow tables/batches/schema,
native result fields and ordinary numpy/primitive-Arrow-backed pandas results are retained.
Arrow schema/field metadata is retained in owned capture-gated
respan.metadata.lancedb.request / respan.metadata.lancedb.result alongside
complete canonical rows.
There are no item/vector/text limits. Credential values are redacted, including
quoted authorization strings, JSON arguments and URL credentials; schema
property names survive with sensitive defaults redacted. Unknown classes,
customer Arrow extension types and custom dataframe blocks are represented by
structural type information; instrumentation does not call their getters or
conversion hooks. It does not consume write iterators, evaluate a reranker, call
an embedding service, infer token usage/models, or manufacture HTTP statuses or
error-as-output values. Recorded errors come from the native operation.
Sync to_batches returns the exact native C pyarrow.RecordBatchReader with its
original identity, Arrow interoperability, iteration, read_all,
read_next_batch, close and context-manager behavior. Its creation span records
structural reader output and finishes when the native method returns. Lazy rows
and errors after that return are not observed: telemetry never drains or
replaces that reader. Use to_arrow/to_list to record complete sync results.
Async to_batches retains the native AsyncRecordBatchReader type and identity,
with an owned private iterator tap that records only batches the caller consumes.
Its span finishes at exhaustion, deactivation or garbage collection without
closing caller-owned resources. The native reader has no public close/aclose
API. Partial consumption records consumed batches when finalizing; unread readers
have no invented output. Native batch-size hints and default limits are preserved
(0.20.0 scan defaults differ from 0.40.0). Builder parameters created before
activation are available only where the SDK exposes safe Python storage; opaque
Rust query settings are not retrieved by extra SDK calls. The SDK's own span
attribute-count limit can bound convenience metadata; full canonical I/O is
written last.
The compatible examples in python/tracing/lancedb run the real local engine
with local OTel recording by default. RESPAN_EXAMPLE_EXPORT=1 explicitly exports
to Respan; embedded operations need no provider key or production service calls.
Remote/cloud-specific SDK classes and embedding provider integrations are outside
this package's observed boundary.
The minimum test profile uses Arrow 17.0.0 with LanceDB 0.20.0. Arrow 14.0.1,
which that SDK declares compatible, fails bare native vector creation because
its RecordBatch.set_column API is absent; this is a vendor dependency limit,
not a tracing replacement or alias workaround.
Metadata
Release files for respan-instrumentation-lancedb 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| respan_instrumentation_lancedb-0.2.0.tar.gz | 18.0 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| respan_instrumentation_lancedb-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 37.0 kB
Release files / respan_instrumentation_lancedb-0.2.0.tar.gz
| Download URL | respan_instrumentation_lancedb-0.2.0.tar.gz |
|---|---|
| Size | 18.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e727fcc83cc91e9be039de8514fec78f05a200c41be8aeb78baf1b2a1fdd191e
|
|
BLAKE2b-256 checksum How to use checksums |
8462c7b89edc68edb08de616b6e7eaa76c4e160fa0420c6dadf21edea31131e2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.
Transparency logRelease files / respan_instrumentation_lancedb-0.2.0-py3-none-any.whl
| Download URL | respan_instrumentation_lancedb-0.2.0-py3-none-any.whl |
|---|---|
| Size | 19.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ef0c1034051715ecf6d61a66f888b6be9fec2fa542d216353362591069227f09
|
|
BLAKE2b-256 checksum How to use checksums |
4b55ae206b29435a58401fc80c78f274ebf3f32b61b0a8d87a0858cd99719710
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.
Transparency logSecurity for respan-instrumentation-lancedb 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for respan_instrumentation_lancedb-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.