You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "wu-sheng (via GitHub)" <gi...@apache.org> on 2023/05/06 09:17:12 UTC

[GitHub] [skywalking-query-protocol] wu-sheng opened a new pull request, #113: SkyWalking Metrics Query Expression(MQE) protocol

wu-sheng opened a new pull request, #113:
URL: https://github.com/apache/skywalking-query-protocol/pull/113

   According to the experiences we learned when implementing the PromQL support, I think we should consider our own expression system in the query stage to reduce the dependencies on the UI side 
   
   FYI @apache/skywalking-committers 
   
   ## Metrics Query Expression(MQE)
   I would leave the details of MQE grammar to @wankai123, as he is much more familiar with PromQL expression.
   At least, we could support these kinds of expressions
   
   - round(service_sla / 100, 1) // keep one digital for a double
   - service_success_count / service_total_count // calculate with multiple metric
   - avg(service_cpm) // a single value
   - sort(service_sla, ASC, 10) // get lowest N services by the value of success rate
   - sampled_slow_trace_record / 100 // Read sampled record and the value_column(`latency`) should divide 100
   
   The expression includes metrics with different types, that would cause `UNKNOWN` value.
   
   


-- 
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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-query-protocol] kezhenxu94 commented on a diff in pull request #113: SkyWalking Metrics Query Expression(MQE) protocol

Posted by "kezhenxu94 (via GitHub)" <gi...@apache.org>.
kezhenxu94 commented on code in PR #113:
URL: https://github.com/apache/skywalking-query-protocol/pull/113#discussion_r1186670699


##########
metrics-expression.graphqls:
##########
@@ -0,0 +1,62 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# SkyWalking Metrics Query Expression(MQE) is an extension query mechanism.
+# MQE allows users to do simple query-stage calculation like well known PromQL.
+
+enum ExpressionResultType {
+    # Can't resolve the type of the given expression.
+    UNKNOWN
+    # A single value
+    SINGLE_VALUE
+    # A collection of time-series values.
+    # The value could have labels or not.
+    TIME_SERIES_VALUES
+    # A collection of aggregated or sampled values.
+    # When the original metric type is sampled records or through metric sorting
+    LIST
+}
+
+type MQEValues {
+    labels: [String!]!
+    # 1. When the type == SINGLE_VALUE, values only have one value.
+    # 2. When the type == TIME_SERIES_VALUES, values would match the given elements in the duration range.
+    # 3. When the type == LIST, values could be
+    #    3.1 sampled records
+    #    3.2 results of `sort(metric)`
+    values: [MQEValue!]!
+}
+
+type MQEValue {
+    id: ID!
+    value: String!
+    isEmptyValue: Boolean!
+    # Sampled record could associate with a trace.
+    # This would be a trace ID only.
+    attachmentID: ID!

Review Comment:
   If we can make sure that, `attachmentID` can be reused when needed for other cases than trace id, this name is good to me. I am just concerned that we might end up with something like `attachmentID`, `eventID`, and `logID`, where only `attachmentID` doesn't indicate what object (traces) it points to. 



-- 
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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-query-protocol] wu-sheng commented on a diff in pull request #113: SkyWalking Metrics Query Expression(MQE) protocol

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on code in PR #113:
URL: https://github.com/apache/skywalking-query-protocol/pull/113#discussion_r1186669170


##########
metrics-expression.graphqls:
##########
@@ -0,0 +1,62 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# SkyWalking Metrics Query Expression(MQE) is an extension query mechanism.
+# MQE allows users to do simple query-stage calculation like well known PromQL.
+
+enum ExpressionResultType {
+    # Can't resolve the type of the given expression.
+    UNKNOWN
+    # A single value
+    SINGLE_VALUE
+    # A collection of time-series values.
+    # The value could have labels or not.
+    TIME_SERIES_VALUES
+    # A collection of aggregated or sampled values.
+    # When the original metric type is sampled records or through metric sorting
+    LIST
+}

Review Comment:
   @Fine0830 Please recheck this. When we are using the expression, UI could only use these types to determine the available graph options. Please confirm whether this is enough or suitable.



##########
metrics-expression.graphqls:
##########
@@ -0,0 +1,63 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# SkyWalking Metrics Query Expression(MQE) is an extension query mechanism.
+# MQE allows users to do simple query-stage calculation like well known PromQL.
+
+enum ExpressionResultType {
+    # Can't resolve the type of the given expression.
+    UNKNOWN
+    # A single value
+    SINGLE_VALUE
+    # A collection of time-series values.
+    # The value could have labels or not.
+    TIME_SERIES_VALUES
+    # A collection of aggregated values through metric sort function
+    SORTED_LIST
+    # A collection of sampled records.
+    # When the original metric type is sampled records
+    RECORD_LIST
+}

Review Comment:
   @Fine0830 Please recheck this. When we are using the expression, UI could only use these types to determine the available graph options. Please confirm whether this is enough or suitable.



-- 
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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-query-protocol] wu-sheng commented on a diff in pull request #113: SkyWalking Metrics Query Expression(MQE) protocol

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on code in PR #113:
URL: https://github.com/apache/skywalking-query-protocol/pull/113#discussion_r1186669632


##########
metrics-expression.graphqls:
##########
@@ -0,0 +1,62 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# SkyWalking Metrics Query Expression(MQE) is an extension query mechanism.
+# MQE allows users to do simple query-stage calculation like well known PromQL.
+
+enum ExpressionResultType {
+    # Can't resolve the type of the given expression.
+    UNKNOWN
+    # A single value
+    SINGLE_VALUE
+    # A collection of time-series values.
+    # The value could have labels or not.
+    TIME_SERIES_VALUES
+    # A collection of aggregated or sampled values.
+    # When the original metric type is sampled records or through metric sorting
+    LIST
+}
+
+type MQEValues {
+    labels: [String!]!
+    # 1. When the type == SINGLE_VALUE, values only have one value.
+    # 2. When the type == TIME_SERIES_VALUES, values would match the given elements in the duration range.
+    # 3. When the type == LIST, values could be
+    #    3.1 sampled records
+    #    3.2 results of `sort(metric)`
+    values: [MQEValue!]!
+}
+
+type MQEValue {
+    id: ID!
+    value: String!
+    isEmptyValue: Boolean!
+    # Sampled record could associate with a trace.
+    # This would be a trace ID only.
+    attachmentID: ID!

Review Comment:
   I am not certain about this name too.



-- 
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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-query-protocol] wu-sheng closed pull request #113: SkyWalking Metrics Query Expression(MQE) protocol

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng closed pull request #113: SkyWalking Metrics Query Expression(MQE) protocol
URL: https://github.com/apache/skywalking-query-protocol/pull/113


-- 
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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-query-protocol] kezhenxu94 commented on a diff in pull request #113: SkyWalking Metrics Query Expression(MQE) protocol

Posted by "kezhenxu94 (via GitHub)" <gi...@apache.org>.
kezhenxu94 commented on code in PR #113:
URL: https://github.com/apache/skywalking-query-protocol/pull/113#discussion_r1186669453


##########
metrics-expression.graphqls:
##########
@@ -0,0 +1,62 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# SkyWalking Metrics Query Expression(MQE) is an extension query mechanism.
+# MQE allows users to do simple query-stage calculation like well known PromQL.
+
+enum ExpressionResultType {
+    # Can't resolve the type of the given expression.
+    UNKNOWN
+    # A single value
+    SINGLE_VALUE
+    # A collection of time-series values.
+    # The value could have labels or not.
+    TIME_SERIES_VALUES
+    # A collection of aggregated or sampled values.
+    # When the original metric type is sampled records or through metric sorting
+    LIST
+}
+
+type MQEValues {
+    labels: [String!]!
+    # 1. When the type == SINGLE_VALUE, values only have one value.
+    # 2. When the type == TIME_SERIES_VALUES, values would match the given elements in the duration range.
+    # 3. When the type == LIST, values could be
+    #    3.1 sampled records
+    #    3.2 results of `sort(metric)`
+    values: [MQEValue!]!
+}
+
+type MQEValue {
+    id: ID!
+    value: String!
+    isEmptyValue: Boolean!
+    # Sampled record could associate with a trace.
+    # This would be a trace ID only.
+    attachmentID: ID!

Review Comment:
   According to the comment above, can we name it more specifically like `traceID`?



-- 
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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-query-protocol] wu-sheng commented on a diff in pull request #113: SkyWalking Metrics Query Expression(MQE) protocol

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on code in PR #113:
URL: https://github.com/apache/skywalking-query-protocol/pull/113#discussion_r1186669170


##########
metrics-expression.graphqls:
##########
@@ -0,0 +1,62 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# SkyWalking Metrics Query Expression(MQE) is an extension query mechanism.
+# MQE allows users to do simple query-stage calculation like well known PromQL.
+
+enum ExpressionResultType {
+    # Can't resolve the type of the given expression.
+    UNKNOWN
+    # A single value
+    SINGLE_VALUE
+    # A collection of time-series values.
+    # The value could have labels or not.
+    TIME_SERIES_VALUES
+    # A collection of aggregated or sampled values.
+    # When the original metric type is sampled records or through metric sorting
+    LIST
+}

Review Comment:
   @Fine0830 Please recheck this. When we are using the expression, UI could only use these types to determine the available graph options. Please confirm whether this is enough or suitable.



-- 
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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-query-protocol] wu-sheng commented on a diff in pull request #113: SkyWalking Metrics Query Expression(MQE) protocol

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on code in PR #113:
URL: https://github.com/apache/skywalking-query-protocol/pull/113#discussion_r1186671627


##########
metrics-expression.graphqls:
##########
@@ -0,0 +1,62 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# SkyWalking Metrics Query Expression(MQE) is an extension query mechanism.
+# MQE allows users to do simple query-stage calculation like well known PromQL.
+
+enum ExpressionResultType {
+    # Can't resolve the type of the given expression.
+    UNKNOWN
+    # A single value
+    SINGLE_VALUE
+    # A collection of time-series values.
+    # The value could have labels or not.
+    TIME_SERIES_VALUES
+    # A collection of aggregated or sampled values.
+    # When the original metric type is sampled records or through metric sorting
+    LIST
+}
+
+type MQEValues {
+    labels: [String!]!
+    # 1. When the type == SINGLE_VALUE, values only have one value.
+    # 2. When the type == TIME_SERIES_VALUES, values would match the given elements in the duration range.
+    # 3. When the type == LIST, values could be
+    #    3.1 sampled records
+    #    3.2 results of `sort(metric)`
+    values: [MQEValue!]!
+}
+
+type MQEValue {
+    id: ID!
+    value: String!
+    isEmptyValue: Boolean!
+    # Sampled record could associate with a trace.
+    # This would be a trace ID only.
+    attachmentID: ID!

Review Comment:
   Updated as `traceID`, somehow the PR review page is not updating.



-- 
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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-query-protocol] wu-sheng commented on a diff in pull request #113: SkyWalking Metrics Query Expression(MQE) protocol

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on code in PR #113:
URL: https://github.com/apache/skywalking-query-protocol/pull/113#discussion_r1186675058


##########
metrics-expression.graphqls:
##########
@@ -0,0 +1,63 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# SkyWalking Metrics Query Expression(MQE) is an extension query mechanism.
+# MQE allows users to do simple query-stage calculation like well known PromQL.
+
+enum ExpressionResultType {
+    # Can't resolve the type of the given expression.
+    UNKNOWN
+    # A single value
+    SINGLE_VALUE
+    # A collection of time-series values.
+    # The value could have labels or not.
+    TIME_SERIES_VALUES
+    # A collection of aggregated values through metric sort function
+    SORTED_LIST
+    # A collection of sampled records.
+    # When the original metric type is sampled records
+    RECORD_LIST
+}
+
+type MQEValues {
+    labels: [String!]!

Review Comment:
   @wankai123 We should have a discussion about value label should be `String` or `KV`?



-- 
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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-query-protocol] wu-sheng commented on a diff in pull request #113: SkyWalking Metrics Query Expression(MQE) protocol

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on code in PR #113:
URL: https://github.com/apache/skywalking-query-protocol/pull/113#discussion_r1186994259


##########
metrics-expression.graphqls:
##########
@@ -0,0 +1,73 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# SkyWalking Metrics Query Expression(MQE) is an extension query mechanism.
+# MQE allows users to do simple query-stage calculation like well known PromQL.
+
+enum ExpressionResultType {
+    # Can't resolve the type of the given expression.
+    UNKNOWN
+    # A single value
+    SINGLE_VALUE
+    # A collection of time-series values.
+    # The value could have labels or not.
+    TIME_SERIES_VALUES
+    # A collection of aggregated values through metric sort function
+    SORTED_LIST
+    # A collection of sampled records.
+    # When the original metric type is sampled records
+    RECORD_LIST
+}
+
+type MQEValue {
+    id: ID!
+    value: String!
+    isEmptyValue: Boolean!
+    # Sampled record could associate with a trace.
+    # This would be a trace ID only.
+    traceID: ID
+}
+
+type MQEValues {
+    # The metadata description of this value series.
+    metric: Metadata!

Review Comment:
   @Fine0830 The metadata in the `ExpressionResult` maybe(we will determine later) include 1. one metric name with different labels and value series, or 2. multiple metric names with their labels and value series.



-- 
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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-query-protocol] wu-sheng commented on a diff in pull request #113: SkyWalking Metrics Query Expression(MQE) protocol

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on code in PR #113:
URL: https://github.com/apache/skywalking-query-protocol/pull/113#discussion_r1186672107


##########
metrics-expression.graphqls:
##########
@@ -0,0 +1,62 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# SkyWalking Metrics Query Expression(MQE) is an extension query mechanism.
+# MQE allows users to do simple query-stage calculation like well known PromQL.
+
+enum ExpressionResultType {
+    # Can't resolve the type of the given expression.
+    UNKNOWN
+    # A single value
+    SINGLE_VALUE
+    # A collection of time-series values.
+    # The value could have labels or not.
+    TIME_SERIES_VALUES
+    # A collection of aggregated or sampled values.
+    # When the original metric type is sampled records or through metric sorting
+    LIST
+}
+
+type MQEValues {
+    labels: [String!]!
+    # 1. When the type == SINGLE_VALUE, values only have one value.
+    # 2. When the type == TIME_SERIES_VALUES, values would match the given elements in the duration range.
+    # 3. When the type == LIST, values could be
+    #    3.1 sampled records
+    #    3.2 results of `sort(metric)`
+    values: [MQEValue!]!
+}
+
+type MQEValue {
+    id: ID!
+    value: String!
+    isEmptyValue: Boolean!
+    # Sampled record could associate with a trace.
+    # This would be a trace ID only.
+    attachmentID: ID!

Review Comment:
   <img width="1266" alt="image" src="https://user-images.githubusercontent.com/5441976/236616479-926a2c28-ebae-4be3-9948-3effc96ebe49.png">
   



-- 
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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-query-protocol] wu-sheng merged pull request #113: SkyWalking Metrics Query Expression(MQE) protocol

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng merged PR #113:
URL: https://github.com/apache/skywalking-query-protocol/pull/113


-- 
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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-query-protocol] wu-sheng commented on a diff in pull request #113: SkyWalking Metrics Query Expression(MQE) protocol

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on code in PR #113:
URL: https://github.com/apache/skywalking-query-protocol/pull/113#discussion_r1186669632


##########
metrics-expression.graphqls:
##########
@@ -0,0 +1,62 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# SkyWalking Metrics Query Expression(MQE) is an extension query mechanism.
+# MQE allows users to do simple query-stage calculation like well known PromQL.
+
+enum ExpressionResultType {
+    # Can't resolve the type of the given expression.
+    UNKNOWN
+    # A single value
+    SINGLE_VALUE
+    # A collection of time-series values.
+    # The value could have labels or not.
+    TIME_SERIES_VALUES
+    # A collection of aggregated or sampled values.
+    # When the original metric type is sampled records or through metric sorting
+    LIST
+}
+
+type MQEValues {
+    labels: [String!]!
+    # 1. When the type == SINGLE_VALUE, values only have one value.
+    # 2. When the type == TIME_SERIES_VALUES, values would match the given elements in the duration range.
+    # 3. When the type == LIST, values could be
+    #    3.1 sampled records
+    #    3.2 results of `sort(metric)`
+    values: [MQEValue!]!
+}
+
+type MQEValue {
+    id: ID!
+    value: String!
+    isEmptyValue: Boolean!
+    # Sampled record could associate with a trace.
+    # This would be a trace ID only.
+    attachmentID: ID!

Review Comment:
   I am not certain about this name too. The only reason is, the field name in the sampled record query would be `refId`.



-- 
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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-query-protocol] Fine0830 commented on a diff in pull request #113: SkyWalking Metrics Query Expression(MQE) protocol

Posted by "Fine0830 (via GitHub)" <gi...@apache.org>.
Fine0830 commented on code in PR #113:
URL: https://github.com/apache/skywalking-query-protocol/pull/113#discussion_r1186678406


##########
metrics-expression.graphqls:
##########
@@ -0,0 +1,63 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# SkyWalking Metrics Query Expression(MQE) is an extension query mechanism.
+# MQE allows users to do simple query-stage calculation like well known PromQL.
+
+enum ExpressionResultType {
+    # Can't resolve the type of the given expression.
+    UNKNOWN
+    # A single value
+    SINGLE_VALUE
+    # A collection of time-series values.
+    # The value could have labels or not.
+    TIME_SERIES_VALUES
+    # A collection of aggregated values through metric sort function
+    SORTED_LIST
+    # A collection of sampled records.
+    # When the original metric type is sampled records
+    RECORD_LIST
+}

Review Comment:
   Good to me.
   



-- 
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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org