簡體   English   中英

從Flink中的WebMonitorEndpoint(Rest Monitoring API)獲取自定義度量標准

[英]get custom gauge metric from WebMonitorEndpoint (Rest Monitoring API) in Flink

我有自定義指標 - >

public class TestMetric implements Gauge<MyType> {


@Override
public MyType getValue() {
    final MyType myObject = new MyType();

    return myObject;
   }
}

我正按照文檔中的建議使用它們 - >

getRuntimeContext().getMetricGroup().gauge("MyCustomMetric", new TestMetric());

我想用GET方法得到這個指標,但到目前為止我幾乎嘗試了API文檔中的所有內容( https://ci.apache.org/projects/flink/flink-docs-release-1.8/monitoring/rest_api.html )但沒有找到該指標。 您知道如何(甚至可以)通過API獲取該自定義指標嗎?

為了通過Flink的REST接口查詢指標,您需要首先找出一些ID:

  • flink_cluster :flink群集的地址
  • port :REST端點的端口
  • jobId :你的工作的ID可以通過http://flink_cluster:port/jobs來計算出來
  • vertexId :要查詢的頂點的Id。 這可以通過http://flink_cluster:port/jobs/:jobId找出,它為您提供所有vertexIds的作業信息
  • subtaskindex :要查詢的並行子任務的索引

http://flink_cluster:port/jobs/:jobId/vertices/:vertexId/subtasks/:subtaskindex/metrics?get=MyCustomMetric

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM