\Config\app.json

"operation": {
    "prometheusGrafana": true, // 开启 prometheus 监控
    "quartz": true // 开启任务调度
  },

\Config\cap.provider.json


{
  "caps": {
    "dashboard": {
      //cap大屏 开启 http://localhost:5901/cap/index.html#/published/succeeded
      "enabled": false
    }
  }
}

\Startup$Cap.cs



                //启用仪表盘
                if (!_configuration.GetValue<bool>("caps:dashboard:enabled"))
                {
                    //http://localhost:5901/cap/index.html#/published/succeeded
                    x.UseDashboard();
                }

\Startup.cs


    #region Prometheus+Grafana  监控服务  http://localhost:5901/metrics   2022-04-14 cbg
            // 如果不启用 Program.cs 也得注释
            if (_configuration.GetValue<bool>("operation:prometheusGrafana"))
            {
                app.UseMetricServer();
            }
            #endregion Prometheus+Grafana



            #region Prometheus+Grafana  监控服务  http://localhost:5901/metrics  2022-04-14 cbg
            // 如果不启用 Program.cs 也得注释
            if (_configuration.GetValue<bool>("operation:prometheusGrafana"))
            {
                // 放着  UseRouting 前面
                app.UseMetricServer();
            }
            #endregion Prometheus+Grafana



            #region 任务调度
            if (_configuration.GetValue<bool>("operation:quartz"))
            {
                AddConfigureQuartz(services);
            };
            #endregion 任务调度
文档更新时间: 2022-04-20 21:43   作者:admin