You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to #1206, with_metric_fields and without_metric_fields will be provided as the parameters in the RESTful API to filter the fields of metric in the response to client.
2. Usage for with_metric_fields
with_metric_fields will ask for the metric fields that are not included in the request. For example, if the request is given as below:
/metrics?with_metric_fields=value,p99
The response will only contain the fields of "value" and "p99":
Once both with_metric_fields and without_metric_fields are provided in the request, it will considered as invalid. We can discuss the reason in 2 conditions.
Firstly, suppose both with_metric_fields and without_metric_fields are provided, and they include the same fields. In this condition, each conflicts with another. For example, with_metric_fields=a,b and without_metric_fields=b,c will lead to contradiction: we cannot decide if b should be put in the response to client.
On the contrary, suppose with_metric_fields and without_metric_fields do not include any same field. In this condition, they can be simplified as a unique with_metric_fields. For example, with_metric_fields=a,b and without_metric_fields=c,d can be simplified as with_metric_fields=a,b: without_metric_fields=c,d is useless here since we have declared that only a and b fields are needed according to with_metric_fields=a,b.
Therefore, we can draw a conclusion that with_metric_fields and without_metric_fields should not be provided at the same time.
The text was updated successfully, but these errors were encountered:
1. Motivation
According to #1206,
with_metric_fields
andwithout_metric_fields
will be provided as the parameters in the RESTful API to filter the fields of metric in the response to client.2. Usage for
with_metric_fields
with_metric_fields
will ask for the metric fields that are not included in the request. For example, if the request is given as below:/metrics?with_metric_fields=value,p99
The response will only contain the fields of "value" and "p99":
3. Usage for
without_metric_fields
Similarly,
without_metric_fields
will ask for the metric fields that are not included in the request. For example, if the request is given as below:/metrics?without_metric_fields=value,p99
The response will contain all the fields except "value" and "p99":
4. Wrong usage
Once both
with_metric_fields
andwithout_metric_fields
are provided in the request, it will considered as invalid. We can discuss the reason in 2 conditions.Firstly, suppose both
with_metric_fields
andwithout_metric_fields
are provided, and they include the same fields. In this condition, each conflicts with another. For example,with_metric_fields=a,b
andwithout_metric_fields=b,c
will lead to contradiction: we cannot decide ifb
should be put in the response to client.On the contrary, suppose
with_metric_fields
andwithout_metric_fields
do not include any same field. In this condition, they can be simplified as a uniquewith_metric_fields
. For example,with_metric_fields=a,b
andwithout_metric_fields=c,d
can be simplified aswith_metric_fields=a,b
:without_metric_fields=c,d
is useless here since we have declared that onlya
andb
fields are needed according towith_metric_fields=a,b
.Therefore, we can draw a conclusion that
with_metric_fields
andwithout_metric_fields
should not be provided at the same time.The text was updated successfully, but these errors were encountered: