observability-integrations
Configure mcp-agent logging, OpenTelemetry tracing, token accounting, streaming, provider extras, local OpenAI-compatible providers, and LangChain/CrewAI tool adapters.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- observability-integrations
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Configure mcp-agent logging, OpenTelemetry tracing, token accounting, streaming, provider extras, local OpenAI-compatible providers, and LangChain/CrewAI tool adapters.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/logging-and-tracing.md7.6 KB
- 参考文档references/provider-integrations.md7.7 KB
- 参考文档references/troubleshooting.md6.8 KB
- 脚本scripts/check_observability_config.py16.1 KB
- 脚本scripts/summarize_event_log.py7.9 KB
03 SKILL.md 正文
observability-integrations
Use this sub-skill when a task involves mcp-agent observability or optional ecosystem integrations: structured logger transports, OpenTelemetry exporters, usage telemetry, token counters, progress displays, streaming callbacks, provider-specific extras, local OpenAI-compatible endpoints, LangChain tools, or CrewAI tools.
Start Here
- Read
references/logging-and-tracing.mdfor logger transport configuration, OTEL exporter syntax, trace helpers, token accounting, progress displays, streaming events, and safe event-log inspection. - Read
references/provider-integrations.mdfor optional provider extras, import-vs-credential failures, model selector knobs, LM Studio/local OpenAI-compatible endpoints, and LangChain/CrewAI wrappers. - Read
references/troubleshooting.mdwhen config validation, OTEL export, JSONL logs, token counters, progress output, streaming, provider imports, adapters, or local model endpoints fail. - Run
python scripts/check_observability_config.py --helpbefore editing config; use--config mcp_agent.config.yaml --secrets mcp_agent.secrets.yaml --jsonfor credential-redacted diagnostics. - Run
python scripts/summarize_event_log.py --helpand then point it at a small JSONL event log to validate file transport output without replaying interactive progress UI.
Core Workflows
- Enable structured logging with
logger.transports,logger.level,logger.progress_display, and optional file/HTTP settings; preferfileplusconsolefor local debugging and add HTTP only when an endpoint is intentionally configured. - Enable tracing with
otel.enabled: true,otel.service_name,otel.sample_rate, and one or more exporters:console,file, orotlpwith endpoint and optional headers. - Correlate logs and traces by running inside
MCPApp.run()and usingapp.logger,running_app.context.logger, oragent.logger; active spans injecttrace_idandspan_idinto events. - Inspect token usage through the app or agent context token counter after AugmentedLLM calls; use progress display only for interactive TTY runs and use logs or summaries in CI.
- Treat provider SDKs and tool ecosystems as optional extras: import the relevant AugmentedLLM/tool adapter only after installing the matching extra and configuring non-secret model defaults.
- For streaming, consume
generate_stream()events by type and keep callbacks non-blocking; usegenerate_str_stream()only when text deltas are enough.
Route Elsewhere
- Use
../core-sdk/SKILL.mdfor MCPApp, Agent, Settings, config/secrets basics, RequestParams fundamentals, local tool decorators, and normal provider setup. - Use
../cli-cloud-operations/SKILL.mdfor cloud log tailing, cloud logger commands, deployment diagnostics, app/server status, and CLI authentication. - Use
../mcp-server-integration/SKILL.mdfor MCP auth internals, server creation, transport semantics, upstream session lifecycle, and app-as-server behavior. - Use
../workflow-patterns/SKILL.mdfor routers, orchestrators, parallel workflows, evaluator loops, and durable workflow composition.
Bundled Helpers
python scripts/check_observability_config.py --config mcp_agent.config.yaml --json
python scripts/summarize_event_log.py logs/mcp-agent.jsonl --limit 50 --json
Both helpers are self-contained and credential-safe. They do not import provider SDKs, contact external collectors, replay interactive displays, or require the original source repository.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).