Skip to Content
dropshelf

Monitor an instance

Scrape a dropshelf instance's metrics, alert on the ones that matter, read its probes and logs, and search its event log.

This page is for operators who watch a dropshelf instance in production. It covers the metrics, the health probes, the logs and the event log, which records every change.

Prerequisites

  • A Prometheus that discovers pods, or prometheus-operator.
  • kubectl access to the dropshelf namespace, and jq to search the event log.

Scrape the metrics

Every pod serves /metrics on port 9090, set by server.metricsListen. It is never on the main port 8080, so the Ingress cannot reach it. Choose the way your Prometheus finds targets:

  • A Prometheus that discovers pods: nothing to set. The chart gives every pod the prometheus.io/scrape, prometheus.io/port and prometheus.io/path annotations.
  • prometheus-operator: turn on the chart's ServiceMonitor, which also adds a metrics port to the Service.

To turn on the ServiceMonitor, add this to your values file and run helm upgrade:

metrics:
  serviceMonitor:
    enabled: true
    labels:
      release: prometheus

Replace release: prometheus with the label your Prometheus selects ServiceMonitors on. Prometheus scrapes every 30 seconds unless you set metrics.serviceMonitor.interval.

To check a pod's metrics by hand, forward the port and read one series:

kubectl -n dropshelf port-forward deploy/dropshelf 9090:9090
curl -s http://127.0.0.1:9090/metrics | grep dropshelf_build_info

The output is similar to:

dropshelf_build_info{commit="3f9c2e1a",version="v0.5.0"} 1

Metrics reference

Every metric name starts with dropshelf_. The metrics worth knowing are these:

MetricLabelsWhat it tells you
dropshelf_http_requests_totalhost_class, method, codeRequests by host class: control for the dashboard and API, drop for drops. Split on it first in any incident.
dropshelf_http_request_duration_secondshost_class, routeLatency. route is the route pattern on the control plane, and a fixed value such as drop on drop hosts.
dropshelf_deploys_totalstatus, sourceDeploys by outcome. source is web for a session, api for a token and mcp for an agent.
dropshelf_deploy_duration_secondsHow long a deploy takes.
dropshelf_deploys_in_flightDeploys running on this replica. At deploy.maxConcurrentDeploys, new deploys get 503.
dropshelf_drops_livetypeLive drops by type, written once per reaper run.
dropshelf_reaper_processed_totalstepWhat the reaper did, per step, such as expire, purge and janitor_failed.
dropshelf_reaper_errors_totalOne increment per failing reaper step per run.
dropshelf_reaper_last_run_timestampUnix time of the reaper's last run.
dropshelf_cache_hits_total, dropshelf_cache_misses_totalcacheHits and misses of the object cache on disk and the manifest cache in memory.
dropshelf_cache_bytes, dropshelf_cache_objectscacheWhat each cache holds. For object, the bytes indexed under cache.dir.
dropshelf_cache_errors_totalcache, opCache failures, with op set to fill, open or evict.
dropshelf_blob_ops_total, dropshelf_blob_op_errors_totalopCalls to the object store, and the ones that failed.
dropshelf_blob_op_duration_secondsopHow long object store calls take.
dropshelf_connector_runs_totalsource, resultQueries run against a connector source, a database or an MCP server, with result set to ok, timeout, too_large, busy or error.
dropshelf_connector_runs_in_flightsourceQueries running now. At the source's maxConcurrent, visitors get 503.
dropshelf_build_infoversion, commitWhich release is answering.

A hit ratio that drops after a deploy is normal: a new version is a new set of files to cache.

Alert on what matters

These conditions are worth an alert:

  • The reaper stopped: dropshelf_reaper_last_run_timestamp is older than a few runs. It runs every minute by default, set by reaper.interval.
  • The reaper is failing: dropshelf_reaper_errors_total rises over a window. Expired drops still stop serving on time, but their names are not freed and their files stay in the bucket.
  • The object cache is failing: dropshelf_cache_errors_total rises over a window. Repeated failures send misses to the bucket.
  • Deploys are saturated: dropshelf_deploys_in_flight stays at deploy.maxConcurrentDeploys for longer than a deploy takes.
  • The control plane is failing: the rate of 5xx answers with host_class="control".

As Prometheus rules, those conditions look like this, at the default settings:

- alert: DropshelfReaperStopped
  expr: time() - dropshelf_reaper_last_run_timestamp > 300
- alert: DropshelfReaperErrors
  expr: increase(dropshelf_reaper_errors_total[15m]) > 0
- alert: DropshelfObjectCacheErrors
  expr: increase(dropshelf_cache_errors_total{cache="object"}[15m]) > 0
- alert: DropshelfDeploysSaturated
  expr: dropshelf_deploys_in_flight >= 4
  for: 5m
- alert: DropshelfControlErrors
  expr: sum(rate(dropshelf_http_requests_total{host_class="control",code=~"5.."}[5m])) > 0.1

A flat dropshelf_drops_live can mean a quiet instance or a stopped reaper. Check that dropshelf_reaper_last_run_timestamp advances before you trust it.

Read the probes

Every pod answers two probes on port 8080, for any host name:

PathAnswersUsed for
/healthz200 with ok while the process runs.The liveness probe.
/readyz200 with ready, or 503 with not ready: and the first dependency that failed.The readiness probe, and the first thing to read when requests fail.

/readyz checks the database, the object store and the spool directory, in that order. It caches its answer for five seconds, so a busy load balancer cannot turn it into load. Troubleshoot an instance explains each not ready answer.

Read the logs

The server logs to standard error. Two settings shape it, under log:

  • log.format: json, the default, or text for key=value lines.
  • log.level: debug, info, the default, warn or error.

At startup, the server logs effective configuration with every setting, secrets redacted.

The server does not log requests. A request that fails with 500 can leave no line at all, so read /readyz before you search the log.

Search the event log

Every change writes one log line with the message event at level info. This covers changes from the dashboard, the API, the agents, the operator toolbox and the reaper. The log store you ship logs to is the history, and it keeps what its retention keeps.

log.level: warn or error drops event lines with the rest of info. Keep info or debug on an instance that needs the history.

An event line holds these fields. A field with nothing to say is left off:

FieldWhat it holds
eventThe event name, such as drop.delete, drop.publish, user.disable or token.revoke.
actor_kinduser for a member, operator for the toolbox, system for the reaper.
actorThe member's user id.
sourceweb for a session, api for a token, mcp for an agent, cli for the toolbox, reaper for the reaper.
target_kindWhat changed, such as drop, user, token or comment.
targetThe drop's name, the user id, the token id, or the comment id.
request_id, ip, uaThe request's id, address and User-Agent, on changes made over HTTP.
detailsMore about the change, such as from and to on a rename. A toolbox write adds host, the pod's name.

The line also carries time, level and msg, like every log line. Query on msg and the fields above.

To search, define a small shell function over kubectl logs and jq:

events() { # events <since> <jq condition>
  kubectl -n dropshelf logs -l app.kubernetes.io/name=dropshelf --since="$1" --tail=-1 \
    | jq -cR "fromjson? | select(.msg == \"event\" and ($2))"
}

--tail=-1 matters, because kubectl logs with a label prints only ten lines per pod otherwise.

To find who deleted the drop lunch-votes, or whether it expired, in the last 30 days:

events 720h '.target == "lunch-votes" and (.event | IN("drop.delete", "admin.force_delete", "drop.expire"))'

To list every toolbox write from inside the cluster in the last week:

events 168h '.actor_kind == "operator"'

kubectl logs reaches only what the pods still hold. For older lines, run the same filters in the store your logs are shipped to. With log.format: text, grep on the same fields does the job.

Next steps

Last updated .

On this page