pypi / monocle-apptrace
monocle-apptrace
What changed in monocle-apptrace 0.6 to 0.8, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
18 breaking5 security2 deprecations137 new APIs and options1 performance35 behavior and defaults15 tooling76 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initmonocle-apptrace 0.8194 changes
Breaking changes 14
Span obfuscation replaces inline images, audio, and PDFs with their type and size instead of exporting encoded media verbatim.
Only hosts named in this setting are traced for httpx traffic.
MS Agent Framework agents hosted on Azure AI Foundry now produce complete traces, identify Foundry as their host, and have spans retrievable from Okahu.
setup_test_casesrefuses discovery windows larger than this limit instead of silently truncating them; the value comes from the argument, thenOKAHU_MAX_FACTS, then defaults to 1000.Turn spans now record prompt text using the renamed
contentsfield instead of an object representation; the fallback also avoids exporting object reprs.AWS Bedrock AgentCore trace return now authorizes callers before returning spans; deployments must configure this key or a retrieval callback, and invocations must present the matching retrieval key.
The eval-result matrix no longer has a top-level claim_verdicts column; read it from judge_output instead.
The eval-result matrix no longer has an entity_match_check column.
The eval-result matrix no longer has a hallucination_types column.
The eval-result matrix now stores the judge's structured output verbatim in judge_output; read claim_verdicts from row["judge_output"]["claim_verdicts"].
Requires an explicit bucket or container name when using cloud exporters.
Changes the scope name from agent.invocation to agentic.invocation on invoke, ainvoke, stream, and astream paths.
Replaces MONOCLE_S3_KEY_PREFIX as the S3 file prefix variable.
The S3 prefix variable was renamed to MONOCLE_S3_FILE_PREFIX.
Security 5
A credential named by its payload key, such as api_key, is redacted even when its value lacks recognizable credential text.
If configured obfuscators cannot be loaded, the built-in credentials obfuscator is used rather than silently disabling obfuscation.
Span obfuscation now recognizes and redacts Okahu API keys passed positionally as well as by name.
Sensitive data in
data.inputanddata.outputis scrubbed before spans reach exporters; obfuscation is on by default and covers common credentials and secrets.Exclude a traced method's inputs and/or outputs so sensitive values are not serialized; excluded-output spans still record error_code.
Deprecations 2
Use this renamed environment variable to configure the S3 key prefix; the old name still works with a deprecation warning.
This name is deprecated in favor of MONOCLE_S3_FILE_PREFIX, but still works with a warning.
New APIs and options 89
Set this to have the A2A runner pull agent spans from Okahu; when unset, it reads the agent's trace file.
Provides the same trace propagation to an agent that calls another agent over A2A.
Group chat and Magentic orchestrations emit routing agentic.invocation spans when the package is installed, including the routed message as input.
Workflow spans identify Vertex AI Agent Engine as the app host and report its full resource name, or the bare engine id when project or location is unset.
Asserts that any named agent was invoked, with optional count constraints across the matched agents.
Asserts that any named tool was invoked, optionally scoped to an agent, with count constraints across the matched tools.
Returns spans a service returned for requests and httpx, including cases where an SDK owns the response.
Asserts that none of the named agents ran; a call to any candidate fails the assertion.
Asserts that none of the named tools ran; a call to any candidate fails the assertion.
Enables logging every scenario-test result to a timestamped file under .monocle/test_results; off by default.
Set to true to log every scenario-test result to a timestamped file under .monocle/test_results; off by default.
Generates multi-turn test conversations from an agent description and goals, including varied users, refusal requests, and red-team attacks.
When the context value is true, instrumented calls still run but emit no spans, unlike MONOCLE_SKIP_EXECUTIONS.
Workflow spans set this to true when their parent came from another process, distinguishing the root of this app's part of a shared trace.
Runs generated scenarios live against an agent as separate pytest cases, with a simulated user and an LLM judge checking success criteria against actual tool calls.
Accepts a
testcasefor parametrized tests.Accepts a
testcasefor parametrized tests.Accepts a
testcase; every eval a case names is graded and all failures are reported together.Borrows the expected result from a different eval.
Adds a runner for invoking an agent deployed to Azure AI Foundry and retrieving its spans from Okahu; it authenticates with an Entra bearer token and correlates spans using Foundry's trace id.
Input and output assertions accept a
testcasefor parametrized tests.The root path
/can now be opted into as a health check route and matches the root exactly; it is not a default.Remote trace retrieval now waits up to this many seconds for spans to reach the backend; the default is 60 seconds instead of a hard-coded 10.
Sets the Okahu API timeout, which defaults to 120 seconds; precedence is explicit argument, environment variable, then default, and unusable values are logged and ignored.
Recorded populations can become parametrizable test cases for eval tuning and A/B testing; parametrized cases are named after the case rather than
[testcase0].Accepts a
testcasefor parametrized tests.Builds one
FluentTestCaseper recorded Okahu fact, or loads a committed JSON array withsource="local"for network-free golden datasets.Provides the workflow name needed to retrieve Foundry runner spans; alternatively, use
FOUNDRY_TRACE_WORKFLOW.Accepts a
testcasefor parametrized tests; trace sources also accept astart_time/end_timewindow.Setting this environment variable to
truedisables span obfuscation.Use this environment variable to scope span obfuscation to selected span types.
Configure span obfuscators, including adding PII detection with
credentials,presidioor disabling obfuscation withnone.Pass an empty
span_obfuscatorslist to disable span obfuscation.Implement a custom
SpanObfuscatorand configure it by itsmodule:ClassNamepath.Health-check routes can be replaced via this variable; matching response-body checks are sampled down to one span per reset counter, while requests with params or a body and failing checks are exported.
Add a runner that invokes an agent deployed to AWS Bedrock AgentCore Runtime remotely and retrieves its spans from Okahu by session.
Let runners identify remote spans using a fact other than the trace id.
Use an exclude list in an instrument config entry to omit method inputs and/or outputs from tracing, preventing their serialization.
Configure the ClickHouse span exporter with this connection URL.
When set, an agent deployed to AWS Bedrock AgentCore returns spans in the invocation response; the agentcore runner strips them before returning the response and falls back to session-based retrieval if needed.
Set MONOCLE_EXPORTER=clickhouse to use the new ClickHouse span exporter, configured with MONOCLE_CLICKHOUSE_CONNECTION_URL and installed with the clickhouse extra.
Assertions can be scoped to a single turn of a multi-turn run.
Supports retrieving traces from the agentic app for remote testing.
Captures cache token counts for Anthropic.
Captures cache token counts for Azure AI traces.
Adds support for Haystack 3.x.x.
Captures cached token counts for OpenAI.
Adds Anthropic agents streaming.
Adds a filtered eval flow for built-in and custom templates.
Adds CrewAI streaming.
Adds a CSV-to-fluent test-case adapter to monocle_test_tools.
Adds an opt-in eval-matrix recorder plugin.
Adds Responses API coverage and non-streaming tool-call output.
Implements LiteLLM streaming.
Implements Mistral streaming.
Adds subcommand dispatch to the monocle_test_tools CLI.
Adds a time filter to Okahu evals for improved performance.
Adds a Postgres exporter.
Captures request temperature on inference span metadata.
Adds a generic API to verify any span attribute or entity.
Adds the ability to assert arbitrary span events.
Adds Strands streaming.
Surfaces eval total_tokens.
Added an agentic.session anchor for CrewAI.
Added support for custom templates.
Added CrewAI turn data.input tracing.
Added support for custom-StateGraph I/O.
Added spans for @tool.
Added a turn-collapse rule for the OpenAI Agents SDK.
Added event-driven instrumentation for LlamaIndex Workflow.run.
Adds regex, JSON validity, keyword presence, and exact match evaluations.
Assertions can check specific or total invocation counts for agents and tools.
Configure a file-name prefix for the Azure Blob exporter.
Adds a CLI command for summarizing sessions in local trace files.
Adds a CLI command for summarizing local trace files.
Adds instrumentation for LiteLLM async methods.
Adds instrumentation for VS Code Copilot.
Enable console output alongside any configured exporter.
Configure a file-name prefix for the file exporter.
Adds browser sign-in for Okahu Cloud during Monocle Agentic CLI setup.
Adds span subtypes for ADK instrumentation.
Enables custom instrumentation through an external configuration file.
Supports setting the span name for custom instrumentation.
Supports a custom startup function for custom instrumentation and uses importlib to preserve namespaces.
Sets a span subtype for Haystack.
Adds a span subtype for LlamaIndex.
Enables fetching traces by scope ID.
Supports providing the workflow name through an environment variable.
Adds Claude Code instrumentation.
Performance 1
Generated scenarios are cached beside the test so later runs do not make a model call.
Behavior and default changes 29
The client is instrumented for trace-context propagation and returned spans, limited to hosts named in MONOCLE_TRACE_PROPAGATATION_URLS.
An explicit off-switch value disables scrubbing; otherwise the built-in obfuscator is used when configured obfuscators cannot be loaded.
Retrieval spans include full retrieved context and truncate only past this character cap, which defaults to 65536.
Passing patterns=list(CREDENTIAL_PATTERNS) turns off inline media obfuscation.
Call this in the agent module so Monocle and Cloud Trace share Google's tracer provider and its per-request flush in Agent Engine.
An empty list explicitly disables scrubbing; otherwise the built-in obfuscator is used when configured obfuscators cannot be loaded.
A fact whose spans fail to load is emitted as a failing test under its own id, with the reason available in
load_error.The LiteLLM metamodel now recognizes ReAct-style text tool calls and extracts their tool name.
The LiteLLM metamodel now recognizes ReAct-style text tool calls and extracts their tool type.
eval_nameaccepts a built-in eval template name or a custom template JSON file path, so callers need not switch totemplate_pathfor custom templates.Report every failing fact with a per-fact breakdown instead of raising on the first one.
When turn_id is unset, turns are auto-numbered per session and the resolved turn id is persisted back onto the turn.
An unrecognized exclusion name warns instead of raising.
Records the test outcome as an Okahu label during cleanup.
Binds the ADK turn scope to the native invocation_id.
Adds changes to OpenAI streaming.
Improves OTLP interoperability for GenAI traces.
Added synchronous stream support for CompiledStateGraph.
LangChain data.input now supports string and dict values.
Added coercion for non-primitive scopes.
Trace files are now idle-based.
FastAPI POST bodies are now captured in HTTP spans.
LiteLLM instrumentation captures response_format in data.input.
Test scopes are propagated to the eval service.
OpenAI inference spans use the generic tool.function tool type.
Sets a span subtype for Azure AI.
Sets inference.decision.span.id for ADK.
Adds the Git branch and repository name to the test run scope.
Custom spans capture arguments and results.
Tooling 13
Adds an A2A test runner, installed with the a2a extra, that drives an agent as an A2A client and joins its spans to the test trace.
The test generator discovers evals configured for an agent and adds matching check_eval assertions, supporting custom templates and searching eval traces beyond 90 days.
Adds a multi-turn test runner with live session persistence.
Adds live Okahu evaluation assertions and eval-source support.
Supports pulling spans for a fact other than trace in the test generator.
Allows multiple runs of a test using pytest-repeat.
Improves the test generator to add additional types of assertions.
Added task tracing for async_execution.
Adds support for tracking code change metrics.
Supports scanning a trace and generating a test trace with assertions.
Adds instrumentation for Copilot CLI.
Adds a linter to validate monocle meta model conformance.
Adds Codex instrumentation so developers can trace Codex usage.
Fixes and other changes 41
The span records the call for current SDK results, including Message results, errors, and tasks without artifacts.
LangChain inference spans record every tool requested by the model, rather than only the first; a single tool call retains its existing shape.
Hugging Face inference spans list tool-call ids, names, and arguments; streamed OpenAI and Hugging Face calls also retain arguments split across chunks.
LangChain inference spans record every tool requested by the model, rather than only the first; a single tool call retains its existing shape.
The span uses the client's Host header when present and brackets an IPv6 socket host in the fallback URL.
An empty result list now reports that the service returned no results for the fact, with the job id and likely causes.
An empty value now falls back to the default.
Failed trace uploads are reported as the failure with the HTTP status or no-response detail, rather than as a later unexpected response format.
Calls in unsampled traces now run without span export instead of failing when span processing encounters a NonRecordingSpan.
Streaming inference now emits a span when the consumer stops reading early; closing after full consumption cannot emit a duplicate span.
A path-like string eval name is now classified as a custom template, matching
check_eval, rather than being requested as a built-in template.The runner passes
memory=only to callables that accept it and binds it withfunctools.partialforrun_in_executor, which takes no kwargs.An unset API key is no longer stripped unguarded.
An endpoint environment variable that is set but empty now falls back to the default endpoint instead of producing a scheme-less URL.
Okahu enumerators now walk every page, and page size is bounds-checked locally instead of producing an opaque HTTP 400.
Wrappers no longer stop the scope token twice, preventing a cleanup error from masking the test's original exception.
Expected-failure marks now apply correctly to fluent assertions, avoiding hard failures for intentional failures and passes when a test silently stops failing.
Resetting span processors now re-appends the trace-return processor, so trace return is not silently dropped on an initialized instrumentor.
Span obfuscation preserves sentence punctuation after an unquoted credential value while still treating dots inside the value as part of the secret.
Fixes the Haystack sentence transformer import and library version.
Disables the second API call that stored evaluation results when shadow_eval is true, preventing duplicate evaluation result storage.
Fixes Anthropic streaming.
Fixes HTTP span truncation in FastAPI and Flask instrumentation.
Ensures file encoding is UTF-8 and adds Windows support.
Closed agentic I/O gaps.
Fixed skip_span to prevent duplicate agentic.invocation spans.
Restored inference and invocation spans for the OpenAI Agents SDK.
Adds direct file reading for the span loader to fix an issue.
Fixes litellm input with Azure OpenAI.
Fixes request body collection in HTTP spans.
Skips the inference span when the async flag is true for a sync method.
Removes arbitrary time filtering for okahu eval.
Handles propagated parent traces and ensures workflow spans close on child errors.
Lazy-loads SentenceTransformer to prevent crashes during pytest collection in network-restricted environments.
Corrects the subtype used for inference spans.
Handles MS Agent SDK invocation spans and missing inference events.
Removes extra output from workflow spans.
Fixes the LangChain package path used for BaseChatModel.
Fixes dict-format handling for OpenAI-compatible APIs such as Nebius.
Fixes a prompt value error.
Handles tool output supplied as a dict or JSON.
monocle-apptrace 0.783 changes
Breaking changes 4
Validation is case sensitive.
Delegation is no longer represented as a span; it is represented as an attribute on the parent agent.
Span IDs no longer include the 0x prefix.
Trace IDs no longer include the 0x prefix.
New APIs and options 44
The Okahu exporter can load its API key from .env.monocle when provided.
An execution ID is added for parallel agent runs.
Support is added for filtering specific attributes or fields in monocle spans.
Streaming support is added for Gemini.
Streaming support is added for Hugging face.
A paygentic exporter is implemented.
A thought token is added in the Gemini thinking model.
Adds input and output for POST methods in Aiohhtp.
Adds input and output for POST methods in FastApi.
Adds input and output for POST methods in Flask.
Adds an MS Agent runner.
Adds an MS Agent streaming implementation.
Adds an MS Agent integration with OpenAI inference.
Adds an MS Foundry type in workflows.
Adds Azure- and OpenAI-specific stream processors.
Adds support for under_duration assertions in Monocle test frameworks.
Pytest Evaluations were added.
A strands runner was added with session_id support.
A custom workflow name can be set for the test tool.
Adds a GCS exporter.
Adds input and output support for the aiohttp MSAgent SDK.
Adds an attribute to the retrieval span for KnowledgeBase.
Adds the mcp tool type based on span attributes.
Adds session support for MS agent.
Adds an inference span for the MS Assistant API.
Adds support for AWS Agentcore.
Adds Boto coverage to the Support API.
Adds support for Microsoft Agent Framework.
Added a CrewAI runner.
Added support for the http exporter as a first-class exporter.
Adds an agent runner for llama index.
Added the Finish reason tool_call for Litellm CrewAI.
Added a tool_call attribute for Anthropic, Azure, and Boto.
Added a CrewAI metamodel.
Added Fastmcp instrumentation.
Added tool_call attributes for Gemini.
Added finish_reason, type, and tool_call attributes for LiteLLM.
Added a tool_call attribute for Llamaindex and Haystack.
Added a tool_call attribute for MistralAI.
Added a basic fluent-style API for the monocle test tool.
Added the session_id scope for ADK.
Added session tracking for AWS Strands, Llamaindex, and OpenAI.
Test runners accept a dict as an argument to avoid test collection problems with parametrized tests.
Added the tool_call name and type in inference spans.
Behavior and default changes 6
Runners now include session id details.
MCP spans now include the server name.
MS Agent spans now include scoped attributes.
Added handling for Gemini tool call inference.
Test status is handled, and trace exports are skipped for passed tests.
S3 and blob exporters include the trace_id in generated NDJSON filenames.
Tooling 2
The Monocle test framework now supports Okahu eval testing for facts beyond traces.
Improved the fluent test API.
Fixes and other changes 27
Includes changes for Crew evaluation.
Fixes MS Agent inference spans.
Detects duplicate setup in telemetry configuration.
A session id issue in msagent was fixed.
The fluent trace asserter starts every chain with the full set of spans.
Fixes chat_store_key extraction in lmx.
Flask and aiohttp skip empty healthcheck HTTP spans.
Adds support for new LangChain versions.
Adds support for new LangGraph versions.
Fixes session_id extraction in lmx.
Fixes workflow name management for telemetry setup.
Adjusts the OpenSearch endpoint variable for SageMaker integration.
Fixes test.assertion.message for fluent tests.
Fixes test.status for MonocleValidator.
Fixes an issue with turn spans.
The export method handles existing event loops.
Fixes the response attribute in the agentic tool for LangGraph.
Fixes the wrapper method for AgentWorkflow in LLAMAINDEX_METHODS.
Handles boto inference input and output for tool_use.
Updates response extraction for the MCP CallToolResult type.
Prevents multiple setup calls and enables resetting span exporters for the test framework.
Fixed the entity count in spans.
Fixed a failure involving the Entity index.
Fixed the entity type for MCP tool invocations.
Fixed monocle_trace to use start_as_monocle_span.
Fixed Strand Boto Input.
Fixed a typo in the Strand session ID attribute.
monocle-apptrace 0.612 changes
New APIs and options 4
Added support for the AWS Strands framework.
Added inference instrumentation for Deepseek.
Added support for skipping entity execution and using a mock response.
Added scope agentic invocation.
Fixes and other changes 8
Handle LangGraph request input.
Update FastAPI methods to fix a coroutine issue during server startup.
Fixed unified tracing for FastAPI and Flask.
Standardized the inference sub type to match other span.subtypes.
Fixed a ParentCommand exception in LangGraph.
Fixed the LlamaIndex agent and multi-agent integrations.
Fixed an error in asynchronous Mistral embedding.
Fixed a broken OpenAI agentic flow.