Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces OpenTelemetry-based distributed tracing to the Cortex framework, allowing detailed tracking of agent runs, LLM calls, tool executions, and middleware steps. It also adds new middleware event types for better observability and updates the configuration and dependencies to support these features. Additionally, it improves middleware wrappers to emit lifecycle events and makes a minor update to the default LLM for the WeatherAgent.
Distributed Tracing and Observability:
composer.jsonandconfig/cortex.php, enabling tracing export to any OTLP-compatible backend (e.g., Jaeger, Tempo, Honeycomb, Datadog).[1] [2] [3] [4]
setupTracing()inCortexServiceProviderto initialize the tracer provider and subscribe a newOpenTelemetrySubscriberfor event dispatching.Middleware Lifecycle Events:
New Event Types:
MiddlewareStart,MiddlewareEnd, andMiddlewareErrorevents, along with aMiddlewareEventinterface, to represent the lifecycle of middleware execution.[1] [2] [3] [4]
Event Dispatching in Middleware Wrappers:
BeforePromptWrapper,BeforeModelWrapper, andAfterModelWrapperto dispatch the new lifecycle events at the start, end, and on error of each middleware invocation, improving traceability and error reporting.[1] [2] [3] [4] [5] [6]
Other Notable Changes:
LLM Tool Configuration:
getToolConfig()method to theLLMinterface and its abstract base class, allowing retrieval of tool configuration for LLMs.[1] [2] [3]
Default LLM Update:
WeatherAgentfromollama/qwen3.5:9btolmstudio/openai/gpt-oss-20b.Composer Plugin Allowance:
tbachert/spiplugin incomposer.jsonfor dependency management.These changes collectively enhance the framework's observability, making it easier to monitor, debug, and analyze agent and middleware behavior in production environments.