Marqo Python SDK tracing
Trace calls made through the marqo Python SDK with the maintained traceAI-marqo package. It supports marqo 3.5.0 up to, but not including, 4.0.
pip install traceAI-marqo
Set FI_API_KEY and FI_SECRET_KEY (and MARQO_API_KEY for Marqo Cloud) in your environment. Then:
import os
import marqo
from fi_instrumentation import register
from fi_instrumentation.fi_types import ProjectType
from traceai_marqo import MarqoInstrumentor
provider = register(project_type=ProjectType.OBSERVE, project_name="marqo-demo")
MarqoInstrumentor().instrument(tracer_provider=provider)
client = marqo.Client(url="http://localhost:8882", api_key=os.environ.get("MARQO_API_KEY"))
index = client.index("products")
index.add_documents([{"_id": "1", "title": "red running shoes"}], tensor_fields=["title"])
print(index.search("shoes", limit=3)["hits"])
provider.force_flush()
With the fi-instrument launcher or FI_INSTRUMENTATIONS, no code is needed: importing marqo turns this integration on.
Covered calls (marqo.index.Index; the SDK is synchronous and has no streaming calls, so there are no async or stream spans):
| Span | Kind | Records |
|---|---|---|
marqo.search |
RETRIEVER | query, limit as top-k, search parameters, hit count, ids, scores, document content |
marqo.add_documents |
CHAIN | document count, batch and tensor-field parameters, documents, whether any item failed |
marqo.get_documents / marqo.get_document |
RETRIEVER | found-document count, ids, document content |
Every span has gen_ai.provider.name and db.system set to marqo, the operation, and the index name (db.vector.index.name, db.namespace). Only the outermost SDK call is traced. Exceptions set the span status to ERROR and error.type, and are re-raised unchanged; server error messages and stacks are never exported.
Embedding vectors are never exported: numeric arrays and vector fields are replaced in document content, and _highlights, _tensor_facets, context and other underscore fields, mappings and request headers are not captured. Query text, documents and result content are captured by default, capped, and removed by TraceConfig(hide_inputs=True, hide_outputs=True) passed to instrument(config=...); the directional hide_input_* and hide_output_* flags also suppress the corresponding content. Do not instrument requests for the same calls, or you will get duplicate spans. The package does not send requests to Marqo on its own.
Metadata
Release files for traceAI-marqo 0.1.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 | Actions |
|---|---|---|---|---|
| traceai_marqo-0.1.0.tar.gz | 5.3 kB | Without provenance | Details for traceai_marqo-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| traceai_marqo-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for traceai_marqo-0.1.0-py3-none-any.whl |
Total release size: 11.3 kB
Release files / traceai_marqo-0.1.0.tar.gz
| Download URL | traceai_marqo-0.1.0.tar.gz |
|---|---|
| Size | 5.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
07819f7d6d27d5e8a23000f4a93afe7f39624b38327988fb3147a410fb5c8edf
|
|
BLAKE2b-256 checksum How to use checksums |
195661b4a660fe1a4144c07033bdbb7f47e6c71962ec888bf777911b7ba09763
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / traceai_marqo-0.1.0-py3-none-any.whl
| Download URL | traceai_marqo-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
256193ec67ffa03588debdf75f2211ac89a427fbcf5596e0c233d8b95325a040
|
|
BLAKE2b-256 checksum How to use checksums |
9906142138acb869e930c396891b774d70c57447d5105de4fe2a8a6af314f8b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Security for traceAI-marqo 0.1.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.