Open
Conversation
ActivePeter
commented
May 20, 2025
| local_values: {} | ||
|
|
||
| prepare: [] | ||
| prepare: |
Contributor
Author
There was a problem hiding this comment.
prometheus 用telego部署是指单独创建一个telego k8s prometheus项目,具体间telego使用文档,问下曾俊怎么用
|
|
||
| ./waverless_entry $DIST_UNIQUE_ID | ||
| # 部署 prometheus 和 grafana | ||
| k8s: |
Contributor
Author
There was a problem hiding this comment.
这里也是,放到单独的prj yml里,此外,也不要放在waverless项目中,只是单纯放在telego_prj目录中
底下的配置参数也全部是错的,看一下文档还有template示例,看看到底怎么用
| @@ -0,0 +1,19 @@ | |||
| #测试用,生成假的 Prometheus 指标 | |||
| @@ -0,0 +1,20 @@ | |||
| import os | |||
Contributor
Author
There was a problem hiding this comment.
这个没必要写成脚本,统一写到prometheus telego项目的local values中
| @@ -0,0 +1,8 @@ | |||
| global: | |||
| 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())) |
Contributor
Author
| @@ -1,3 +1,4 @@ | |||
| <<<<<<< HEAD | |||
Contributor
Author
There was a problem hiding this comment.
这里有merge问题,处理一下
| use sysinfo::{System, SystemExt}; | ||
|
|
||
| lazy_static! { | ||
| // 全局指标注册表 |
Contributor
Author
There was a problem hiding this comment.
不要使用全局变量,统一放到前面提到的单独创建的logical_module中,需要访问就用view,放入到http handler的state中就可以了
ActivePeter
commented
May 22, 2025
|
|
||
| /// 指标收集器,负责收集本节点的性能指标 | ||
| /// 在Worker节点上运行时,会自动将指标通过RPC发送给Master节点 | ||
| pub struct MetricsCollector { |
Contributor
Author
There was a problem hiding this comment.
这里上面要加上#[derive(LogicalMoudle)]
|
|
||
| // 注册RPC处理器 | ||
| let metrics = self.metrics.clone(); | ||
| p2p.register_rpc_handler("report_metrics", Box::new(move |payload| { |
Contributor
Author
There was a problem hiding this comment.
参照其他的handler写,直接spawn task处理就可以了
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

No description provided.