Hydration API Reference
The hydration service exposes a REST API for replaying archived logs back into Kloudfuse.
All endpoints are available at https://<your-instance>/hydration/query/.
Replace <your-instance> with your Kloudfuse hostname and <sa-token> with a valid Service Account token.
For Service Account token setup, see Authentication. For how archives are configured and what hydration is, see Logs Archive and Hydration.
GET /query/list-archives
Returns the list of archive names available in your configured storage bucket.
Use the returned archive names as the archiveName parameter when submitting a hydration job.
curl -H "Authorization: Bearer <sa-token>" \
"https://<your-instance>/hydration/query/list-archives"
[
{ "name": "k8s-production" },
{ "name": "k8s-staging" },
{ "name": "payment-service" }
]
POST /query/hydrate
Submits a new hydration job. The service reads archived log files from the configured storage bucket for the specified time range, applies any filters, and replays matching log lines back into Kloudfuse.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
|
string |
Yes |
The archive to hydrate. Must match a name returned by |
|
int64 |
Yes |
Start of the time range to hydrate, in Unix milliseconds (UTC). |
|
int64 |
Yes |
End of the time range to hydrate, in Unix milliseconds (UTC). |
|
int |
No |
How long to keep the hydrated logs in Kloudfuse before expiry. Used together with |
|
string |
No |
Time unit for |
|
FilterCriteria[] |
No |
Array of filter objects. Only log lines that match all filters are replayed. See Filters below. Omit or pass an empty array to hydrate all lines in the time range. |
|
object |
No |
Key-value map of additional labels to attach to every replayed log line. |
|
boolean |
No |
When |
Response
| Field | Description |
|---|---|
|
UUID of the newly created hydration job. Use this to check progress, pause, resume, or cancel the job. |
Examples
curl -H "Authorization: Bearer <sa-token>" \
-H "Content-Type: application/json" \
-X POST "https://<your-instance>/hydration/query/hydrate" \
-d '{
"archiveName": "k8s-production",
"startTsMs": 1720000000000,
"endTsMs": 1720086400000
}'
{ "jobId": "550e8400-e29b-41d4-a716-446655440000" }
curl -H "Authorization: Bearer <sa-token>" \
-H "Content-Type: application/json" \
-X POST "https://<your-instance>/hydration/query/hydrate" \
-d '{
"archiveName": "k8s-production",
"startTsMs": 1720000000000,
"endTsMs": 1720086400000,
"filters": [
{ "field": "service", "operation": "eq", "value": "payment-service", "type": "labels" },
{ "field": "level", "operation": "eq", "value": "error", "type": "labels" }
]
}'
curl -H "Authorization: Bearer <sa-token>" \
-H "Content-Type: application/json" \
-X POST "https://<your-instance>/hydration/query/hydrate" \
-d '{
"archiveName": "k8s-production",
"startTsMs": 1720000000000,
"endTsMs": 1720086400000,
"filters": [
{ "operation": "regex", "value": ".*connection (refused|timeout).*", "type": "message" }
]
}'
curl -H "Authorization: Bearer <sa-token>" \
-H "Content-Type: application/json" \
-X POST "https://<your-instance>/hydration/query/hydrate" \
-d '{
"archiveName": "k8s-production",
"startTsMs": 1720000000000,
"endTsMs": 1720086400000,
"isDryRun": true,
"filters": [
{ "field": "namespace", "operation": "regex", "value": "prod-.*", "type": "labels" }
]
}'
Filters
Each filter object in the filters array has the following fields.
All filters are combined with logical AND — a log line must satisfy every filter to be replayed.
| Field | Type | Required | Description |
|---|---|---|---|
|
string |
Conditional |
The label or agent-extracted facet name to match against (for example, |
|
string |
Yes |
The comparison operation. See Operations below. |
|
string |
Yes |
The string value to compare against.
For |
|
string |
No (default: |
Which part of the log line the filter applies to. |
Operations
| Operation | Description |
|---|---|
|
Exact equality. The field value must equal |
|
Not equal. The field value must not equal |
|
Substring match. The field value must contain |
|
Negative substring match. The field value must not contain |
|
Regular expression match. The full field value must match the pattern. The pattern is anchored: |
|
Negative regular expression match. The full field value must not match the pattern. |
POST /query/job-progress
Returns the current status and progress of a hydration job.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
|
string |
Yes |
UUID of the job returned by |
curl -H "Authorization: Bearer <sa-token>" \
-H "Content-Type: application/json" \
-X POST "https://<your-instance>/hydration/query/job-progress" \
-d '{ "jobId": "550e8400-e29b-41d4-a716-446655440000" }'
{
"jobId": "550e8400-e29b-41d4-a716-446655440000",
"jobStatus": "HYDRATING",
"jobSummary": "{\"totalHours\":24,\"completedHours\":6,\"totalLines\":0,\"filteredLines\":0}"
}
Job status values:
| Status | Description |
|---|---|
|
Job is queued and waiting for a worker. |
|
Job is actively running. |
|
Job was paused by a |
|
Job completed successfully. |
|
Job encountered an error. Check |
|
Job was canceled by a |
POST /query/list-jobs
Returns a list of hydration jobs, optionally filtered by time range.
Request body (all fields optional)
| Field | Type | Description |
|---|---|---|
|
int |
Return only jobs whose archive start time is at or after this Unix millisecond timestamp. |
|
int |
Return only jobs whose archive end time is at or before this Unix millisecond timestamp. |
|
int |
Maximum number of jobs to return. Defaults to all. |
|
int |
Number of jobs to skip (for pagination). |
curl -H "Authorization: Bearer <sa-token>" \
-H "Content-Type: application/json" \
-X POST "https://<your-instance>/hydration/query/list-jobs" \
-d '{ "count": 10 }'
[
{
"jobId": "550e8400-e29b-41d4-a716-446655440000",
"archiveName": "k8s-production",
"archiveStartTsMs": 1720000000000,
"archiveEndTsMs": 1720086400000,
"archiveFilters": [{ "field": "level", "operation": "eq", "value": "error", "type": "labels" }],
"isDryRun": false,
"jobStatus": "DONE",
"jobSummary": "...",
"createdAtMs": 1720100000000,
"lastUpdatedAtMs": 1720103600000,
"errorMsg": null
}
]
POST /query/pause
Pauses a running hydration job. The job can be resumed later with /resume.
Only jobs in HYDRATING status can be paused.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
|
string |
Yes |
UUID of the job to pause. |
curl -H "Authorization: Bearer <sa-token>" \
-H "Content-Type: application/json" \
-X POST "https://<your-instance>/hydration/query/pause" \
-d '{ "jobId": "550e8400-e29b-41d4-a716-446655440000" }'
{
"jobId": "550e8400-e29b-41d4-a716-446655440000",
"jobStatus": "PAUSED",
"recordsUpdated": 1,
"message": "Successfully paused the job"
}
POST /query/resume
Resumes a paused hydration job. Only jobs in PAUSED status can be resumed.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
|
string |
Yes |
UUID of the job to resume. |
curl -H "Authorization: Bearer <sa-token>" \
-H "Content-Type: application/json" \
-X POST "https://<your-instance>/hydration/query/resume" \
-d '{ "jobId": "550e8400-e29b-41d4-a716-446655440000" }'
{
"jobId": "550e8400-e29b-41d4-a716-446655440000",
"jobStatus": "HYDRATING",
"recordsUpdated": 1,
"message": "Successfully resumed the job"
}
POST /query/cancel
Cancels a hydration job. Jobs in DONE or FAILED status cannot be canceled.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
|
string |
Yes |
UUID of the job to cancel. |
curl -H "Authorization: Bearer <sa-token>" \
-H "Content-Type: application/json" \
-X POST "https://<your-instance>/hydration/query/cancel" \
-d '{ "jobId": "550e8400-e29b-41d4-a716-446655440000" }'
{
"jobId": "550e8400-e29b-41d4-a716-446655440000",
"jobStatus": "HYDRATING",
"recordsUpdated": 1,
"message": "Successfully canceled the job"
}
Error handling
All endpoints return HTTP 400 for client errors (invalid parameters, job not found, wrong state transition) with a plain-text error message in the response body. HTTP 429 is returned when too many hydration jobs are already running concurrently.
| Condition | HTTP status | Typical response body |
|---|---|---|
Invalid or missing |
400 |
|
Malformed JSON body |
400 |
|
|
400 |
|
Too many concurrent jobs |
429 |
|
See also
-
Logs Archive and Hydration — Configure archive rules in your Helm values file
-
Authentication — Create and use Service Account tokens