blob: f2aa2e03f71ef60c405bd6ba8a3d4580144b30cb [file] [log] [blame]
# 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).instance(['host_name'], ['service_instance_id'], Layer.REDIS)
metricPrefix: meter_redis
metricsRules:
- name: instance_uptime
exp: redis_uptime_in_seconds
- name: instance_connected_clients
exp: redis_connected_clients
- name: instance_memory_max_bytes
exp: redis_memory_max_bytes
- name: instance_memory_usage
exp: redis_memory_used_bytes * 100 / redis_memory_max_bytes
- name: instance_total_commands_rate
exp: redis_commands_total.sum(['cmd','host_name','service_instance_id']).rate('PT1M')
- name: instance_hit_rate
exp: redis_keyspace_hits_total * 100 / (redis_keyspace_misses_total + redis_keyspace_hits_total)
- name: instance_net_input_bytes_total
exp: redis_net_input_bytes_total.rate('PT5M')
- name: instance_net_output_bytes_total
exp: redis_net_output_bytes_total.rate('PT5M')
- name: instance_db_keys
exp: redis_db_keys
- name: instance_expired_keys_total
exp: redis_expired_keys_total
- name: instance_evicted_keys_total
exp: redis_evicted_keys_total
- name: instance_redis_blocked_clients
exp: redis_blocked_clients
- name: instance_average_time_spent_by_command
exp: (redis_commands_duration_seconds_total.sum(['host_name','cmd','service_instance_id']) / redis_commands_total.sum(['host_name','cmd','service_instance_id'])).rate('PT1M')
- name: instance_commands_duration_seconds_total_rate
exp: redis_commands_duration_seconds_total.sum(['host_name','cmd','service_instance_id']).rate('PT1M')