Cloady Docs
API ReferenceEndpointsApplications

Query an app's logs

Runs a LogQL query over the app's own logs, kept for seven days, and returns Loki's answer unchanged: lines for a log query, series for a metric query. Streams: `{container="<service>"}` is each compose service's own output, with `pod` and a `detected_level` (error, critical, fatal, warn, info, debug, trace or unknown) to filter on as `| detected_level=~"error|critical|fatal"`; `{container="_events"}` holds the Kubernetes events about the app's objects as JSON (`kind`, `name`, `reason`, `type`, `msg`, `count`); `{container="_access", service="<service>"}` is the ingress access log of the service the app's address routes to, as Traefik's JSON (`RequestMethod`, `RequestPath`, `DownstreamStatus`, `Duration` in nanoseconds, `request_User-Agent`), with `route`, `method` and `status` as fields; and `{container="_rum", kind="pageview"}` with kinds `vital`, `error`, `net`, `signal`, `custom` and `session` holds browser monitoring, with `page`, `session`, `device`, `browser`, `os` and `country` as fields. Session recordings are kept apart: getBrowserSessionReplay reads them, with the developer role. A query the store refuses comes back with the store's own status and `error`. The path is the store's own, so a Grafana data source can point here too.

GET
/api/workspaces/{workspaceSlug}/apps/{appSlug}/loki/api/v1/query_range
AuthorizationBearer <token>

Personal API token (cldy_…)

In: header

Path Parameters

workspaceSlug*string
appSlug*string

Query Parameters

env?string

Value in

  • "production"
  • "preview"
  • "development"
region?string
query*string

A LogQL query: a log query returns lines, a metric query such as sum by (detected_level) (count_over_time({container="web"} [5m])) returns series

Length1 <= length
start?string

Start of the range, as Unix seconds, Unix nanoseconds or RFC 3339; an hour before end when absent

end?string

End of the range; now when absent

limit?string

Most lines to return for a log query, 100 when absent

direction?string

backward, the default, returns the newest lines first

Value in

  • "backward"
  • "forward"
step?string

Seconds between points of a metric query, or a duration such as 1m

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/workspaces/string/apps/string/loki/api/v1/query_range?query=string"
{  "status": "string",  "data": {    "resultType": "string",    "result": [      null    ],    "property1": null,    "property2": null  },  "errorType": "string",  "error": "string",  "warnings": [    "string"  ],  "property1": null,  "property2": null}