用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/CodySwannGT/lisa --skill ops-verify-telemetry命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
This skill should be used for any non-trivial request — features, bugs, stories, epics, spikes, or multi-step tasks. It accepts a ticket URL (Jira, Linear, GitHub), a file path containing a spec, or a plain-text prompt. It assembles an agent team, breaks the work into structured tasks, and manages the full lifecycle from research through implementation, code review, deploy, and empirical verification.
any non-trivial request —…
This skill should be used for any non-trivial request — features, bugs, stories, epics, spikes, or multi-step tasks. It accepts a ticket URL (Jira, Linear, GitHub), a file path containing a spec, or a plain-text prompt. It assembles an agent team, breaks the work into structured tasks, and manages the full lifecycle from research through implementation, code review, deploy, and empirical verification.
正在显示 SKILL.md
| name | ops-verify-telemetry |
| description | Verify OpenTelemetry traces are… |
| allowed-tools | ["Bash","Read"] |
Verify OpenTelemetry traces are being collected and exported to X-Ray.
Argument: $ARGUMENTS — check type (traces, metrics, all; default: all)
Gemfile for OpenTelemetry gem configuration:
opentelemetry-sdkopentelemetry-exporter-otlpopentelemetry-instrumentation-all (or individual instrumentation gems)config/initializers/opentelemetry.rb (or similar) for SDK configurationconfig/deploy.yml or environment files for OTEL_EXPORTER_OTLP_ENDPOINT and OTEL_SERVICE_NAMEdocker-compose.yml for OpenTelemetry Collector sidecar configuration (if present)bundle list | grep -i opentelemetry
grep -r "OpenTelemetry" config/initializers/ app/
echo "OTEL_EXPORTER_OTLP_ENDPOINT=${OTEL_EXPORTER_OTLP_ENDPOINT:-not set}"
echo "OTEL_SERVICE_NAME=${OTEL_SERVICE_NAME:-not set}"
Make a request to the local app and check that traces are produced:
# Make a request that should generate a trace
curl -sf http://localhost:3000/up -w "\nHTTP %{http_code}\n"
# Check Rails logs for OpenTelemetry output (if configured to log)
grep -i "otel\|opentelemetry\|trace_id" log/development.log | tail -10
# Capture the status BEFORE the pipe. A pipeline reports its LAST stage's exit
# code, so `docker compose logs ... | tail -20 || echo "No otel-collector"`
# never prints the fallback: `tail` succeeds even when there is no such
# service, and the absent sidecar reads as a silent pass.
#
# `|| status=$?`, not `; status=$?`: under `set -e` the `;` form exits before
# the assignment, so the branch that reports the failure never runs.
#
# Ask whether the service EXISTS separately from whether its logs could be
# read. `docker compose logs` also exits non-zero for a stopped daemon, a
# permission failure, and an unparseable compose file; answering all of those
# with "No otel-collector service" turns a broken telemetry stack into a
# reassuring sentence — the same silent-measurement failure one level up.
services_status=0
services=$(docker compose config --services 2>&1) || services_status=$?
if [ "$services_status" -ne 0 ]; then
echo "FAILED ($services_status) — docker compose config could not be read:"
printf '%s\n' "$services"
elif ! printf '%s\n' "$services" | grep -qx otel-collector; then
echo "No otel-collector service in Docker Compose"
else
logs_status=0
docker compose logs otel-collector >otel.log 2>&1 || logs_status=$?
if [ "$logs_status" -eq 0 ]; then
tail -n 20 otel.log
else
otel.log
aws xray get-trace-summaries \
--region {aws-region} \
--start-time $(ruby -r time -e 'puts (Time.now.utc - 30 * 60).iso8601') \
--end-time $(ruby -r time -e 'puts Time.now.utc.iso8601') \
--query 'TraceSummaries | length(@)' \
--output text
aws xray get-trace-summaries \
--region {aws-region} \
--start-time $(ruby -r time -e 'puts (Time.now.utc - 30 * 60).iso8601') \
--end-time $(ruby -r time -e 'puts Time.now.utc.iso8601') \
--filter-expression "service(\"{service-name}\")" \
--query 'TraceSummaries[:10].{TraceId:Id,Duration:Duration,StatusCode:Http.HttpStatus,URL:Http.HttpURL,ResponseTime:ResponseTime}' \
--output table
aws xray get-trace-summaries \
--region {aws-region} \
--start-time $(ruby -r time -e 'puts (Time.now.utc - 3600).iso8601') \
--end-time $(ruby -r time -e 'puts Time.now.utc.iso8601') \
--filter-expression "service(\"{service-name}\") AND fault = true" \
--query 'TraceSummaries[:10].{TraceId:Id,Duration:Duration,StatusCode:Http.HttpStatus,URL:Http.HttpURL}' \
--output table
aws xray batch-get-traces \
--region {aws-region} \
--trace-ids "{trace-id}" \
--query 'Traces[0].Segments[].Document' \
--output text | jq '.'
aws xray get-service-graph \
--region {aws-region} \
--start-time $(ruby -r time -e 'puts (Time.now.utc - 3600).iso8601') \
--end-time $(ruby -r time -e 'puts Time.now.utc.iso8601') \
--query 'Services[].{Name:Name,Type:Type,Edges:Edges[].{Ref:ReferenceId,Latency:ResponseTimeHistogram[0].Average}}' \
--output table
aws cloudwatch list-metrics \
--region {aws-region} \
--namespace "{app_name}" \
--query 'Metrics[].{MetricName:MetricName,Dimensions:Dimensions[].{Name:Name,Value:Value}}' \
--output table
aws cloudwatch get-metric-statistics \
--region {aws-region} \
--namespace "{app_name}" \
--metric-name "{metric-name}" \
--start-time $(ruby -r time -e 'puts (Time.now.utc - 3600).iso8601') \
--end-time $(ruby -r time -e 'puts Time.now.utc.iso8601') \
--period 300 \
--statistics Average Sum \
--output table
aws cloudwatch describe-alarms \
--region {aws-region} \
--alarm-name-prefix "{app_name}" \
--query 'MetricAlarms[].{Name:AlarmName,State:StateValue,Metric:MetricName,Threshold:Threshold}' \
--output table
For checking telemetry configuration in deployed environments:
kamal app exec --roles=web "bin/rails runner \"
puts 'OTEL_EXPORTER_OTLP_ENDPOINT: ' + ENV.fetch('OTEL_EXPORTER_OTLP_ENDPOINT', 'NOT SET')
puts 'OTEL_SERVICE_NAME: ' + ENV.fetch('OTEL_SERVICE_NAME', 'NOT SET')
puts 'OTEL_TRACES_EXPORTER: ' + ENV.fetch('OTEL_TRACES_EXPORTER', 'NOT SET')
\"" -d {environment}
| Check | Status | Details |
|---|---|---|
| OTel gems installed | OK/FAIL | opentelemetry-sdk v1.x.x |
| OTel initializer present | OK/FAIL | config/initializers/opentelemetry.rb |
| OTLP endpoint configured | OK/FAIL | https://otel-collector:4318 |
| Traces in X-Ray (last 30m) | OK/FAIL | 245 traces found |
| Error traces (last 1h) | OK/WARN | 3 fault traces |
| CloudWatch metrics | OK/FAIL | 12 custom metrics published |
| CloudWatch alarms | OK/WARN | 1 alarm in ALARM state |
| Trace ID | Duration | Status | URL |
|---|---|---|---|
| 1-abc123 | 45ms | 200 | GET /up |
| 1-def456 | 120ms | 200 | GET /api/v1/users |
| 1-ghi789 | 2300ms | 500 | POST /api/v1/orders |
Flag concerns: