Apache Flink:REST API检索指标值

时间:2018-12-10 14:15:31

标签: apache-flink flink-streaming

我开始了延迟跟踪,并通过了REST API的/jobs/metrics。获得以下信息:

{"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"}, .....

问:为什么不显示特定值?我应该如何正确使用API​​?

谢谢您的帮助。

1 个答案:

答案 0 :(得分:2)

请参见doc

/jobs/metrics返回指标ID,您需要查询作业ID和指标ID:

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

获得如下值:

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