- Managed telemetry – live log streaming, request metadata, and token usage accessible via CLI.
- Bring-your-own OTEL – forward traces and metrics to any OpenTelemetry collector (Grafana, Honeycomb, Datadog, etc.).
Live logs from the CLI
--since 5m | 2h | 1d– relative duration.--grep "pattern"– regex filtering.--format text|json|yaml– machine-readable output for automation.--order-by timestamp|severity+--asc/--desc– sort order (non-follow mode).
Pro tip: Pipe JSON output intojqfor structured analysis:
mcp-agent cloud logger tail app_abc123 --format json --limit 200 | jq '.message'
Configure your own OTEL endpoint
Forward logs and traces to your collector:--testvalidates the current configuration without saving.- The command writes OTEL settings back into your project’s
mcp_agent.config.yamlfor portability.
Sample OTEL configuration
mcp_agent.config.yaml
OTEL_API_TOKEN in your deployment secrets to keep credentials secure.
Instrumentation inside your app
The logging and tracing helpers automatically annotate spans with MCP metadata (tool names, agent names, token counts). Supplement with custom attributes:Temporal workflow insights
mcp-agent cloud workflows describeprints Temporal status, history length, retries, and memo.- Enable the Temporal Web UI (coming soon) or connect to your own instance if you self-host.
- For long workflows, log progress using
context.logger.infoso run history includes human-friendly breadcrumbs.
Tracing examples
Explore the tracing examples in the repository for end-to-end setups:examples/tracing/agent– structured logs + spans for agent lifecycle.examples/tracing/temporal– demo with Temporal and OTEL collector.examples/tracing/langfuse– integrate with Langfuse dashboards.
Alerting and dashboards (BYO)
Because telemetry is standardised on OTEL, you can:- Emit metrics to Prometheus/Grafana (set up an OTLP receiver and transform logs to metrics).
- Send traces to Honeycomb/Langfuse for timeline analysis.
- Export logs to Datadog or Splunk via OTLP → vendor-specific connectors.
Best practices
Include contextual metadata
Include contextual metadata
Add
data={...} payloads to log calls. When streamed to OTEL, these become searchable attributes (e.g., workflow_id, customer_id, plan_length).Avoid sensitive content
Avoid sensitive content
Logs and traces can include LLM prompts/responses. Mask secrets before logging (
***) or disable verbose logging in production.Sample appropriately
Sample appropriately
High-volume workflows may require sampling (
otel.sample_rate). You can also implement custom sampling logic in code (e.g., only record traces for specific users or stages).Correlate runs
Correlate runs
Store run IDs or correlation IDs in workflow memo and include them in log messages. This makes it easier to pivot between CLI output, OTEL dashboards, and Temporal history.
