-
Notifications
You must be signed in to change notification settings - Fork 7
prometheus #58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
prometheus #58
Conversation
ActivePeter
left a comment
There was a problem hiding this 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: |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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 指标 | |||
There was a problem hiding this comment.
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 | |||
There was a problem hiding this comment.
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: | |||
There was a problem hiding this comment.
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())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| @@ -1,3 +1,4 @@ | |||
| <<<<<<< HEAD | |||
There was a problem hiding this comment.
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! { | ||
| // 全局指标注册表 |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
参照其他的handler写,直接spawn task处理就可以了

No description provided.