Calculate Nginx service HTTP Latency by MQE. (#12136)

This commit is contained in:
weixiang1862 2024-04-19 19:12:36 +08:00 committed by GitHub
parent 7e978261fc
commit d6fc848e8b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 41 additions and 3 deletions

View File

@ -110,6 +110,7 @@
* Support Apache ActiveMQ server monitoring.
* Add Service Hierarchy auto matching layer relationships (upper -> lower) as following:
- ACTIVEMQ -> K8S_SERVICE
* Calculate Nginx service HTTP Latency by MQE.
#### UI

View File

@ -36,7 +36,7 @@ metricsRules:
- name: http_requests
exp: nginx_http_requests_total.sum(['service','service_instance_id']).rate('PT1M')
- name: http_latency
exp: nginx_http_latency.sum(['le','service']).histogram().histogram_percentile([50,70,90,99])
exp: nginx_http_latency.sum(['le','service','service_instance_id']).histogram().histogram_percentile([50,70,90,99])
- name: http_bandwidth
exp: nginx_http_size_bytes.sum(['type','service','service_instance_id']).rate('PT1M')
- name: http_connections

View File

@ -60,7 +60,7 @@
"showYAxis": true
},
"expressions": [
"meter_nginx_service_http_latency"
"aggregate_labels(meter_nginx_service_http_latency, avg(p))"
]
},
{

View File

@ -49,7 +49,7 @@ verify:
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_nginx_service_http_requests --service-name=nginx::e2e-test
expected: expected/metrics-has-value-label-service_instance_id.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_nginx_service_http_latency --service-name=nginx::e2e-test
expected: expected/metrics-has-value-label-percentile.yml
expected: expected/metrics-has-value-label-percentile-service_instance_id.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_nginx_service_http_bandwidth --service-name=nginx::e2e-test
expected: expected/metrics-has-value-label-type-service_instance_id.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_nginx_service_http_connections --service-name=nginx::e2e-test

View File

@ -0,0 +1,37 @@
# 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.
type: TIME_SERIES_VALUES
results:
{{- contains .results }}
- metric:
labels:
{{- contains .metric.labels }}
- key: p
value: {{ .value }}
- key: service_instance_id
value: {{ .value }}
{{- end}}
values:
{{- contains .values }}
- id: {{ notEmpty .id }}
value: {{ .value }}
traceid: null
- id: {{ notEmpty .id }}
value: null
traceid: null
{{- end}}
{{- end}}
error: null