agentleFS
botirkhaltaevbotirkhaltaev/botir-skills/skills/modal-observability/SKILL.md

modal-observability

Skill4 starsChanged 3 months agoApache-2.0View on GitHub

Modal runtime logs and debugging (modal app logs, modal container logs, shell, exec, enable_output, MODAL_LOGLEVEL, Live Profiling, dashboard URLs), plus metrics and integrations (Datadog, OpenTelemetry, Slack, GPU metrics, audit logs). Use whenever inspecting App/container/sandbox output or diagnosing failures, OOMs, timeouts, or hangs.

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Prefer modal container logs <ta-*|sb-*> --all once you have a container/sandbox ID.

    line 36

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Modal Observability

Domain skill for runtime logs, debugging, metrics, and integrations.

For the full logs/debug module, read logging-debugging.md — it is self-contained (decision tree, all log CLI flags, shell/exec, interact, env vars, symptom table).

When to Use This Skill

  • Fetching or streaming App / container / Sandbox logs
  • Missing logs, failures, OOMs, timeouts, hung containers
  • modal shell, modal container exec, modal run -i / modal.interact()
  • modal.enable_output(), MODAL_LOGLEVEL, MODAL_TRACEBACK
  • Opening dashboard URLs for objects from code / CLI
  • Datadog, OpenTelemetry, Slack alerts
  • GPU metrics / health
  • Enterprise audit logs (workspace actions, not stdout)

Logs and debugging

→ logging-debugging.md (complete module)

Agent defaults (summary)

  1. Finite fetch by default — do not pass -f unless streaming is required.
  2. CLI default is last 100 lines then exit (changed in SDK 1.4+).
  3. Prefer modal container logs <ta-*|sb-*> --all once you have a container/sandbox ID.
  4. --source stderr|stdout|system; add --timestamps and --show-*-id when correlating.

Quick commands

modal app logs my-app --since 2h --source stderr --timestamps \
  --show-function-id --show-function-call-id --show-container-id

modal container list --app-id ap-… --json
modal container logs ta-… --all --timestamps
modal container logs sb-… --all

modal shell ta-…                 # running container
modal shell script.py::fn        # fresh image/spec (not live task)
modal container exec ta-… -- ps aux

MODAL_LOGLEVEL=DEBUG modal run hello.py
with modal.enable_output():
    with app.run():
        fn.remote()

Dashboard URLs

Most Modal objects expose .get_dashboard_url() for deep links (logs, metrics, browsers):

fc = f.spawn(arg)
print(fc.get_dashboard_url())

CLI helpers:

modal dashboard                  # Apps homepage for current environment
modal dashboard <object-id>
modal app dashboard <app-name>
modal volume dashboard <volume-name>

GPU Metrics

MetricWhat It Measures
GPU Utilization %Time in CUDA kernels (nvidia-smi-style occupancy)
GPU Power Utilization %Fraction of max power — best proxy for real work
GPU TemperatureDie °C
GPU Memory UsedAllocated GPU memory

GPU utilization % ≠ compute efficiency; prefer power utilization when judging useful GPU work.

Details: gpu-monitoring.md.

GPU Health

Modal detects ECC / hardware faults and retries on healthy GPUs automatically.

Integrations

Setup detail: integrations.md.

  • Datadog — dashboard Settings → Integrations → Datadog (metrics, lifecycle, Function logs)
  • OpenTelemetry — OTLP endpoint; spans for invocations, container lifecycle, image builds
  • Slack (Beta) — scheduled Function failure / timeout / OOM alerts

Audit Logs (Enterprise)

Workspace actions only (app.deploy, secret.create, …) — not Function stdout or Sandbox exec. Filters: key:value, negate with -.

→ audit-logs.md

Go / TypeScript client telemetry

gRPC unary interceptors (Go) or middleware (TS) on ModalClient for SDK RPC tracing. Runtime App logs still come from Python Functions + the log CLI above.

Crash / performance triage

SymptomLikely causeFix
OOM killMemory limitRaise memory; confirm via --source system logs
Container timeoutExceeded timeoutRaise timeout or optimize
Cold start slowLarge image / importsMemory snapshots, thinner images, @modal.enter
GPU not detectedBad image / CUDAProper CUDA base image
Import error in containerMissing packageFix Image; verify with modal shell script.py::fn
Disk OSErrorEphemeral disk fullLarger ephemeral_disk

Overlay deployments on dashboard metric charts to correlate regressions with deploys.

References (this skill)

  • logging-debugging.md — logs + debug CLI (complete)
  • integrations.md — Datadog, OTel, Slack
  • audit-logs.md — audit actions / filters
  • gpu-monitoring.md — GPU metrics detail

Guardrails

  • Log CLI does not follow by default — last 100 then exit; pass --follow for live streams
  • --all is container/sandbox only, not modal app logs
  • Audit logs ≠ application logs (workspace actions only)
  • Historical CLI logs respect plan retention
  • GPU util % is occupancy, not efficiency
  • Slack notifications require Beta access
  • OpenTelemetry exports add minor overhead; keep sampling rate reasonable

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.