Cheng Jiang
Cheng Jiang

Reputation: 225

Apache Flink: REST API retrieve metric values

I started Latency tracking and passed the /jobs/metrics of the REST API. Obtained the following information:

{"id":"latency.source_id.cbc357ccb763df2852fee8c4fc7d55f2.operator_id.e5ebb093256018a0621f548fbe118f8a.operator_subtask_index.0.latency_p75"}, {"id":"lastCheckpointExternalPath"}, {"id":"latency.source_id.cbc357ccb763df2852fee8c4fc7d55f2.operator_id.55785f9edccd37ac9093dea77018f09d.operator_subtask_index.0.latency_max"}, {"id":"latency.source_id.cbc357ccb763df2852fee8c4fc7d55f2.operator_id.55785f9edccd37ac9093dea77018f09d.operator_subtask_index.0.latency_p999"}, .....

Q: Why aren't the specific values displayed? How should I use the API correctly?

Thank you for your help.

Upvotes: 2

Views: 1188

Answers (1)

xingbin
xingbin

Reputation: 28279

See the doc.

/jobs/metrics return the metrics' id, you need query with job id and metric id:

GET taskmanagers/ABCDE/metrics?get=metric1,metric2

to get values like:

[
  {
    "id": "metric1",
    "value": "34"
  },
  {
    "id": "metric2",
    "value": "2"
  }
]

Upvotes: 2

Related Questions