This is an automated email from the ASF dual-hosted git repository.
wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-query-protocol.git
The following commit(s) were added to refs/heads/master by this push:
new 957b012 add metrics-v3 and deprecate v2 (#117)
957b012 is described below
commit 957b0120af74dde1b2fca2449914739bd97c435f
Author: Wan Kai <[email protected]>
AuthorDate: Mon Jun 5 16:04:07 2023 +0800
add metrics-v3 and deprecate v2 (#117)
---
metrics-v2.graphqls | 32 ++++------------------
metrics-expression.graphqls => metrics-v3.graphqls | 30 ++++++++++++++++++++
record.graphqls | 3 +-
3 files changed, 37 insertions(+), 28 deletions(-)
diff --git a/metrics-v2.graphqls b/metrics-v2.graphqls
index a55ad25..cb26ce5 100644
--- a/metrics-v2.graphqls
+++ b/metrics-v2.graphqls
@@ -14,6 +14,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+# Legacy metrics query protocol deprecated since 9.5.0. Replaced by the
metrics-v3.
+
# Metrics v2 query protocol is an alternative metrics query(s) of original v1,
# defined in the metric.graphql, top-n-records.graphqls, and
aggregation.graphqls.
# By leveraging the new ID rule(no register) in the v8, we could query metrics
based on name(s) directly.
@@ -33,31 +35,6 @@ enum MetricsType {
SAMPLED_RECORD
}
-input Entity {
- # Deprecated from 9.4.0
- # Scope could be sensed automatically through given metric name.
- scope: Scope
- # 1. metrics Scope=Service, ServiceInstance and Endpoint, set necessary
serviceName/serviceInstanceName/endpointName
- # 2. metrics Scope=ServiceRelation, ServiceInstanceRelation,
EndpointRelation and ProcessRelation
- # serviceName/serviceInstanceName/endpointName/processName is/are the
source(s)
- #
destServiceName/destServiceInstanceName/destEndpointName/destProcessName is/are
destination(s)
- # set necessary names of sources and destinations.
- serviceName: String
- # Normal service is the service having installed agent or metrics reported
directly.
- # Unnormal service is conjectural service, usually detected by the agent.
- normal: Boolean
- serviceInstanceName: String
- endpointName: String
- processName: String
- destServiceName: String
- # Normal service is the service having installed agent or metrics reported
directly.
- # Unnormal service is conjectural service, usually detected by the agent.
- destNormal: Boolean
- destServiceInstanceName: String
- destEndpointName: String
- destProcessName: String
-}
-
input MetricsCondition {
# Metrics name, which should be defined in OAL script
# Such as:
@@ -148,11 +125,12 @@ type NullableValue {
}
extend type Query {
+ # Since 9.5.0 `typeOfMetrics` and `listMetrics` are moved to metrics-v3.
# Metrics definition metadata query. Response the metrics type which
determines the suitable query methods.
- typeOfMetrics(name: String!): MetricsType!
+ # typeOfMetrics(name: String!): MetricsType!
# Get the list of all available metrics in the current OAP server.
# Param, regex, could be used to filter the metrics by name.
- listMetrics(regex: String): [MetricDefinition!]!
+ # listMetrics(regex: String): [MetricDefinition!]!
# Read metrics single value in the duration of required metrics
readMetricsValue(condition: MetricsCondition!, duration: Duration!): Long!
diff --git a/metrics-expression.graphqls b/metrics-v3.graphqls
similarity index 65%
rename from metrics-expression.graphqls
rename to metrics-v3.graphqls
index 47b2ad9..b2ecc34 100644
--- a/metrics-expression.graphqls
+++ b/metrics-v3.graphqls
@@ -17,6 +17,31 @@
# SkyWalking Metrics Query Expression(MQE) is an extension query mechanism.
# MQE allows users to do simple query-stage calculation like well known PromQL.
+input Entity {
+ # Deprecated from 9.4.0
+ # Scope could be sensed automatically through given metric name.
+ scope: Scope
+ # 1. metrics Scope=Service, ServiceInstance and Endpoint, set necessary
serviceName/serviceInstanceName/endpointName
+ # 2. metrics Scope=ServiceRelation, ServiceInstanceRelation,
EndpointRelation and ProcessRelation
+ # serviceName/serviceInstanceName/endpointName/processName is/are the
source(s)
+ #
destServiceName/destServiceInstanceName/destEndpointName/destProcessName is/are
destination(s)
+ # set necessary names of sources and destinations.
+ serviceName: String
+ # Normal service is the service having installed agent or metrics reported
directly.
+ # Unnormal service is conjectural service, usually detected by the agent.
+ normal: Boolean
+ serviceInstanceName: String
+ endpointName: String
+ processName: String
+ destServiceName: String
+ # Normal service is the service having installed agent or metrics reported
directly.
+ # Unnormal service is conjectural service, usually detected by the agent.
+ destNormal: Boolean
+ destServiceInstanceName: String
+ destEndpointName: String
+ destProcessName: String
+}
+
enum ExpressionResultType {
# Can't resolve the type of the given expression.
UNKNOWN
@@ -71,6 +96,11 @@ type ExpressionResult {
extend type Query {
+ # Metrics definition metadata query. Response the metrics type which
determines the suitable query methods.
+ typeOfMetrics(name: String!): MetricsType!
+ # Get the list of all available metrics in the current OAP server.
+ # Param, regex, could be used to filter the metrics by name.
+ listMetrics(regex: String): [MetricDefinition!]!
# The return type of the given expression, the MQEValues will be empty.
returnTypeOfMQE(expression: String!): ExpressionResult!
execExpression(expression: String!, entity: Entity!, duration: Duration!):
ExpressionResult!
diff --git a/record.graphqls b/record.graphqls
index ca5f1cb..9e4c412 100644
--- a/record.graphqls
+++ b/record.graphqls
@@ -14,6 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+# Legacy record query protocol deprecated since 9.5.0. Replaced by the
metrics-v3.
# Since 9.3.0
# Record is a general and abstract type for collected raw data.
# In the observability, traces and logs have specific and well-defined
meanings, and the general records represent other
@@ -44,4 +45,4 @@ type Record {
# Have value, Only if the record has related trace id.
# UI should show this as an attached value.
refId: ID
-}
\ No newline at end of file
+}