One request served. A name we suggest, written by you.
| Field | Value |
|---|---|
| Name | http.request |
| Severity | 9 (INFO), or higher when the request failed |
| Written by | Nothing. You write it. |
When you decide. There is no middleware here and no automatic instrumentation of any kind: firstrun never sits in front of a request, and a client that wrapped your handler would be exactly the thing rule seven exists to prevent.
The name and the keys below are in the vocabulary so that two services logging a request spell it the same way and one board reads both. Write it with event() or log() after the response has gone back, so that recording it never delays it.
| Attribute | Type | What it holds |
|---|---|---|
| http.request.method | string | GET, POST, and the rest. |
| http.route | string | The route template rather than the resolved path. A resolved path groups into one row per user id; a template groups into one row per endpoint. |
| http.response.status_code | number | The status that went back. |
| url.path | string | The path that was actually asked for, when you want both. |
| firstrun.duration_ms | number | How long you took to serve it. |
Every entry also carries the resource its client sends once per batch: session.id, user.id once you have called user(), and the rest of the list on the overview. Anything you pass yourself lands in the same map, and your key wins on a collision.
No header, no body, no query string and no client address, unless you put them there yourself. Consider carefully before you do: a server client is covered by your own privacy policy, and an attribute map is a durable place for something a request only needed for a moment.
A widget is a filter, a group by, an aggregate, a time bucket and a limit. These are those five parts written out, and every one of them is something you can build yourself.
| Question | The query |
|---|---|
| Slowest endpoints | Name is http.request . group by http.route . 95th percentile of firstrun.duration_ms |
| Error rate by endpoint | Name is http.request . http.response.status_code is at least 500 . group by http.route |
| Traffic shape | Name is http.request . count of entries . bucket by hour |
| Which methods are used where | Name is http.request . group by http.route and http.request.method |