> For the complete documentation index, see [llms.txt](https://mariadb.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mariadb.com/docs/mariadb-cloud/reference/mariadb-cloud-api-reference-guide/observability.md).

# Observability

## GET /observability/v2/logs

> Returns all logs

```json
{"openapi":"3.1.1","info":{"title":"MariaDB Cloud DBaaS API","version":"1.0"},"tags":[{"name":"Observability"}],"servers":[{"url":"https://api.skysql.com/"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"apiKey","name":"X-API-Key","in":"header"}}},"paths":{"/observability/v2/logs":{"get":{"parameters":[{"schema":{"type":"integer"},"in":"query","name":"limit","required":false},{"schema":{"type":"integer"},"in":"query","name":"offset","required":false},{"schema":{"type":"string"},"in":"query","name":"orderBy","required":false},{"schema":{"type":"string","format":"date-time"},"in":"query","name":"fromDate","required":false},{"schema":{"type":"string","format":"date-time"},"in":"query","name":"toDate","required":false},{"schema":{"type":"string"},"in":"query","name":"serverContext","required":false},{"schema":{"type":"string"},"in":"query","name":"logType","required":false}],"responses":{"200":{"description":"A list of logs"}},"tags":["Observability"],"operationId":"get-log2","summary":"Returns all logs"}}}}
```

## GET /observability/v2/logs/archive

> Returns logs archive

```json
{"openapi":"3.1.1","info":{"title":"MariaDB Cloud DBaaS API","version":"1.0"},"tags":[{"name":"Observability"}],"servers":[{"url":"https://api.skysql.com/"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"apiKey","name":"X-API-Key","in":"header"}}},"paths":{"/observability/v2/logs/archive":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"logIds","required":true},{"schema":{"type":"string"},"in":"query","name":"logFormat","required":false}],"responses":{"200":{"description":"logs archive"}},"tags":["Observability"],"operationId":"download-archive2","summary":"Returns logs archive"}}}}
```

## GET /observability/v2/logs/credentials

> Returns logs credentials

```json
{"openapi":"3.1.1","info":{"title":"MariaDB Cloud DBaaS API","version":"1.0"},"tags":[{"name":"Observability"}],"servers":[{"url":"https://api.skysql.com/"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"apiKey","name":"X-API-Key","in":"header"}}},"paths":{"/observability/v2/logs/credentials":{"get":{"parameters":[{"schema":{"type":"string"},"description":"The provider of the bucket","in":"query","name":"provider","required":true},{"schema":{"type":"string"},"description":"The region of the bucket","in":"query","name":"region","required":true}],"responses":{"200":{"description":"Log credentials object"}},"tags":["Observability"],"operationId":"get-logs-credentials2","summary":"Returns logs credentials"}}}}
```

## POST /observability/v2/logs/query

> Returns all logs

```json
{"openapi":"3.1.1","info":{"title":"MariaDB Cloud DBaaS API","version":"1.0"},"tags":[{"name":"Observability"}],"servers":[{"url":"https://api.skysql.com/"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"apiKey","name":"X-API-Key","in":"header"}},"schemas":{"LogQuery":{"properties":{"fromDate":{"description":"The start date to filter logs","format":"date-time","type":"string"},"limit":{"description":"The maximum number of logs to return","type":"integer"},"logType":{"description":"The log types to filter logs","items":{"type":"string"},"type":"array"},"offset":{"description":"The number of logs to skip before starting to collect the result set","type":"integer"},"orderByDirection":{"description":"The direction to order the logs (asc or desc)","type":"string"},"orderByField":{"description":"The field to order the logs by","type":"string"},"serverContext":{"description":"The server contexts to filter logs","items":{"type":"string"},"type":"array"},"toDate":{"description":"The end date to filter logs","format":"date-time","type":"string"}},"type":"object"}}},"paths":{"/observability/v2/logs/query":{"post":{"responses":{"200":{"description":"A list of logs"}},"tags":["Observability"],"operationId":"query-logs2","summary":"Returns all logs","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogQuery"}}},"description":"Log query payload","required":true}}}}}
```

## GET /observability/v2/logs/retention

> Returns log retention information for a bucket

```json
{"openapi":"3.1.1","info":{"title":"MariaDB Cloud DBaaS API","version":"1.0"},"tags":[{"name":"Observability"}],"servers":[{"url":"https://api.skysql.com/"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"apiKey","name":"X-API-Key","in":"header"}}},"paths":{"/observability/v2/logs/retention":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"bucket_name","required":true},{"schema":{"type":"string"},"in":"query","name":"provider","required":true}],"responses":{"200":{"description":"Bucket information"}},"tags":["Observability"],"operationId":"get-logs-retention-v2","summary":"Returns log retention information for a bucket"}}}}
```

## POST /observability/v2/logs/retention

> Updates retention policy for a bucket

```json
{"openapi":"3.1.1","info":{"title":"MariaDB Cloud DBaaS API","version":"1.0"},"tags":[{"name":"Observability"}],"servers":[{"url":"https://api.skysql.com/"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"apiKey","name":"X-API-Key","in":"header"}},"schemas":{"PutRetentionPolicyRequest":{"properties":{"bucket_name":{"description":"The name of the bucket","type":"string"},"provider":{"description":"The provider of the bucket","type":"string"},"retention_policy_days":{"description":"The number of days for the retention policy","type":"integer"}},"type":"object"}}},"paths":{"/observability/v2/logs/retention":{"post":{"responses":{"200":{"description":"Bucket information"}},"tags":["Observability"],"operationId":"post-logs-retention-v2","summary":"Updates retention policy for a bucket","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PutRetentionPolicyRequest"}}},"description":"Update retention policy payload","required":true}}}}}
```

## GET /observability/v2/logs/servers

> Returns servers that have logs of certain types for given time period

```json
{"openapi":"3.1.1","info":{"title":"MariaDB Cloud DBaaS API","version":"1.0"},"tags":[{"name":"Observability"}],"servers":[{"url":"https://api.skysql.com/"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"apiKey","name":"X-API-Key","in":"header"}}},"paths":{"/observability/v2/logs/servers":{"get":{"parameters":[{"schema":{"type":"string","format":"date-time"},"in":"query","name":"fromDate","required":false},{"schema":{"type":"string","format":"date-time"},"in":"query","name":"toDate","required":false},{"schema":{"type":"string"},"in":"query","name":"logType","required":false}],"responses":{"200":{"description":"A list of servers"}},"tags":["Observability"],"operationId":"get-server-logs2","summary":"Returns servers that have logs of certain types for given time period"}}}}
```

## GET /observability/v2/logs/types

> Returns logs types supported by SkySQL Monitoring

```json
{"openapi":"3.1.1","info":{"title":"MariaDB Cloud DBaaS API","version":"1.0"},"tags":[{"name":"Observability"}],"servers":[{"url":"https://api.skysql.com/"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"apiKey","name":"X-API-Key","in":"header"}}},"paths":{"/observability/v2/logs/types":{"get":{"responses":{"200":{"description":"A list of log types"}},"tags":["Observability"],"operationId":"get-logs-types2","summary":"Returns logs types supported by SkySQL Monitoring"}}}}
```

## GET /observability/v2/metrics

> Returns client metrics presented according to the Prometheus data model

```json
{"openapi":"3.1.1","info":{"title":"MariaDB Cloud DBaaS API","version":"1.0"},"tags":[{"name":"Observability"}],"servers":[{"url":"https://api.skysql.com/"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"apiKey","name":"X-API-Key","in":"header"}}},"paths":{"/observability/v2/metrics":{"get":{"parameters":[{"schema":{"type":"string"},"description":"The name of the service to filter metrics","in":"query","name":"service","required":false}],"responses":{"200":{"description":"A list of metrics"},"400":{"description":"Missing or invalid API key"}},"tags":["Observability"],"operationId":"get-metrics-2","summary":"Returns client metrics presented according to the Prometheus data model"}}}}
```
