From 05991f34a66fdc41af32fff04fd88625f32ed1c2 Mon Sep 17 00:00:00 2001 From: mrproliu <741550557@qq.com> Date: Tue, 21 Dec 2021 15:24:13 +0800 Subject: [PATCH] Change using service lebel metrics (#8319) --- .../meter-analyzer-config/satellite.yaml | 30 +++++++++---------- .../expected/satellite-service-instance.yml | 24 --------------- test/e2e-v2/cases/so11y/satellite-cases.yaml | 9 ++---- 3 files changed, 18 insertions(+), 45 deletions(-) delete mode 100644 test/e2e-v2/cases/so11y/expected/satellite-service-instance.yml diff --git a/oap-server/server-starter/src/main/resources/meter-analyzer-config/satellite.yaml b/oap-server/server-starter/src/main/resources/meter-analyzer-config/satellite.yaml index 0222bf1f87..ca6fff7f2e 100644 --- a/oap-server/server-starter/src/main/resources/meter-analyzer-config/satellite.yaml +++ b/oap-server/server-starter/src/main/resources/meter-analyzer-config/satellite.yaml @@ -13,22 +13,22 @@ # See the License for the specific language governing permissions and # limitations under the License. -expSuffix: tag({tags -> tags.service = 'satellite::' + tags.service}).instance(['service'], ['instance']) +expSuffix: tag({tags -> tags.service = 'satellite::' + tags.service}).service(['service']) metricPrefix: satellite metricsRules: - - name: instance_receive_event_count - exp: sw_stl_gatherer_receive_count.sum(["pipe", "status", "service", "instance"]).increase("PT1M") - - name: instance_fetch_event_count - exp: sw_stl_gatherer_fetch_count.sum(["pipe", "status", "service", "instance"]).increase("PT1M") - - name: instance_queue_input_count - exp: sw_stl_queue_output_count.sum(["pipe", "status", "service", "instance"]).increase("PT1M") - - name: instance_send_event_count - exp: sw_stl_sender_output_count.sum(["pipe", "status", "service", "instance"]).increase("PT1M") - - name: instance_queue_total_capacity - exp: sw_stl_pipeline_queue_total_capacity.sum(["pipeline", "service", "instance"]) - - name: instance_queue_used_count - exp: sw_stl_pipeline_queue_partition_size.sum(["pipeline", "service", "instance"]) - - name: instance_server_cpu_utilization + - name: service_receive_event_count + exp: sw_stl_gatherer_receive_count.sum(["pipe", "status", "service"]).increase("PT1M") + - name: service_fetch_event_count + exp: sw_stl_gatherer_fetch_count.sum(["pipe", "status", "service"]).increase("PT1M") + - name: service_queue_input_count + exp: sw_stl_queue_output_count.sum(["pipe", "status", "service"]).increase("PT1M") + - name: service_send_event_count + exp: sw_stl_sender_output_count.sum(["pipe", "status", "service"]).increase("PT1M") + - name: service_queue_total_capacity + exp: sw_stl_pipeline_queue_total_capacity.sum(["pipeline", "service"]) + - name: service_queue_used_count + exp: sw_stl_pipeline_queue_partition_size.sum(["pipeline", "service"]) + - name: service_server_cpu_utilization exp: sw_stl_grpc_server_cpu_gauge - - name: instance_grpc_connect_count + - name: service_grpc_connect_count exp: sw_stl_grpc_server_connection_count \ No newline at end of file diff --git a/test/e2e-v2/cases/so11y/expected/satellite-service-instance.yml b/test/e2e-v2/cases/so11y/expected/satellite-service-instance.yml deleted file mode 100644 index 049b017fdf..0000000000 --- a/test/e2e-v2/cases/so11y/expected/satellite-service-instance.yml +++ /dev/null @@ -1,24 +0,0 @@ -# Licensed to 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. Apache Software Foundation (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. - -{{- contains .}} -- id: {{ b64enc "satellite::satellite-service" }}.1_{{ b64enc "satellite-instance" }} - name: satellite-instance - attributes: [] - language: UNKNOWN - instanceuuid: {{ b64enc "satellite::satellite-service" }}.1_{{ b64enc "satellite-instance" }} -{{- end}} \ No newline at end of file diff --git a/test/e2e-v2/cases/so11y/satellite-cases.yaml b/test/e2e-v2/cases/so11y/satellite-cases.yaml index a381a6ca71..9bbeffb7fd 100644 --- a/test/e2e-v2/cases/so11y/satellite-cases.yaml +++ b/test/e2e-v2/cases/so11y/satellite-cases.yaml @@ -17,11 +17,8 @@ # service list - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls expected: expected/satellite-service.yml - # service instance list - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=satellite::satellite-service - expected: expected/satellite-service-instance.yml - # service instance metrics - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=satellite_instance_server_cpu_utilization --instance-name=satellite-instance --service-name=satellite::satellite-service |yq e 'to_entries' - + # service metrics + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=satellite_service_server_cpu_utilization --service-name=satellite::satellite-service |yq e 'to_entries' - expected: expected/metrics-has-value.yml - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=satellite_instance_grpc_connect_count --instance-name=satellite-instance --service-name=satellite::satellite-service |yq e 'to_entries' - + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=satellite_service_grpc_connect_count --service-name=satellite::satellite-service |yq e 'to_entries' - expected: expected/metrics-has-value.yml \ No newline at end of file -- GitLab