wankai123 commented on code in PR #10655: URL: https://github.com/apache/skywalking/pull/10655#discussion_r1160364183
########## oap-server/server-starter/src/main/resources/otel-rules/redis/redis-service.yaml: ########## @@ -0,0 +1,68 @@ +# 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. + +# This will parse a textual representation of a duration. The formats +# accepted are based on the ISO-8601 duration format {@code PnDTnHnMn.nS} +# with days considered to be exactly 24 hours. +# <p> +# Examples: +# <pre> +# "PT20.345S" -- parses as "20.345 seconds" +# "PT15M" -- parses as "15 minutes" (where a minute is 60 seconds) +# "PT10H" -- parses as "10 hours" (where an hour is 3600 seconds) +# "P2D" -- parses as "2 days" (where a day is 24 hours or 86400 seconds) +# "P2DT3H4M" -- parses as "2 days, 3 hours and 4 minutes" +# "P-6H3M" -- parses as "-6 hours and +3 minutes" +# "-P6H3M" -- parses as "-6 hours and -3 minutes" +# "-P-6H+3M" -- parses as "+6 hours and -3 minutes" +# </pre> +filter: "{ tags -> tags.job_name == 'redis-monitoring' }" # The OpenTelemetry job name +expSuffix: tag({tags -> tags.host_name = 'redis::' + tags.host_name}).service(['host_name'] , Layer.REDIS) +metricPrefix: meter_redis +metricsRules: + - name: uptime + exp: redis_uptime_in_seconds.max(['host_name']) + - name: connected_clients + exp: redis_connected_clients.sum(['host_name']) + - name: blocked_clients + exp: redis_blocked_clients.sum(['host_name']) + - name: memory_usage + exp: redis_memory_used_bytes * 100 / redis_memory_max_bytes + - name: memory_max_bytes + exp: redis_memory_max_bytes Review Comment: ``` - name: memory_usage exp: redis_memory_used_bytes * 100 / redis_memory_max_bytes - name: memory_max_bytes exp: redis_memory_max_bytes ``` These metrics are from the instances, right? Should sum for Service? ########## test/e2e-v2/cases/redis/expected/metrics-has-value.yml: ########## @@ -0,0 +1,19 @@ +# 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. + +{{- contains . }} +- key: {{ notEmpty .key }} + value: {{ ge .value 1 }} +{{- end }} Review Comment: The result structure changed, and I think that's why the e2e failed. Can refer to https://github.com/apache/skywalking/blob/d5daf71ae0cde12cb61ee5dd88639077834917b6/test/e2e-v2/cases/simple/expected/metrics-has-value.yml#L24 ########## oap-server/server-starter/src/main/resources/ui-initialized-templates/redis/redis-service.json: ########## @@ -0,0 +1,353 @@ +/** + * 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. + */ + +[ + { + "id":"redis-service", + "configuration":{ + "children":[ + { + "x":0, + "y":0, + "w":24, + "h":36, + "i":"0", + "type":"Tab", + "children":[ + { + "name":"Inspections", + "children":[ + { + "x":0, + "y":0, + "w":6, + "h":12, Review Comment: All the widgets should better keep the style consistent, the Card Widget can reduce height, can refer to https://github.com/apache/skywalking/blob/d5daf71ae0cde12cb61ee5dd88639077834917b6/oap-server/server-starter/src/main/resources/ui-initialized-templates/os_linux/linux-service.json#L375 -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
