feat: ✨ Add tracing to weather tool#255
Merged
evaline-ju merged 11 commits intokagenti:mainfrom Apr 22, 2026
Merged
Conversation
Signed-off-by: Evaline Ju <69598118+evaline-ju@users.noreply.github.com>
Signed-off-by: Evaline Ju <69598118+evaline-ju@users.noreply.github.com>
Signed-off-by: Evaline Ju <69598118+evaline-ju@users.noreply.github.com>
Signed-off-by: Evaline Ju <69598118+evaline-ju@users.noreply.github.com>
Signed-off-by: Evaline Ju <69598118+evaline-ju@users.noreply.github.com>
Signed-off-by: Evaline Ju <69598118+evaline-ju@users.noreply.github.com>
Signed-off-by: Evaline Ju <69598118+evaline-ju@users.noreply.github.com>
Signed-off-by: Evaline Ju <69598118+evaline-ju@users.noreply.github.com>
Signed-off-by: Evaline Ju <69598118+evaline-ju@users.noreply.github.com>
Signed-off-by: Evaline Ju <69598118+evaline-ju@users.noreply.github.com>
esnible
approved these changes
Apr 22, 2026
Contributor
esnible
left a comment
There was a problem hiding this comment.
A tool had some comments. Consider them; if you feel the tool is wrong ignore them.
┌─────┬─────────────────┬──────────────────────┬────────────┬────────────────────────────────────────────────────────────────────────────────┐
│ # │ File │ Line │ Severity │ Comment │
├─────┼─────────────────┼──────────────────────┼────────────┼────────────────────────────────────────────────────────────────────────────────┤
│ 1 │ weather_tool.py │ ~168 (run_server │ suggestion │ Stale comment: # transport can be specified with MCP_TRANSPORT env variable — │
│ │ │ comment) │ │ MCP_TRANSPORT is no longer used │
├─────┼─────────────────┼─────────────────────────┼────────────┼─────────────────────────────────────────────────────────────────────────────┤
│ │ │ │ │ except Exception re-raises but loses the user-friendly error messages the │
│ 2 │ weather_tool.py │ ~126 (except Exception) │ suggestion │ original had. Callers now get a raw traceback instead of "Weather service │
│ │ │ │ │ temporarily unavailable" │
├─────┼─────────────────┼─────────────────────────┼────────────┼─────────────────────────────────────────────────────────────────────────────┤
│ │ │ │ │ logger.info(f"Tracing initialized: ...") — f-string in logging; prefer │
│ 3 │ weather_tool.py │ ~95 (setup_tracing) │ nit │ logger.info("Tracing initialized: service=%s otlp=%s", service_name, │
│ │ │ │ │ otlp_endpoint) for lazy evaluation │
├─────┼─────────────────┼─────────────────────────┼────────────┼─────────────────────────────────────────────────────────────────────────────┤
│ │ │ ~108 ("city not found" │ │ "City not found" is set as StatusCode.ERROR on the span — arguably this is │
│ 4 │ weather_tool.py │ branch) │ nit │ a valid tool result (no city), not an error. Consider StatusCode.OK with a │
│ │ │ │ │ distinguishing attribute │
├─────┼─────────────────┼─────────────────────────┼────────────┼─────────────────────────────────────────────────────────────────────────────┤
│ 5 │ pyproject.toml │ ~8 │ praise │ Good: httpx dependency removed since it's no longer directly needed — keeps │
│ │ │ │ │ the dep list clean │
├─────┼─────────────────┼─────────────────────────┼────────────┼─────────────────────────────────────────────────────────────────────────────┤
│ │ │ ~162 │ │ BaseHTTPMiddleware has known performance caveats in Starlette (wraps entire │
│ 6 │ weather_tool.py │ (BaseHTTPMiddleware) │ nit │ response body in memory). Fine for this example, but worth knowing if this │
│ │ │ │ │ pattern gets copied to production agents │
└─────┴─────────────────┴─────────────────────────┴────────────┴─────────────────────────────────────────────────────────────────────────────┘
Signed-off-by: Evaline Ju <69598118+evaline-ju@users.noreply.github.com>
6 tasks
This was referenced Apr 27, 2026
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.
Summary
MCP_TRANSPORTis removed since FastMCP SSE transport should be deprecated as of 2.3.2 in favor of streamable-httpRelated issue(s)
Updates an example for kagenti/kagenti#619
For example: see kagenti/kagenti#1301
Assisted-By: Claude (Anthropic AI) noreply@anthropic.com