-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[Enhancement] Convert metric to Json format #3635
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
Conversation
fe/src/main/java/org/apache/doris/metric/JsonMetricVisitor.java
Outdated
Show resolved
Hide resolved
fe/src/main/java/org/apache/doris/metric/JsonMetricVisitor.java
Outdated
Show resolved
Hide resolved
fe/src/main/java/org/apache/doris/metric/SimpleCoreMetricVisitor.java
Outdated
Show resolved
Hide resolved
fe/src/main/java/org/apache/doris/metric/PrometheusMetricVisitor.java
Outdated
Show resolved
Hide resolved
fe/src/main/java/org/apache/doris/metric/PrometheusMetricVisitor.java
Outdated
Show resolved
Hide resolved
fe/src/main/java/org/apache/doris/service/FrontendServiceImpl.java
Outdated
Show resolved
Hide resolved
|
Why we need a json format metric output? |
It's for incorporting another Monitor Tools easily. Json will be a good choice for this demand. |
If we adopt this json form of expansion each new line, will it result in a very large result set? |
I have test it, It will not larger than a query profile. |
morningman
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.
LGTM, except for some little problem.
And please fix UT.
Add a JSON format for existing metrics like this.
```
{
"tags":
{
"metric":"thread_pool",
"name":"thrift-server-pool",
"type":"active_thread_num"
},
"unit":"number",
"value":3
}
```
I add a new JsonMetricVisitor to handle the convertion.
It's not to modify existing PrometheusMetricVisitor and SimpleCoreMetricVisitor.
Also I add a unit item to indicate the metric better.
Add a JSON format for existing metrics like this.
```
{
"tags":
{
"metric":"thread_pool",
"name":"thrift-server-pool",
"type":"active_thread_num"
},
"unit":"number",
"value":3
}
```
I add a new JsonMetricVisitor to handle the convertion.
It's not to modify existing PrometheusMetricVisitor and SimpleCoreMetricVisitor.
Also I add a unit item to indicate the metric better.
I also add cloning tablet into statistic divided by database.
And also use white space to replace newline in audit.log
I have fixed the UT |
morningman
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.
LGTM
Add a JSON format for existing metrics like this.
```
{
"tags":
{
"metric":"thread_pool",
"name":"thrift-server-pool",
"type":"active_thread_num"
},
"unit":"number",
"value":3
}
```
I add a new JsonMetricVisitor to handle the transformation.
It's not to modify existing PrometheusMetricVisitor and SimpleCoreMetricVisitor.
Also I add
1. A unit item to indicate the metric better
2. Cloning tablet statistics divided by database.
3. Use white space to replace newline in audit.log
Add a JSON format for existing metrics like this.
```
{
"tags":
{
"metric":"thread_pool",
"name":"thrift-server-pool",
"type":"active_thread_num"
},
"unit":"number",
"value":3
}
```
I add a new JsonMetricVisitor to handle the transformation.
It's not to modify existing PrometheusMetricVisitor and SimpleCoreMetricVisitor.
Also I add
1. A unit item to indicate the metric better
2. Cloning tablet statistics divided by database.
3. Use white space to replace newline in audit.log
Add a JSON format for existing metrics like this.
I add a new JsonMetricVisitor to handle the convertion.
It's not to modify existing PrometheusMetricVisitor and SimpleCoreMetricVisitor.
Also I add a unit item to indicate the metric better.