Profile

The profile API operation returns runtime information about ML tasks and models. The profile operation can help debug model issues at runtime.

The number of requests returned

By default, the Profile API monitors the last 100 requests. To change the number of monitoring requests, update the following cluster setting:

  1. PUT _cluster/settings
  2. {
  3. "persistent" : {
  4. "plugins.ml_commons.monitoring_request_count" : 1000000
  5. }
  6. }

To clear all monitoring requests, set plugins.ml_commons.monitoring_request_count to 0.

Path and HTTP methods

  1. GET /_plugins/_ml/profile
  2. GET /_plugins/_ml/profile/models
  3. GET /_plugins/_ml/profile/models/<model_id>
  4. GET /_plugins/_ml/profile/tasks
  5. GET /_plugins/_ml/profile/tasks/<task_id>

Path parameters

ParameterData typeDescription
model_idStringReturns runtime data for a specific model. You can provide multiple model IDs as comma-separated values to retrieve multiple model profiles.
task_idStringReturns runtime data for a specific task. You can provide multiple task IDs as comma-separated values to retrieve multiple task profiles.

Request fields

All profile body request fields are optional.

FieldData typeDescription
node_idsStringReturns all tasks and profiles from a specific node.
model_idsStringReturns runtime data for a specific model. You can string together multiple model IDs to return multiple model profiles.
task_idsStringReturns runtime data for a specific task. You can string together multiple task IDs to return multiple task profiles.
return_all_tasksBooleanDetermines whether or not a request returns all tasks. When set to false, task profiles are left out of the response.
return_all_modelsBooleanDetermines whether or not a profile request returns all models. When set to false, model profiles are left out of the response.

Example request: Returning all tasks and models on a specific node

  1. GET /_plugins/_ml/profile
  2. {
  3. "node_ids": ["KzONM8c8T4Od-NoUANQNGg"],
  4. "return_all_tasks": true,
  5. "return_all_models": true
  6. }

copy

Example response

  1. {
  2. "nodes" : {
  3. "qTduw0FJTrmGrqMrxH0dcA" : { # node id
  4. "models" : {
  5. "WWQI44MBbzI2oUKAvNUt" : { # model id
  6. "worker_nodes" : [ # routing table
  7. "KzONM8c8T4Od-NoUANQNGg"
  8. ]
  9. }
  10. }
  11. },
  12. ...
  13. "KzONM8c8T4Od-NoUANQNGg" : { # node id
  14. "models" : {
  15. "WWQI44MBbzI2oUKAvNUt" : { # model id
  16. "model_state" : "DEPLOYED", # model status
  17. "predictor" : "org.opensearch.ml.engine.algorithms.text_embedding.TextEmbeddingModel@592814c9",
  18. "worker_nodes" : [ # routing table
  19. "KzONM8c8T4Od-NoUANQNGg"
  20. ],
  21. "predict_request_stats" : { # predict request stats on this node
  22. "count" : 2, # total predict requests on this node
  23. "max" : 89.978681, # max latency in milliseconds
  24. "min" : 5.402,
  25. "average" : 47.6903405,
  26. "p50" : 47.6903405,
  27. "p90" : 81.5210129,
  28. "p99" : 89.13291418999998
  29. }
  30. }
  31. }
  32. },
  33. ...
  34. }
  35. }