Skip to content

Conversation

@chaoyli
Copy link
Contributor

@chaoyli chaoyli commented May 19, 2020

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.

@chaoyli chaoyli self-assigned this May 19, 2020
@chaoyli chaoyli changed the title [Feature] Convert metric to Json format [Enhancement] Convert metric to Json format May 19, 2020
@chaoyli
Copy link
Contributor Author

chaoyli commented May 19, 2020

#3636

@morningman
Copy link
Contributor

Why we need a json format metric output?

@chaoyli
Copy link
Contributor Author

chaoyli commented May 21, 2020

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.

@morningman
Copy link
Contributor

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?
Which monitoring system uses Json?

@chaoyli
Copy link
Contributor Author

chaoyli commented May 25, 2020

Why we need a json format metric output?

It's for incorporating 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?
Which monitoring system uses Json?

I have test it, It will not larger than a query profile.
open-falcon opensourced by Xiaomi is use JSON to collect metric.
https://github.com/open-falcon/falcon-plus

Copy link
Contributor

@morningman morningman left a 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.

chaoyli added 4 commits May 26, 2020 20:37
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
@chaoyli
Copy link
Contributor Author

chaoyli commented May 26, 2020

LGTM, except for some little problem.
And please fix UT.

I have fixed the UT

Copy link
Contributor

@morningman morningman left a comment

Choose a reason for hiding this comment

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

LGTM

@morningman morningman added the approved Indicates a PR has been approved by one committer. label May 26, 2020
@chaoyli chaoyli merged commit 1cc78fe into apache:master May 27, 2020
baidu-doris pushed a commit to baidu-doris/incubator-doris that referenced this pull request Jun 17, 2020
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
acelyc111 pushed a commit to acelyc111/incubator-doris that referenced this pull request Jan 20, 2021
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. kind/improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants