Skip to content

Conversation

@ActivePeter
Copy link
Contributor

No description provided.

Copy link
Contributor Author

@ActivePeter ActivePeter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需要修改

local_values: {}

prepare: []
prepare:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prometheus 用telego部署是指单独创建一个telego k8s prometheus项目,具体间telego使用文档,问下曾俊怎么用

./waverless_entry $DIST_UNIQUE_ID
# 部署 prometheus 和 grafana
k8s:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里也是,放到单独的prj yml里,此外,也不要放在waverless项目中,只是单纯放在telego_prj目录中

底下的配置参数也全部是错的,看一下文档还有template示例,看看到底怎么用

@@ -0,0 +1,19 @@
#测试用,生成假的 Prometheus 指标
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不需要python脚本,删掉

@@ -0,0 +1,20 @@
import os
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个没必要写成脚本,统一写到prometheus telego项目的local values中

@@ -0,0 +1,8 @@
global:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

放到独立项目

with_option!(router_holder.option_mut(), router => {
// router.route("/upload_data", post(handle_write_data))
router.merge(Router::new().route("/upload_data", post(handle_upload_data).with_state(self.view.clone())))
router.merge(Router::new().route("/upload_data", post(handle_upload_data).with_state(self.view.clone()))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

监控单独成独立的两个LogicalModule模块,不要乱塞到data这里,zhi'qian'bu之前不是说了吗??

image

@@ -1,3 +1,4 @@
<<<<<<< HEAD
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里有merge问题,处理一下

use sysinfo::{System, SystemExt};

lazy_static! {
// 全局指标注册表
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不要使用全局变量,统一放到前面提到的单独创建的logical_module中,需要访问就用view,放入到http handler的state中就可以了


/// 指标收集器,负责收集本节点的性能指标
/// 在Worker节点上运行时,会自动将指标通过RPC发送给Master节点
pub struct MetricsCollector {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里上面要加上#[derive(LogicalMoudle)]


// 注册RPC处理器
let metrics = self.metrics.clone();
p2p.register_rpc_handler("report_metrics", Box::new(move |payload| {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

参照其他的handler写,直接spawn task处理就可以了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants