Project: SkyWalking (Observability and Analysis / Observability)
File: backend-redis-monitoring.md

SkyWalking leverages redis-exporter for collecting metrics data from Redis. It leverages OpenTelemetry Collector to transfer the metrics to and into the . redis-exporter collect metrics data from Redis. OpenTelemetry Collector fetches metrics from redis-exporter via Prometheus Receiver and pushes metrics to SkyWalking OAP Server via OpenTelemetry gRPC exporter. The SkyWalking OAP Server parses the expression with to filter/calculate/aggregate and store the results. Set up . Set up . For details on Redis Receiver in OpenTelemetry Collector, refer to . Config SkyWalking . Redis monitoring provides monitoring of the status and resources of the Redis server. Redis cluster is cataloged as a `Layer: REDIS` `Service` in OAP. Each Redis server is cataloged as an `Instance` in OAP. | Monitoring Panel | Unit | Metric Name | Description | Data Source | |--|--|--|-|-| | Uptime | day | meterredisuptime | The uptime of Redis. | redis-exporter | | Connected Clients | | meterredisconnected_clients | The number of connected clients. | redis-exporter | | Blocked Clients | | meterredisblocked_clients | The number of blocked clients. | redis-exporter | | Memory Max Bytes | MB | meterredismemorymaxbytes | The max bytes of memory. | redis-exporter | | Hits Rate | % | meterredishit_rate | Hit rate of redis when used as a cache. | redis-exporter | | Average Time Spend By Command | second | meterredisaveragetimespentbycommand | Average time to execute various types of commands. | redis-exporter | | Total Commands Trend | | meterredistotalcommandsrate | The Trend of total commands. | redis-exporter | | DB keys | | meterredisevictedkeystotal </br> meterredisexpiredkeystotal </br> meterredisdb_keys | The number of Expired / Evicted / total keys. | redis-exporter | | Net Input/Output Bytes | KB | meterredisnetinputbytes </br> meterredisnetoutputbytes | Total bytes of input / output of redis net. | redis-exporter | | Memory Usage | % | meterredismemoryusedbytes </br> meterredismemorymaxbytes | Percentage of used

| redis-exporter | | Total Time Spend By Command Trend | | meterrediscommandsduration </br> meterrediscommandstotal | The trend of total time spend by command | redis-exporter | You can customize your own metrics/expression/dashboard panel. The metrics definition and expression rules are found in `/config/otel-rules/redis`. The Redis dashboard panel configurations are found in `/config/ui-initialized-templates/redis`. SkyWalking leverages or other log agents for collecting slow commands from Redis. Execute periodically to collect slow logs from Redis and save the result locally. Fluent-bit agent collects slow logs from local file. fluent-bit agent sends data to SkyWalking OAP Server using native meter APIs via HTTP. The SkyWalking OAP Server parses the expression with to parse/extract and store the results. Set up . Config fluentbit from for Redis. Config slow log from for Redis. Periodically execute the . Notice: 1.The `slowlog-log-slower-than` and `slowlog-max-len` configuration items in the configuration file are for the slow log, the former indicating that execution time longer than the specified time (in milliseconds) will be logged to the slowlog, and the latter indicating the maximum number of slow logs that will be stored in the slow log file. 2.In the e2e test, SkyWalking uses cron to periodically execute the redis command to fetch the slow logs and write them to a local file, which is then collected by fluent-bit to send the data to the OAP. You can see the relevant configuration files .You can also get slow logs periodically and send them to OAP in other ways than using cron and fluent-bit. Slow SQL monitoring provides monitoring of the slow commands of the Redis servers. Redis servers are cataloged as a `Layer: REDIS` `Service` in OAP. | Monitoring Panel | Unit | Metric Name | Description | Data Source | |--||--|--|--| |Slow Statements | ms | topndatabase_statement | The latency and statement of Redis slow commands | fluentbit| You can customize your own metrics/expression/dashboard panel. The slowsql expression rules are found in `/config/lal/redis-slowsql.yaml` The Redis dashboard panel configurations are found in `/config/ui-initialized-templates/redis`. `