Downtrace

v0.4.0
io.github.RadW2020/downtrace Checked 5 hours ago Published 22 days ago

Downtrace tells you when a change breaks the performance of your Node.js backend.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

project_brief

Start here, when a session starts: the project's state in one answer of at most 16 KiB, whatever the project's size, and from each part of it where to read more. `headline` is a sentence of counts that names no route. `telemetry` says whether a batch arrived in the window, for the project and for each environment, with when each last sent: when `telemetry.arrivedSince` is false the brief is missing telemetry, **not** a project with nothing to attend to, however empty its lists. `attention` ranks what needs it: the open findings, newest first, the episodes of lost coverage, the errors first see…

ParameterTypeDescription
project *stringThe project's slug.
sincestringRFC 3339 instant in the past: what happened after it is new, in `telemetry` and `attention`. The last 24 hours when it is not given.

read_credential

What the credential this server was given can do, asked before attempting anything: the project it belongs to, with its slug and name; its own name, id and level —read, operate or admin—; `onBehalfOf`, the person who answers for what it does, named by whoever created it, null when that was not recorded; when it expires, null when it does not; the environments it reaches; and every route of a project with the level it needs and whether this credential opens it. Call it first when you do not know the project's slug: a project's credential belongs to one project, this names it, and the list o…

ParameterTypeDescription
projectstringOnly when this server has no DOWNTRACE_TOKEN and `downtrace login` stored credentials of several projects for its cloud: the slug of the one to describe. It is not sent to the cloud.

list_projects

The list of projects, in the order the front page reads them: the ones with open findings first, then by name. For each, its slug, its name, how many findings are open, when its last batch arrived —null when nothing ever arrived, which is not the same as quiet— and the word of the front page's column: `N open`, `none` or `not compared`, which is nothing arrived in the last hour, so the detectors had nothing to compare. The front page is about every project, so it opens with the shared administration password and with no other credential; a project's own key does not list the others, and is…

project_status

What a project looks like right now: traffic, endpoints, dependencies, runtime health, coverage and the data budget with its consumption. The endpoints come in the order you ask for, and the answer says which order it applied under `endpointsSort`. Under `endings` it says how each process of the last day ended: one that handed over what it was holding before leaving, or one that stopped sending without a word, with what that means was lost if it died. This is where to look after a crash. Unless you say otherwise it reads the first twenty endpoints in that order, each with its operations by has…

ParameterTypeDescription
project *stringThe project's slug.
limitintegerHow many endpoints to read, in the order asked. Twenty by default here; the API's own default is every endpoint, which for a large project weighs hundreds of kilobytes.
methodstringWith `route`, that method of the route alone. Refused without a route.
offsetintegerThe place of the first endpoint to read, up to the endpoints asked for. 0 by default; `page.next` has the next one.
operationsstringHow each endpoint's operations come. `hash` by default: each with its kind, hash, executions, total time and errors, without its text. `text` adds the text under `fromService`, which is most of the we…
orderstringWhich way. By default the worst first for a measurement and alphabetical for a name, which is what the page does on the first click.
routestringOne route, as the endpoints name it (`/orders/:id`): its endpoints in every environment, their readiness and their dependencies, and no other route's.
sortstringWhat to order the endpoints by. `requests` is the default, and `errors` is the share of requests that returned 5xx. By the measurement, not by the text it is printed as, and a route with no requests i…

changes_since

What changed in a project since you last looked: once `project_brief` has said how the project is, this is the question for the rest of the session, from the `until` of the brief or of the last answer, instead of listing the findings, the errors, the deploys and the coverage and diffing them yourself. It lists what opened, closed or was first seen after `since` and up to `until`, newest first, one item for each thing with all its `events` in the window: a `finding` that opened (when a second check confirmed it) or closed, an `error` first seen, a `deploy` first seen —with the version it foll…

ParameterTypeDescription
project *stringThe project's slug.
since *stringRFC 3339 instant: when you last looked. Required, and not in the future. What happened at this instant was already seen and is not in the answer.
limitintegerHow many items to return. Twenty by default.
offsetintegerThe place of the first item to return, up to the window's `total`. 0 by default; `next` has it for the page after this one.
untilstringRFC 3339 instant: the end of the window, after `since` and not in the future. Leave it out: the answer fixes it at the instant it was prepared and gives it back in `until` and in `next`. What happened…

list_findings

The findings of a project, as one flat list: every open one, the most recently confirmed first, then every one that closed in the last 48 hours, the most recently closed first. Each is a summary to choose from and not the evidence, and names under `incident.members` the findings of the incident it belongs to: the ones on the same dependency in the same environment that were open at the same time. There is no filter and no paging; `read_report` has one finding's comparison, hypotheses and recommendations. No findings is not the same as no data: `freshness.lastReceivedAt` says when the last batc…

ParameterTypeDescription
project *stringThe project's slug.

read_finding

One finding in detail: what was measured, under `observed`; what was deployed close enough before it to name, under `attributed`, which is a coincidence in time and not a cause; the reference it is compared against; and the annotations and ratings left on it. Its comparison, hypotheses and recommendations are in `read_report`, and so is the `version` a decision on it takes. An id that is not a number is refused with 400, and a finding this project does not have with 404.

ParameterTypeDescription
finding *stringThe finding's numeric id.
project *stringThe project's slug.

read_report

The report of a finding: facts, hypotheses with their state and evidence, the overall confidence level with the fields its reasons come from, recommendations tied to the hypothesis they rest on, and everything it cannot say. Read it before any decision on a finding. It carries a `version`, and that is the one `close_finding`, `accept_reference` and `assess_hypothesis` take: they are decisions on this report, and the cloud refuses them without changing anything if the report moved since.

ParameterTypeDescription
finding *stringThe finding's numeric id.
project *stringThe project's slug.

compare_windows

What changed between the degraded window and its reference: the differences ordered by how much they explain, with the attribution and its limits. Each window says why it was chosen. `available: false`, with its `reason`, means nothing could be compared, which is not the same as nothing having changed. `read_report` carries the same comparison inside the report.

ParameterTypeDescription
finding *stringThe finding's numeric id.
project *stringThe project's slug.

verify_recovery

Did what I changed work? It reads the finding's footprint from `since`, the instant of the intervention, and concludes `recovery-observed`, `degradation-persists` or `inconclusive`, overall and per deployed version under `scopes`; `waitingCouldHelp` says whether more time could still turn it into an answer. It is a read: it closes nothing and accepts no reference, and it never claims that the intervention caused what it observed. A `since` in the future is refused with 400, and one older than the stored detail starts the window where the data does, and says so.

ParameterTypeDescription
finding *stringThe finding's numeric id.
project *stringThe project's slug.
since *stringRFC 3339 instant of the intervention. Required.

read_history

What a project looked like further back than the fine-grained data goes, hour by hour. `to` must be after `from`, and a window longer than 3 × 366 days, more than any history this cloud keeps, is refused with 400. `environment` reads one environment, the same one in both windows; without it every environment is read together, and they share each window's cut. `baselineFrom` and `baselineTo`, both or neither, are the other window the history page compares against: with them the answer adds `baseline`, the window as asked for with whether the series covers it, and `comparison`, one row per endp…

ParameterTypeDescription
from *stringRFC 3339 instant.
project *stringThe project's slug.
to *stringRFC 3339 instant.
baselineFromstringRFC 3339 instant: the start of the other window, the one to compare against. Goes with `baselineTo`, both or neither.
baselineTostringRFC 3339 instant: the end of the other window, the one to compare against. Goes with `baselineFrom`, both or neither.
environmentstringThe environment to read, in both windows. Without it, every environment together.

list_errors

Every error this project has observed, from the first one: its identity, how many times, when it was first and last seen, and in which environments, versions and routes. `kind` says how the instrumentation came to see it — an instrumented operation failed, the framework turned it into a 5xx, the application reported it itself, or the process threw it outside any request. No traffic minimum and no detector involved — an error is an observed fact, a finding is a detected difference, and the absence of a finding about an error says nothing either way. They come in the order you ask for, the o…

ParameterTypeDescription
project *stringThe project's slug.
limitintegerHow many to return. Fifty by default.
orderstringWhich way. `desc` is the default: the newest or the most first.
sortstringWhat to order them by: `last-seen`, `first-seen`, `occurrences`. The first is when each was last seen, and the default; then when it was first seen, which puts first what arrived most recently; and ho…
statestringWhich triage states to list. `waiting` is the default: open and reappeared, the ones waiting for somebody; `all` is every state. Whatever you ask for, the answer says which filter it applied and how m…

read_error

One error and where it was seen: every environment, deployed version and route it happened on, each with its own count and its own first and last sighting. When the application reported the error itself it also carries, under `fromService`, the structural context it attached — bounded and sanitised by the sender, and the one it sent with the first occurrence of that signature. It also carries its triage: the state it is in, who left it there and why, and the whole history, including any reappearance with the version it was resolved in and the one it came back in.

ParameterTypeDescription
error *stringThe error's identifier, as `list_errors` gives it.
project *stringThe project's slug.

resolve_error

File an error as dealt with, attributed. That is all it does: it accepts no reference, silences no detector and proves nothing about the code, and the occurrences go on being counted. If this error happens again in a deployed version the project first sees after you resolve it, it comes back on its own as a reappearance of the same error, naming both versions — not as a new error. Resolving one that is already resolved is refused, because it would overwrite who resolved it. A retry of this operation after a failure or a dropped connection passes the same `idempotencyKey` again, so it is not…

ParameterTypeDescription
error *stringThe error's identifier, as `list_errors` gives it.
project *stringThe project's slug.
idempotencyKeystringIdempotency key of this operation. Pass the same key when you retry the operation after a failure or a dropped connection: the cloud answers the retry with the result of the first call, so the retry i…
whystringWhy you are doing this. Recorded with the operation, which the cloud attributes to the access credential this server presents.

ignore_error

Take an error out of the default list until a moment you choose, after which it comes back on its own. It silences no detector and no alert, and every occurrence is still counted: no news must never be able to mean nothing is happening. An error that is already resolved cannot be ignored. A retry of this operation after a failure or a dropped connection passes the same `idempotencyKey` again, so it is not a second operation; a new operation passes a different one, or none.

ParameterTypeDescription
error *stringThe error's identifier, as `list_errors` gives it.
project *stringThe project's slug.
until *stringRFC 3339 instant, at most thirty days away. Required.
idempotencyKeystringIdempotency key of this operation. Pass the same key when you retry the operation after a failure or a dropped connection: the cloud answers the retry with the result of the first call, so the retry i…
whystringWhy you are doing this. Recorded with the operation, which the cloud attributes to the access credential this server presents.

unignore_error

Lift an ignore before its `until`, attributed: the error goes back to `open` and into the default list. Only an error that is ignored now can be unignored; any other is refused with 409, including one whose ignore already ran out and so reads `open` again. An ignored error can be resolved with `resolve_error` directly, without this first. A retry of this operation after a failure or a dropped connection passes the same `idempotencyKey` again, so it is not a second operation; a new operation passes a different one, or none.

ParameterTypeDescription
error *stringThe error's identifier, as `list_errors` gives it.
project *stringThe project's slug.
idempotencyKeystringIdempotency key of this operation. Pass the same key when you retry the operation after a failure or a dropped connection: the cloud answers the retry with the result of the first call, so the retry i…
whystringWhy you are doing this. Recorded with the operation, which the cloud attributes to the access credential this server presents.

annotate_error

Say what you know about an error and Downtrace could not measure: 'only with the legacy checkout', 'the provider confirms an incident'. It is kept beside the evidence and never on top of it — it moves no state and changes no measurement. A retry of this operation after a failure or a dropped connection passes the same `idempotencyKey` again, so it is not a second operation; a new operation passes a different one, or none.

ParameterTypeDescription
error *stringThe error's identifier, as `list_errors` gives it.
note *stringWhat you know. Required.
project *stringThe project's slug.
idempotencyKeystringIdempotency key of this operation. Pass the same key when you retry the operation after a failure or a dropped connection: the cloud answers the retry with the result of the first call, so the retry i…

list_captures

The newest hundred captures of a project, newest first, whatever their origin —requested, automatic or prearmed—, since those of one environment spend one budget. Each says its state, when it was accepted and when observation really started —`startedAt`, null until the instrumentation confirms it—, and while it is live when to ask again (`retryAfterSeconds`). The answer also carries the budget —captures per rolling hour, how many at once, how long a footprint cools down and the longest window— and the legend of the states. The evidence is not here: it is in `read_capture`, one capt…

ParameterTypeDescription
project *stringThe project's slug.

read_capture

One capture and whatever evidence has arrived, with both of its coverages, how the requests it kept spent their time, and which fraction of its footprint's requests those were. The requests themselves are not in it: a delivery can hold thousands, each with its operations. Each instance's evidence says how many it holds (`requests.count`), how large they are (`requests.bytes`) and where their first page is (`requests.links.first`); read them a page at a time, or one by its index, with `read_captured_requests`. The coverages are what arrived; a delivery that did not fit whole in the evidence bud…

ParameterTypeDescription
capture *stringThe capture's id.
project *stringThe project's slug.

read_captured_requests

The requests one instance kept for a capture, a page at a time and in the order they arrived. Each comes with its `index`, its place in that instance's delivery, which is how a request is cited and asked for again: `offset` at the index and `limit` at 1 is that one request, now or later, because a delivery is never rewritten. The answer says the `total` and, while there are more, the `next` page. What each request did — its route, its status, its duration and its operations — is under `fromService`.

ParameterTypeDescription
capture *stringThe capture's id.
project *stringThe project's slug.
instancestringThe instance whose requests to read, as `read_capture` names it under `evidence[].instance`. It can be left out when one instance delivered; with several, the answer names them.
limitintegerHow many to return. Twenty by default.
offsetintegerThe index of the first request to return, up to the delivery's total. 0 by default.

list_regressions

What this project says Downtrace missed: the newest hundred regressions recorded with `record_regression`, newest first, each attributed and declared rather than measured. Beside them, under `ask`, the newest question the cloud has recorded for the project and whether a recorded regression has answered it; absent when it has not asked yet. The evaluation reads these as the numerator of its undetected-regressions metric. They are not findings: what was detected is `list_findings`.

ParameterTypeDescription
project *stringThe project's slug.

request_capture

Ask for detail on a route or a dependency for a while. Accepting is not observing: the answer says it is queued, `startedAt` stays null until the instrumentation confirms observation began, and nothing recovers detail that was not kept; `read_capture` follows it. A footprint with a live capture, or cooling down after one that finished, is refused with 409 and `reason: "cooldown"`, naming that capture: read it rather than asking again. An environment already running as many captures as it may, or whose hourly budget is spent, is refused with 429, `reason` `concurrent` or `hourly`, and `retryAft…

ParameterTypeDescription
project *stringThe project's slug.
why *stringWhy you are doing this. Recorded with the operation, which the cloud attributes to the access credential this server presents.
environmentstringThe environment to watch.
idempotencyKeystringIdempotency key of this operation. Pass the same key when you retry the operation after a failure or a dropped connection: the cloud answers the retry with the result of the first call, so the retry i…
kindstringDependency kind, when watching a dependency.
methodstringHTTP method of the route, when watching a route.
routestringRoute template, when watching a route.
targetstringDependency target, when watching a dependency.
windowSecondsintegerHow long to watch for, in whole seconds: 10 to 600 seconds, sixty by default.

close_finding

Close a finding by hand, with one of the three reasons the product allows. This is not observed recovery and is never presented as one. A finding that is already closed, with the same reason or another, is not closed again, because that would overwrite who closed it and why: the cloud answers 409, changes nothing, and says how it stands closed — `closedReason`, `closedBy`, `closedNote`, `closedByDeclared` and `closedAt`: `closedBy` is who closed it by hand or accepted its reference, and there is none on an observed recovery, which nobody performed, nor on an acceptance whose who was not reco…

ParameterTypeDescription
finding *stringThe finding's numeric id.
project *stringThe project's slug.
reason *stringWhich of the three: it was expected, it was noise, or you resolved it and there is no telemetry to confirm it.
version *stringThe version of the report you read before deciding, the `version` field the report of this finding carries, the one `read_report` gives. The operation is checked against it: if the report moved since…
why *stringWhy you are doing this. Recorded with the operation, which the cloud attributes to the access credential this server presents.
idempotencyKeystringIdempotency key of this operation. Pass the same key when you retry the operation after a failure or a dropped connection: the cloud answers the retry with the result of the first call, so the retry i…

accept_reference

Accept the current behaviour as the new normal for this finding. A finding that is already closed is not accepted, also when it is already accepted, because a second acceptance would overwrite who accepted it, why and since when the same difference stays quiet: the cloud answers 409, changes nothing, and says how it stands closed — `closedReason` and `closedAt` — with, when an acceptance closed it, that acceptance in `accepted`: `by`, `why`, `at` and whether `declared`. If that acceptance is your own and its answer never reached you, the 409 is it; a correction to the reason is an annotati…

ParameterTypeDescription
finding *stringThe finding's numeric id.
project *stringThe project's slug.
version *stringThe version of the report you read before deciding, the `version` field the report of this finding carries, the one `read_report` gives. The operation is checked against it: if the report moved since…
why *stringWhy you are doing this. Recorded with the operation, which the cloud attributes to the access credential this server presents.
idempotencyKeystringIdempotency key of this operation. Pass the same key when you retry the operation after a failure or a dropped connection: the cloud answers the retry with the result of the first call, so the retry i…

assess_hypothesis

Record your own reading of a hypothesis, with its reason. It sits beside Downtrace's evaluation and never overwrites it: the evaluation stands and the finding is untouched. Only the hypotheses the rules derive can be assessed: one a language model proposed (`model-1` and on) is refused with 404, which names the ones that can. A retry of this operation after a failure or a dropped connection passes the same `idempotencyKey` again, so it is not a second operation; a new operation passes a different one, or none.

ParameterTypeDescription
finding *stringThe finding's numeric id.
hypothesis *stringThe hypothesis' stable id, as the report gives it under `hypotheses[].id`.
project *stringThe project's slug.
state *stringYour reading, in the same four states Downtrace's own evaluation uses.
version *stringThe version of the report you read before deciding, the `version` field the report of this finding carries, the one `read_report` gives. The operation is checked against it: if the report moved since…
why *stringWhy you are doing this. Recorded with the operation, which the cloud attributes to the access credential this server presents.
idempotencyKeystringIdempotency key of this operation. Pass the same key when you retry the operation after a failure or a dropped connection: the cloud answers the retry with the result of the first call, so the retry i…

give_feedback

Rate a finding on the two axes: was the diagnosis right, and was the alert worth having. It changes nothing about the finding. It is recorded as a rating given by a coding agent, which is what calls this server, and counts apart from the person's: an agent that confirms the diagnosis it has just used is agreeing with itself, so it counts as a signal, not as accuracy. Give `accuracy`, `usefulness` or both: with neither, the cloud refuses it with 400. A retry of this operation after a failure or a dropped connection passes the same `idempotencyKey` again, so it is not a second operation; a new o…

ParameterTypeDescription
finding *stringThe finding's numeric id.
project *stringThe project's slug.
accuracystringWas the diagnosis right.
idempotencyKeystringIdempotency key of this operation. Pass the same key when you retry the operation after a failure or a dropped connection: the cloud answers the retry with the result of the first call, so the retry i…
notestringThe justification of the rating, when you have one.
usefulnessstringWas the alert worth having.

annotate_finding

Say what Downtrace could not measure about a finding: 'reverted at 15:02', 'the provider confirms an incident'. It is kept beside the evidence and never on top of it, and changes no measurement. The same call says that somebody is on it (`acknowledge`) or no longer is (`unacknowledge`), or reopens a finding that was closed by hand (`reopen`). Reopening one that is open, or one that closed on observed recovery or an accepted reference, is refused with 409: contradicting an observed recovery is `record_regression`. A retry of this operation after a failure or a dropped connection passes the same…

ParameterTypeDescription
finding *stringThe finding's numeric id.
note *stringWhat you know. Required.
project *stringThe project's slug.
idempotencyKeystringIdempotency key of this operation. Pass the same key when you retry the operation after a failure or a dropped connection: the cloud answers the retry with the result of the first call, so the retry i…
kindstringWhat it is: a note, the default; acknowledging the finding, or taking that back; or reopening a finding that was closed by hand.

record_regression

Record something Downtrace did not detect. It belongs to the project and not to a finding —there is none, which is the point—, and it changes no detector and raises no alert. The evaluation reads these against the questions the cloud records, and this one answers the newest question still without an answer; `list_regressions` reads them back. It is also how to contradict a finding that closed on observed recovery, which `annotate_finding` cannot reopen. A retry of this operation after a failure or a dropped connection passes the same `idempotencyKey` again, so it is not a second operation;…

ParameterTypeDescription
note *stringWhat happened. Required.
project *stringThe project's slug.
idempotencyKeystringIdempotency key of this operation. Pass the same key when you retry the operation after a failure or a dropped connection: the cloud answers the retry with the result of the first call, so the retry i…

silence_alerts

Stop being told about something, with a scope and an end at most thirty days away. It silences the alert, never the detector: the finding still opens and still counts. An `until` in the past or more than thirty days away is refused with 400. The silences in force, with their ids, are in `project_status` under `silences`, and `lift_silence` ends one early. A retry of this operation after a failure or a dropped connection passes the same `idempotencyKey` again, so it is not a second operation; a new operation passes a different one, or none.

ParameterTypeDescription
project *stringThe project's slug.
scope *string`project` silences every alert of the project; `footprint`, those of one finding's footprint.
until *stringRFC 3339 instant, at most thirty days away.
why *stringWhy you are doing this. Recorded with the operation, which the cloud attributes to the access credential this server presents.
findingstringThe finding's numeric id, when `scope` is `footprint`: the silence takes the finding's whole footprint from it, so nothing is typed by hand and a finding without a route is silenced too. Refused with…
idempotencyKeystringIdempotency key of this operation. Pass the same key when you retry the operation after a failure or a dropped connection: the cloud answers the retry with the result of the first call, so the retry i…

lift_silence

End a silence before its `until`, attributed to the credential that lifts it. Lifting one that was already lifted succeeds, and keeps when it was first lifted and by whom. It answers with the id under `lifted`; the silences in force, with their ids, are in `project_status` under `silences`. A retry of this operation after a failure or a dropped connection passes the same `idempotencyKey` again, so it is not a second operation; a new operation passes a different one, or none.

ParameterTypeDescription
project *stringThe project's slug.
silence *stringThe silence's id.
idempotencyKeystringIdempotency key of this operation. Pass the same key when you retry the operation after a failure or a dropped connection: the cloud answers the retry with the result of the first call, so the retry i…