traceAI-firecrawl
OpenTelemetry instrumentation for the Firecrawl v2 client.
v1 and v2 are different clients
firecrawl-py 4.x ships two clients. The v2 client is from firecrawl import Firecrawl (and AsyncFirecrawl), and it delegates scrape, search, map, and the crawl methods to firecrawl.v2.client.FirecrawlClient (and firecrawl.v2.client_async.AsyncFirecrawlClient). The v1 client is FirecrawlApp, and it is feature-frozen.
This package wraps the v2 client only. It does not wrap FirecrawlApp, and it does not import or disable OpenLIT. OpenLIT's FireCrawlInstrumentor wraps FirecrawlApp.scrape_url on the v1 client. A user who constructs both clients and enables both instrumentors gets two spans. Pick one.
Installation
pip install traceAI-firecrawl
Supported versions
firecrawl-py >=4.46.2,<5 on Python 3.10, 3.11, 3.12 and 3.13. The tests run on firecrawl-py==4.46.2. Outside that range instrument() logs an error and wraps nothing.
Usage
from firecrawl import Firecrawl
from fi_instrumentation import register
from fi_instrumentation.fi_types import ProjectType
from traceai_firecrawl import FirecrawlInstrumentor
tracer_provider = register(project_name="firecrawl", project_type=ProjectType.OBSERVE)
FirecrawlInstrumentor().instrument(tracer_provider=tracer_provider)
# Construct the client after instrument(); see "Client construction order".
client = Firecrawl(api_key="your-firecrawl-api-key")
client.scrape("https://example.com")
What it records
Each call to scrape, search, map, crawl, start_crawl, get_crawl_status or cancel_crawl, sync or async, emits one span named firecrawl.<method>. gen_ai.span.kind is RETRIEVER for search and TOOL for the others, which fetch the pages they are given. A blocking crawl() is one span for the whole call: not one per page and not one per status poll. When the async crawl() calls start_crawl() internally, that inner call adds no span. The span is current while the SDK runs, so HTTP client spans nest under it.
| Attribute | Methods | Value |
|---|---|---|
server.address |
scrape, map, crawl, start_crawl |
Host of the target URL. Never the path or query. |
gen_ai.retrieval.query, input.value |
search |
The query, with the API key redacted, capped at 1024 characters. Omitted with hide_inputs or hide_input_text; shared PII redaction applies when enabled. |
firecrawl.result_count |
search |
Total returned records across SDK web, news, images and tools groups. Known empty groups count as zero; unknown or malformed shapes omit the attribute. |
firecrawl.formats |
scrape, search, crawl, start_crawl |
Bounded, deduplicated canonical SDK format names from formats= or scrape_options.formats. Unknown names, prompts and schemas are omitted. Snake-case aliases use the SDK's API spelling. |
firecrawl.job_id |
crawl, start_crawl, get_crawl_status, cancel_crawl |
The crawl job id, positional or keyword. The start, status and cancel spans of one job share it. |
firecrawl.limit |
crawl, start_crawl |
The limit argument, when passed. |
firecrawl.page_count |
crawl |
Pages the job completed. |
firecrawl.status |
crawl, get_crawl_status |
Job status from the response (scraping, completed, failed, cancelled). |
firecrawl.cancelled |
see "Status" | true when the job or the call was cancelled. |
firecrawl.credits_used |
any method whose result carries it | Credits the response reports. Not converted to dollars. |
firecrawl.error.status_code, firecrawl.error.code |
any, on a Firecrawl API error | HTTP status and the vendor's machine-readable error code, when present. |
firecrawl.credits_used caveat: for crawl jobs, firecrawl-py fills credits_used with 0 when the API response omits creditsUsed, so a recorded 0 on crawl or get_crawl_status can mean either "no credits" or "not reported".
Format metadata follows SDK 4.46.2's payload: scrape_options takes precedence over convenience formats. A ScrapeFormats container contributes its explicit list and serialized enabled flags, including its default markdown=true. The SDK does not serialize its images or json boolean flags, so those flags add no metadata; explicit format entries still do.
Search counts include tools because SDK 4.46.2 returns a list of DiscoveredTool discovery records, alongside web/news/image records. The count includes those records, not pages fetched by a tool. The prior generic data/results/web list fallback remains supported; no result contents are exported.
Status
- The SDK returns a failed or cancelled crawl job without raising. On a blocking
crawl(), a job with statusfailedsets the span to ERRORfailed, and a job with statuscancelledsets ERRORcancelledandfirecrawl.cancelled=true. Aget_crawl_statuspoll that gets an answer stays OK and records the job's state infirecrawl.status. cancel_crawlsetsfirecrawl.cancelledto the API's answer; the span itself is OK.- Cancelling an asyncio task that is awaiting a Firecrawl call ends the span ERROR
cancelledwithfirecrawl.cancelled=true. - Any exception the SDK raises adds one safe exception event and sets ERROR with a recognized exception type (otherwise
Exception). Exception free text and serialized tracebacks are omitted; the original exception is re-raised unchanged.
What it never records
This package has no content-capture setting. It never records page content (markdown, HTML, screenshots, links, titles, descriptions), URL paths or query strings, JSON-format prompts or schemas, or the Firecrawl API key. The key is redacted from every attribute the package sets, including a key taken from FIRECRAWL_API_KEY. The search query is recorded by design. Error events contain a safe type and generic message; status descriptions contain that type or cancelled. Only HTTP status and recognized machine codes are retained from API errors; unknown codes are omitted.
Instrumentation errors never reach your code: if reading an argument or a result fails, the call still returns the SDK's result or raises the SDK's exception, and the span still ends.
Pass config=TraceConfig(...) from fi_instrumentation.instrumentation to instrument() to use shared privacy controls. None creates TraceConfig() using its FI_* environment settings; other objects raise TypeError. hide_inputs or hide_input_text omits the search query. pii_redaction (or FI_PII_REDACTION=true) applies the shared regex redactor to query text before truncation, followed by FITracer attribute masking. Other message, image and output hide flags are not applicable because no messages or page bodies are exported. Shared suppress_tracing() emits no Firecrawl spans, and using_session() supplies the shared session attribute. If API-key discovery fails, free-text attributes are omitted while safe format/count metadata remains. Error events and status use the separate safe metadata policy described above.
Client construction order
Firecrawl and AsyncFirecrawl copy the v2 client's methods when they are constructed. Call instrument() before you construct them:
- A client constructed before
instrument()is not traced. - A client constructed while instrumented stops tracing at
uninstrument().
FirecrawlClient and AsyncFirecrawlClient used directly look the methods up on every call, so they follow instrument() and uninstrument() immediately.
Watchers
Firecrawl.watcher() returns a Watcher that polls get_crawl_status from its own thread. Each poll is a separate root firecrawl.get_crawl_status span with no parent, and a poll error the watcher swallows still shows as an ERROR span. AsyncFirecrawl.watcher() polls in the task that iterates it, so its poll spans are children of the span current there.
Live vendor verification (2026-10-17)
Run as documented above against the real api.firecrawl.dev with firecrawl-py 4.50.0 and fi-instrumentation-otel 1.1.0 on Python 3.12, exporting to Future AGI. scrape, search, map, start_crawl, get_crawl_status, cancel_crawl and a blocking crawl each produced one span under an AGENT parent (fi_verify PASS, trace fc0dbe7b-cf70-494e-a5ed-d3b06b91e4df). A wrong key ended the span ERROR UnauthorizedError (HTTP 401), and a free-plan HTTP 429 ended start_crawl ERROR RateLimitError (trace 0e189c43-63d1-4420-b7c1-42bdb92dbca5). A scan of every stored column found no page content, URL path or query string, or API key; FI_HIDE_INPUTS=true removed the search query. The async client, watcher() and failed or cancelled job statuses were not run live and are covered by the test suite only.
Metadata
Release files for traceAI-firecrawl 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_firecrawl-0.1.0.tar.gz | 14.0 kB | Without provenance | Details for traceai_firecrawl-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| traceai_firecrawl-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for traceai_firecrawl-0.1.0-py3-none-any.whl |
Total release size: 26.8 kB
Release files / traceai_firecrawl-0.1.0.tar.gz
| Download URL | traceai_firecrawl-0.1.0.tar.gz |
|---|---|
| Size | 14.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a35c9d3de9e83f35090c146c62c6d196a1f21536d233d9630900f02983934491
|
|
BLAKE2b-256 checksum How to use checksums |
c784f8ce620d8d2d91bfac14f3cb37d1049579f67115ea938de2af3764c0b8d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / traceai_firecrawl-0.1.0-py3-none-any.whl
| Download URL | traceai_firecrawl-0.1.0-py3-none-any.whl |
|---|---|
| Size | 12.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1dcb41b59db075f494e98990bd45c9a42da7ba2c69abfe57c2c61a83606f8c18
|
|
BLAKE2b-256 checksum How to use checksums |
2471a5f1811f5115cd3056839c364e3a809caf44d44e370e0218602920584c9f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Security for traceAI-firecrawl 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.