Include conversation trigger in observability metadata and tags - #9
Draft
juanmichelini wants to merge 1 commit into
Draft
Include conversation trigger in observability metadata and tags#9juanmichelini wants to merge 1 commit into
juanmichelini wants to merge 1 commit into
Conversation
The app server already knows why a conversation was started (ConversationTrigger: gui, automation, resolver, slack, jira, ...), but that signal never reached observability backends, so automation-driven and UI-driven traces were indistinguishable in Laminar. Thread the trigger through _build_observability_context so every start request stamps trace metadata 'trigger' and a 'trigger:<value>' root span tag on both the OpenHands and ACP conversation paths. Co-authored-by: openhands <openhands@all-hands.dev>
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.
Why
Automation-driven sessions and regular UI conversations land in Laminar with identical shape today — the only distinguishing fields on a trace are
session_id(the conversation UUID) and repo metadata. There is no way to filter or group traces by why the conversation was started.The app server already knows this:
AppConversationStartRequest.trigger(ConversationTrigger:gui,automation,resolver,slack,jira,jira_dc,linear,bitbucket,suggested_task,openhands_api,microagent_management). It just never reached the observability payload.What
_build_observability_contextnow accepts an optionaltriggerand, when set, adds:trigger: "<value>"(e.g.automation,gui)trigger:<value>_build_start_conversation_request_for_user(OpenHands agent path)_build_acp_start_conversation_request(ACP path)After this lands, Laminar queries can split automation vs. regular traffic, e.g.:
or filter by the
trigger:automation/trigger:guitag.Pairs with a companion change in OpenHands/automation that stamps the same
trigger: automationmetadata (plusautomation_id/automation_name/automation_run_id/automation_triggerdetail) onto conversations created by preset automation scripts, which bypass the app-server start path.Testing
test_build_observability_context_includes_triggerandtest_build_observability_context_omits_trigger_when_unsetpytest tests/unit/app_server/test_live_status_app_conversation_service.py— 159 passedThis PR was created by an AI agent (OpenHands) on behalf of the user.
@juanmichelini can click here to continue refining the PR