Skip to content

Commit

Permalink
chore: rewrite queries for nim new graphs
Browse files Browse the repository at this point in the history
Signed-off-by: Tomer Figenblat <[email protected]>
  • Loading branch information
TomerFi committed Dec 20, 2024
1 parent 9b9a528 commit 7785941
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
1 change: 1 addition & 0 deletions controllers/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ const (
DefaultStorageConfig = "storage-config"
IntervalValue = "1m"
RequestRateInterval = "5m"
GPUKVCacheSamplingInterval = "24h"
OvmsImageName = "openvino_model_server"
TgisImageName = "text-generation-inference"
VllmImageName = "vllm"
Expand Down
16 changes: 8 additions & 8 deletions controllers/constants/runtime-metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ const (
"queries": [
{
"title": "Average e2e latency",
"query": "sum by (model_name) (rate(e2e_request_latency_seconds_sum{namespace='${NAMESPACE}', pod=~'${MODEL_NAME}-predictor-.*'}[${RATE_INTERVAL}]) * 1000) / sum by (model_name) (rate(e2e_request_latency_seconds_count{namespace='${NAMESPACE}', pod=~'${MODEL_NAME}-predictor-.*'}[${RATE_INTERVAL}]) * 1000)"
"query": "(rate(e2e_request_latency_seconds_sum{namespace='${NAMESPACE}', pod=~'${MODEL_NAME}-predictor-.*'}[${RATE_INTERVAL}]) * 1000) / (rate(e2e_request_latency_seconds_count{namespace='${NAMESPACE}', pod=~'${MODEL_NAME}-predictor-.*'}[${RATE_INTERVAL}]) * 1000)"
}
]
},
Expand Down Expand Up @@ -277,7 +277,7 @@ const (
"queries": [
{
"title": "GPU cache usage over time",
"query": "round(sum(increase(gpu_cache_usage_perc{namespace='${NAMESPACE}', pod=~'${MODEL_NAME}-predictor-.*'}[${RATE_INTERVAL}])))"
"query": "sum_over_time(gpu_cache_usage_perc{namespace='${NAMESPACE}', pod=~'${MODEL_NAME}-predictor-.*'}[${KV_CACHE_SAMPLING_RATE}])"
}
]
},
Expand Down Expand Up @@ -305,11 +305,11 @@ const (
"queries": [
{
"title": "Total prompts token",
"query": "round(sum(increase(prompt_tokens_total{namespace='${NAMESPACE}', pod=~'${MODEL_NAME}-predictor-.*'}[${RATE_INTERVAL}])))"
"query": "round(rate(prompt_tokens_total{namespace='${NAMESPACE}', pod=~'${MODEL_NAME}-predictor-.*'}[${RATE_INTERVAL}]))"
},
{
"title": "Total generation token",
"query": "round(sum(increase(generation_tokens_total{namespace='${NAMESPACE}', pod=~'${MODEL_NAME}-predictor-.*'}[${RATE_INTERVAL}])))"
"query": "round(rate(generation_tokens_total{namespace='${NAMESPACE}', pod=~'${MODEL_NAME}-predictor-.*'}[${RATE_INTERVAL}]))"
}
]
},
Expand All @@ -319,7 +319,7 @@ const (
"queries": [
{
"title": "Time to first token",
"query": "rate(time_to_first_token_seconds_bucket{namespace='${NAMESPACE}', pod=~'${MODEL_NAME}-predictor-.*'}[${RATE_INTERVAL}])"
"query": "rate(time_to_first_token_seconds_sum{namespace='${NAMESPACE}', pod=~'${MODEL_NAME}-predictor-.*'}[${RATE_INTERVAL}])"
}
]
},
Expand All @@ -329,7 +329,7 @@ const (
"queries": [
{
"title": "Time per output token",
"query": "rate(time_per_output_token_seconds_bucket{namespace='${NAMESPACE}', pod=~'${MODEL_NAME}-predictor-.*'}[${RATE_INTERVAL}])"
"query": "rate(time_per_output_token_seconds_sum{namespace='${NAMESPACE}', pod=~'${MODEL_NAME}-predictor-.*'}[${RATE_INTERVAL}])"
}
]
},
Expand All @@ -339,11 +339,11 @@ const (
"queries": [
{
"title": "Number of successful incoming requests",
"query": "request_success_total{namespace='${NAMESPACE}', pod=~'${MODEL_NAME}-predictor-.*'}"
"query": "round(sum(increase(request_success_total{namespace='${NAMESPACE}', pod=~'${MODEL_NAME}-predictor-.*'}[${REQUEST_RATE_INTERVAL}])))"
},
{
"title": "Number of failed incoming requests",
"query": "request_failure_total{namespace='${NAMESPACE}', pod=~'${MODEL_NAME}-predictor-.*'}"
"query": "round(sum(increase(request_failure_total{namespace='${NAMESPACE}', pod=~'${MODEL_NAME}-predictor-.*'}[${REQUEST_RATE_INTERVAL}])))"
}
]
}
Expand Down
3 changes: 2 additions & 1 deletion controllers/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ func SubstituteVariablesInQueries(data string, namespace string, name string) st
"${NAMESPACE}", namespace,
"${MODEL_NAME}", name,
"${RATE_INTERVAL}", constants.IntervalValue,
"${REQUEST_RATE_INTERVAL}", constants.RequestRateInterval)
"${REQUEST_RATE_INTERVAL}", constants.RequestRateInterval,
"${KV_CACHE_SAMPLING_RATE}", constants.GPUKVCacheSamplingInterval)
return replacer.Replace(data)
}

0 comments on commit 7785941

Please sign in to comment.