Skip to main content

traceAI-promptflow

OpenTelemetry instrumentation for Microsoft Prompt flow (promptflow-tracing, promptflow-core; import promptflow).

pip install traceAI-promptflow
from fi_instrumentation import register
from traceai_promptflow import PromptflowInstrumentor

PromptflowInstrumentor().instrument(tracer_provider=register(project_name="my-project"))

# then run flows or call @trace functions as usual

With fi-instrumentation-otel auto-instrumentation the promptflow integration is enabled whenever promptflow is installed.

Prompt flow ships with tracing off (PF_DISABLE_TRACING defaults to true). instrument() turns it on unless the variable is already set, and uninstrument() puts it back. Setting PF_DISABLE_TRACING=true yourself keeps Prompt flow tracing disabled.

What is traced

Prompt flow already opens a span for each @trace function, DAG node or tool and flow run (flex and DAG). This instrumentor routes those spans through traceAI instead of the global tracer provider:

  • the flow run, or an outermost @trace function, is a CHAIN span; nodes and nested @trace functions are child TOOL spans (gen_ai.tool.name is the function name). Calls made through Prompt flow's OpenAI integration are LLM spans with the response model and token usage; embedding vectors are never exported. gen_ai.provider.name is promptflow on every span;
  • sync, async and generator results; a generator span ends on exhaustion, error, close() or when the generator is dropped. An early end is marked promptflow.stream.incomplete;
  • errors are re-raised unchanged and recorded as ERROR with error.type (the class name); the message and traceback are never exported;
  • inputs and outputs are exported as input.value / output.value and follow the TraceConfig hide settings. Prompt flow's own inputs, output, prompt.template, prompt.variables and promptflow.* events are never exported, whichever Prompt flow code path writes them (for example a Prompty call): the span drops them, so hiding works for them too. If an installed Prompt flow version lacks a content hook this package patches, one warning is logged and the content stays masked; if it lacks start_as_current_span, nothing is instrumented;
  • LLM and embedding spans carry gen_ai.request.model and the request parameters (temperature, top_p, max tokens, penalties, seed, stop) when the call's inputs include them;
  • a failure inside the instrumentation never reaches your call.

PF_DISABLE_TRACING=false is set process-wide, so child processes inherit it, but the patches are not: a worker process has to call instrument() itself.

Limits: the patches live in the instrumenting process. Prompt flow batch runs that execute lines in worker processes, and the serving /feedback endpoint (which opens its own span on the global tracer provider), are not covered, so their spans do not follow the TraceConfig hide rules.

Do not also instrument the OpenAI SDK for the calls Prompt flow already traces: you would get a second LLM span for each.

Supported SDK range: promptflow-tracing >= 1.12.0, < 2.

Metadata

Release files for traceAI-promptflow 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for traceAI-promptflow 0.1.0
File Size Uploaded Provenance Actions
traceai_promptflow-0.1.0.tar.gz 8.0 kB Without provenance Details for traceai_promptflow-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for traceAI-promptflow 0.1.0
File Interpreter ABI Platform Actions
traceai_promptflow-0.1.0-py3-none-any.whl Python 3 none any Details for traceai_promptflow-0.1.0-py3-none-any.whl

Total release size: 17.0 kB

Release files / traceai_promptflow-0.1.0.tar.gz

Download URL traceai_promptflow-0.1.0.tar.gz
Size 8.0 kB
Tags Source
SHA-256 checksum
How to use checksums
de9d7691542e8197b793068e2bc190d5b0990e26e1f651f44a91ab2eb016f4e8
BLAKE2b-256 checksum
How to use checksums
73fa66815a5291b679b02ca817ee098bb3cf9a1d8225505c78a52234b066c28d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / traceai_promptflow-0.1.0-py3-none-any.whl

Download URL traceai_promptflow-0.1.0-py3-none-any.whl
Size 9.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
269b65413c1633078eaf645728094cdfaf1a5164cd1ca4465de6ecbbbc0f0219
BLAKE2b-256 checksum
How to use checksums
740763d35367ce1463e305a96d8186782f99f756abd84e1394f062290dbf80eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for traceAI-promptflow 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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page