Skip to content

feat(agw): add correlation_id and request path to agw error outputs - #258

Open
ricardosrib wants to merge 1 commit into
mainfrom
feat/improve_sdk_error_outputs
Open

feat(agw): add correlation_id and request path to agw error outputs#258
ricardosrib wants to merge 1 commit into
mainfrom
feat/improve_sdk_error_outputs

Conversation

@ricardosrib

@ricardosrib ricardosrib commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Description

Every AGW call (MCP list, MCP call, A2A card fetch) now generates a correlation ID that is sent as x-correlation-id and included in all error log lines and exception messages alongside the request path. This gives LoB developers a single identifier for log lookup without needing raw traces.

Related Issue

Closes #195 , #247

Type of Change

Please check the relevant option:

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Code refactoring
  • Dependency update

How to Test

  1. Enable DEBUG logging and call list_mcp_tools or call_mcp_tool — verify log lines include [correlation-id=<uuid>, path=<url>] before each AGW request.

  2. Trigger a failure (unreachable host or invalid token) — verify the ERROR log line and any raised AgentGatewaySDKError message contain the same [correlation-id=<uuid>, path=<url>] as the preceding DEBUG line.

Checklist

Before submitting your PR, please review and check the following:

  • I have read the Contributing Guidelines
  • I have verified that my changes solve the issue
  • I have added/updated automated tests to cover my changes
  • All tests pass locally
  • I have verified that my code follows the Code Guidelines
  • I have updated documentation (if applicable)
  • I have added type hints for all public APIs
  • My code does not contain sensitive information (credentials, tokens, etc.)
  • I have followed Conventional Commits for commit messages

Breaking Changes

N/A

Additional Notes

N/A

@ricardosrib ricardosrib self-assigned this Aug 5, 2026
@ricardosrib
ricardosrib requested a review from a team as a code owner August 5, 2026 13:11
@ricardosrib ricardosrib changed the title feat: add correlation_id and request path to agw error outputs feat(agw): add correlation_id and request path to agw error outputs Aug 5, 2026
Raises:
AgentGatewaySDKError: If server does not provide serverInfo.name.
"""
logger.debug(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correlation id is already part of traces with attribute trace id. We can enhance logs and errors messages, but let's not use correlation id.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Print out correlation-id if mcp tool call failed

2 participants