AgentSkillsCN

tycho-cloudwatch-logs

利用 AWS CLI 与配套脚本,在 AWS CloudWatch 中搜索、尾部查看并查询 Tycho 模拟生产日志。适用于 /ecs/tycho-simulator 的调查工作,例如区块更新、重新同步、准备就绪状态、超时问题,或一般性的应用错误。

SKILL.md
--- frontmatter
name: tycho-cloudwatch-logs
description: Search, tail, and query Tycho simulation production logs in AWS CloudWatch using AWS CLI and bundled scripts. Use for /ecs/tycho-simulator investigations such as block updates, resyncs, readiness, timeouts, or general app errors.

Tycho Cloudwatch Logs

Overview

Use AWS CLI to inspect Tycho simulation logs in CloudWatch. Default log group is /ecs/tycho-simulator in eu-central-1. Logs are JSON from tracing_subscriber, so queries parse @message to extract msg, level, and structured fields.

If you hit ExpiredTokenException, refresh the AWS_SESSION_TOKEN in .env and retry.

Simulate completion logs are now emitted at info level for successful requests and include extra context (tokens, latency, top pool details, and failure summaries). For detailed failure summaries, inspect the raw @message JSON. uniswap-v4-filter logs include filter_rule, considered_pools, accepted_pools, filtered_pools, pools_with_hook_identifier, and pools_missing_hook_identifier to explain hook-pool coverage.

Quick start

  1. Who am I / which env: zsh skills/tycho-cloudwatch-logs/scripts/cw_whoami.zsh
  2. List recent streams: zsh skills/tycho-cloudwatch-logs/scripts/cw_streams.zsh --limit 10
  3. Tail (JSON pretty print): zsh skills/tycho-cloudwatch-logs/scripts/cw_tail.zsh --since 15m --follow
  4. Filter: zsh skills/tycho-cloudwatch-logs/scripts/cw_filter.zsh --since 2h --filter-pattern "Block update:"
  5. Query: zsh skills/tycho-cloudwatch-logs/scripts/cw_query.zsh --preset resync --since 24h

Preset catalog

PresetPurpose
block-updatesTrack block height progress.
readinessConfirm readiness events.
resyncInspect resync lifecycle.
stream-healthStream startup and errors.
stream-supervisionStream supervision and restart lifecycle.
vm-rebuildVM rebuild lifecycle.
startupApp boot sequence.
serverHTTP server lifecycle.
timeoutsHandler timeouts.
router-timeoutsRouter boundary timeouts.
simulate-requestsIncoming simulate requests.
simulate-completionsCompletion logs for simulate calls.
simulate-successesSuccessful completion logs (status=Ready).
simulate-rpmRequests per minute (completion-based).
simulate-rpm-by-auctionRequests per minute per auction_id.
simulate-requests-per-auctionTotal request count per auction_id.
simulate-runsPer-request detail with simulation_runs count.
simulate-runs-per-minuteTotal pool simulation runs per minute.
simulate-runs-per-auctionTotal pool simulation runs per auction_id.
token-metadataToken metadata fetch errors.
token-rpc-fetchSingle-token RPC fetch path.
state-anomaliesMissing/unknown state warnings.
vm-poolsVM pool feed config.
tvl-thresholdsTVL filter thresholds.
uniswap-v4-filterUniswap v4 hook filter log.
warn-errorWARN and ERROR level logs.
storage-errorsStorageError incidents with pool context.
delta-transitionDeltaTransitionError and failed update warnings.
stream-update-statsMax new/removed/updated/total pairs by stream.

Scripts

  • scripts/cw_streams.zsh: list recent log streams by last event time.
  • scripts/cw_tail.zsh: live tail with optional filter and stream prefix (default format: json).
  • scripts/cw_filter.zsh: time-window search with filter patterns.
  • scripts/cw_query.zsh: Logs Insights queries with presets and JSON parsing.
  • scripts/cw_metrics.zsh: memory/cpu metrics summaries and time series.
  • scripts/cw_time.py: time parsing helper for cw_filter, cw_query, and cw_metrics.

Metrics

Quick checks for memory and CPU utilization using ECS ContainerInsights.

  • Memory + CPU summary + series: zsh skills/tycho-cloudwatch-logs/scripts/cw_metrics.zsh --since 12h --metrics memory,cpu
  • Pivot spike check: zsh skills/tycho-cloudwatch-logs/scripts/cw_metrics.zsh --since 2h --pivot 2026-02-04T11:38:00Z --window 10m

Override defaults

  • Set TYCHO_LOG_GROUP for another log group.
  • Set AWS_REGION or AWS_DEFAULT_REGION for another region.
  • Set TYCHO_ECS_CLUSTER or TYCHO_ECS_SERVICE to override ECS defaults for metrics.
  • Pass --log-group on any script to override.

References

Use references/queries.md for the full preset index and filter/query snippets.