TrainingService.GetTrainingMetricSeries
Read bounded metric series for one attempt. Select metric keys from the summary descriptors and an axis reported by that summary.
TrainingService · Installed Web API. Use the HTTPS origin of your Prokrust installation and credentials authorized for this operation.
POST /prokrust.api.v1alpha1.TrainingService/GetTrainingMetricSeries
Request headers
| Header | Value and purpose |
|---|---|
Authorization | Use Bearer $PROKRUST_TOKEN for a Kubernetes caller authorized for this operation. Browser calls use the signed-in session. |
Content-Type | application/json selects ProtoJSON for this unary request. |
Connect-Protocol-Version | 1 selects version 1 of the Connect protocol. |
Request fields
GetTrainingMetricSeriesRequest
| JSON field | Type | Meaning |
|---|---|---|
scope | TrainingDiagnosticScope | Resource and attempt selection for this diagnostics read. |
metricKeys | list of string | One or more metric keys from the selected attempt’s descriptors. |
axis | string | epoch, step, or elapsed (milliseconds). Bounds are inclusive. |
from | uint64 (explicit presence) | Inclusive lower bound in units of the selected axis. |
to | uint64 (explicit presence) | Inclusive upper bound in units of the selected axis. |
maxPoints | uint32 | Point budget for this request. Omit for the server default or select a value from 4 through 2000. |
cursor | string | Opaque state for the same caller, attempt, and query. Preserve it between requests and restart if resync is true. |
Example request
Set PROKRUST_URL to the installation’s HTTPS origin and PROKRUST_TOKEN to your caller token. Replace the sample values with values from your installation.
curl --fail-with-body --silent --show-error \
-H "Authorization: Bearer $PROKRUST_TOKEN" \
-H 'Content-Type: application/json' \
-H 'Connect-Protocol-Version: 1' \
"$PROKRUST_URL/prokrust.api.v1alpha1.TrainingService/GetTrainingMetricSeries" \
--data-binary @- <<'JSON'
{
"scope": {
"resourceKind": "TrainingRun",
"namespace": "analytics",
"name": "train-values",
"uid": "91c90b29-d618-5dbf-bc4b-391c5aababcd",
"attemptUid": "02c42918-e4a6-5009-a3fd-cf5ec3ec60cd"
},
"metricKeys": [
"validation.loss"
],
"axis": "epoch",
"from": "1",
"maxPoints": 100
}
JSON
Response fields
| JSON field | Type | Meaning |
|---|---|---|
resourceUid | string | UID of the resource named in the request, including when a Model points to a TrainingRun. |
attemptUid | string | Identifier of a training attempt. Use the UID reported by the summary to select the same attempt on subsequent reads. |
revision | uint64 | Revision of the attempt from which these points and gaps were read. |
series | list of TrainingMetricSeries | Metric series returned for the requested keys and axis. |
gaps | list of TrainingDiagnosticEvent | Recorded telemetry gaps within the selected range. Do not infer values across a gap. |
cursor | string | Opaque state for the same caller, attempt, and query. Preserve it between requests and restart if resync is true. |
resync | bool | True when the saved cursor can no longer continue the requested history. Restart from the current summary or first page. |
downsampled | bool | True when the response reduced the number of samples to fit the point budget. |
hasMore | bool | True when another page is available. Continue with the returned offset or cursor for this operation. |
Example response
{
"resourceUid": "91c90b29-d618-5dbf-bc4b-391c5aababcd",
"attemptUid": "02c42918-e4a6-5009-a3fd-cf5ec3ec60cd",
"revision": "4",
"series": [
{
"key": "validation.loss",
"points": [
{
"sequence": "3",
"epoch": 2,
"elapsedMs": "12000",
"value": 0.25
}
]
}
]
}