yiguolei commented on code in PR #51173:
URL: https://github.com/apache/doris/pull/51173#discussion_r2105661544
##########
fe/fe-core/src/main/java/org/apache/doris/catalog/SchemaTable.java:
##########
@@ -621,6 +621,13 @@ public class SchemaTable extends Table {
.column("IS_ABNORMAL_PAUSE",
ScalarType.createType(PrimitiveType.BOOLEAN))
.build())
)
+ .put("metrics",
+ new SchemaTable(SystemIdGenerator.getNextId(), "metrics",
TableType.SCHEMA,
Review Comment:
可以看一下现在metric的结构,应该是有2个东西:
1. entity, 比如可以是整个be,也可以是某一个tablet,可以看这个代码。std::shared_ptr<MetricEntity>
register_entity(
const std::string& name, const Labels& labels = {},
MetricEntityType type = MetricEntityType::kServer);
2. metric,比如cpu usage 之类的
这两者可以绑定起来。
你可以看一下,这个代码的返回消息的结构,void MetricsAction::handle(HttpRequest* req) {
const std::string& type = req->param("type");
const std::string& with_tablet = req->param("with_tablet");
std::string str;
if (type == "core") {
str = _metric_registry->to_core_string();
} else if (type == "json") {
str = _metric_registry->to_json(with_tablet == "true");
} else {
str = _metric_registry->to_prometheus(with_tablet == "true");
}
req->add_output_header(HttpHeaders::CONTENT_TYPE, "text/plain;
version=0.0.4");
HttpChannel::send_reply(req, str);
}
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]