You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

能否使用Prometheus监控与管理Spring Cloud Data Flow(SCDF) Server本身?

Spring Cloud Data Flow Server 自身指标获取问题解答

直接访问http://localhost:9393/actuator/prometheus默认拿不到SCDF Server自身的指标,原因是SCDF Server 2.x版本(包括你使用的2.11.1)默认仅暴露health、info这类基础Actuator端点,prometheus端点处于关闭状态;就算开启该端点,默认返回的指标也会混入它管理的流/任务应用数据,需要额外配置过滤规则才能只保留Server自身的指标。

要获取仅属于SCDF Server自身的指标,按以下步骤操作:

  1. 开启并暴露prometheus端点
    启动SCDF Server时添加配置参数,打开prometheus端点并允许外部访问:
    如果是直接通过jar包启动,执行命令:

    java -jar spring-cloud-dataflow-server-2.11.1.jar \
    --management.endpoints.web.exposure.include=prometheus,health,info \
    --management.endpoint.prometheus.enabled=true
    

    也可以将这些配置写入application.properties文件后再启动服务。

  2. 过滤仅保留Server自身指标
    默认情况下prometheus会返回所有关联指标,包括部署的源、处理器、接收器的数据。要只保留Server自身的核心指标,添加以下过滤配置:

    # 关闭指标描述,精简输出内容
    management.metrics.export.prometheus.descriptions=false
    # 给Server指标打上专属标签,方便识别区分
    management.metrics.tags.application=scdf-server
    # 仅保留Server自身的核心指标,比如JVM、进程、Tomcat、SCDF原生指标
    management.metrics.export.prometheus.filter.includes=jvm_*,process_*,tomcat_*,scdf_*
    

    你可以根据实际需求调整includes的规则,确保排除掉流/任务应用的指标。

  3. 验证配置结果
    重启SCDF Server后,再次访问http://localhost:9393/actuator/prometheus,就能看到仅属于SCDF Server自身的指标了。

内容的提问来源于stack exchange,提问作者oviyarajee

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.03 16:27:14