Usage and tail logs Experimental

The ::u and ::t suffixes open the usage and tail dashboards of a deployment. Usage lists the requests that reached your route, and tail streams what your edge worker logs, as it happens. Both dashboards need sign-in.

Note: Usage and tail logs are work in progress. The dashboards and their behavior may change.

Open the dashboards

Append ::u or ::t to a deployed URL. The suffix must be the last thing in the path:

plain
https://new.rt.ht/::u
https://new.rt.ht/::t
https://webpdf.pro/docs/::u
SuffixOpensRedirects to
::uUsage//u.rt.ht/::sit#live&filter=route%3A<route>
::tTail//u.rt.ht/w::sit#live&filter=route%3A<route>

Each suffix answers with a 303 redirect to u.rt.ht, which signs you in first and then opens the dashboard, filtered to your route. The route is the host without .rt.ht, plus the path of the deployment. Custom domains keep the full hostname. new.rt.ht/::u filters route:new, and webpdf.pro/docs/::u filters route:webpdf.pro/docs.

Tip: Write the suffix without a query string. Anything after ? is appended to the route filter.

The suffixes do not check that the route exists or that it has a worker. The * index shows a usage link for every route and a tail link for routes with a worker. The editor's User menu has a Usage item that opens the usage dashboard in its own window and signs you in first when needed. See ::u ::t and *.

Usage

The usage dashboard is a table of the requests that reached your route.

Signed out, the dashboard shows "You need to authenticate to view usage." with Sign in, Switch account and Sign out.

Tail

The tail dashboard follows the invocations of your edge worker as they happen.

console.* output of a deployed worker does not appear in responses. It goes to the route's tail logs.

Log from a worker

html
<script type=worker edge io:guest>
  export default {
    fetch: request => {
      console.log('hello from', new URL(request.url).pathname)
      return new Response('ok')
    }
  }
</script>

Deploy it, open https://name.rt.ht/::t and call https://name.rt.ht/:hello. The worker's console output goes to the tail logs of the route.

Both dashboards take the same search syntax. Tokens are separated by whitespace, and quotes group words. An example: host:example.com -status:200 timeout.

TokenMeaning
wordA bare word searches every field.
-token or !tokenNegates the token.
field:valueEquals. A quoted value is an exact match.
field~valueContains.
field^valueStarts with.
field$valueEnds with.
field;a,bIs one of the listed values.
field!regexMatches a regular expression.
field>n and field>=a<bNumeric comparisons, with the metric suffixes ~cpu, ~dur and ~num.
route:Takes only :, and a route such as new or example.com/docs.

The fields are host, path, method, status, colo, country, ip, owner and user, or a full event path.

URL hash parameters

The dashboards read their state from the URL hash, so a link can carry a filter.

filter

The search expression. ::u and ::t set it to route:<route>.

live

Streams new events as they arrive.

The dashboards also read hl (highlight).

Who can see what

Both dashboards need sign-in and show the records that your account may see. Sign in with the account that owns the route.

In the playground

The suffixes belong to deployed URLs. The playground does not implement them, and its User menu opens the usage dashboard for your account.

See also