Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to carry out Prometheus redis Monitoring

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

How to carry out Prometheus redis monitoring, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.

Brief introduction

Redis_exporter is an application that collects redis service metrics.

Download and run

Wget-c-t 100 https://github.com/oliver006/redis_exporter/releases/download/v1.15.0/redis_exporter-v1.15.0.linux-amd64.tar.gz

Tar zxvf redis_exporter-v1.15.0.linux-amd64.tar.gz

Cd redis_exporter-v1.15.0.linux-amd64

. / redis_exporter

INFO [0000] Redis Metrics Exporter v1.15.0 build date: 2020-12-27-18:57:05 sha1: 43ec65f7a22041e64ec557291c36500d04c6f6b0 Go: go1.15.6 GOOS: linux GOARCH: amd64 INFO [0000] Providing metrics at: 9121/metrics

The default port is 9121 and the default link is redis://localhost:6379

If you set a password, you need to specify the password at execution time

. / redis_exporter-redis.addr 'redis://localhost:6379'-redis.password redispassword

View more parameters

. / redis_exporter-h

Usage of. / redis_exporter:-check-key-groups string Comma separated list of lua regex for grouping keys-check-key-groups-batch-size int Check key groups batch size hint for the underlying SCAN (default 10000)-check-keys string Comma separated list of key-patterns to export value and length/size Searched for with SCAN-check-single-keys string Comma separated list of single keys to export value and length/size-check-single-streams string Comma separated list of single streams to export info about streams, groups and consumers-check-streams string Comma separated list of stream-patterns to export info about streams, groups and consumers Searched for with SCAN-config-command string What to use for the CONFIG command (default "CONFIG")-connection-timeout string Timeout for connection to Redis instance (default "15s")-count-keys string Comma separated list of patterns to count, eg: 'db3=sessions:*'. Warning: The exporter runs SCAN to count the keys. -debug Output verbose debug information-export-client-list Whether to scrape Client List specific metrics-export-client-port Whether to include the client's port when exporting the client list. Warning: including the port increases the number of metrics generated and will make your Prometheus server take up more memory-include-system-metrics Whether to include system metrics like e.g. Redis_total_system_memory_bytes-is-tile38 Whether to scrape Tile38 specific metrics-log-format string Log format, valid options are txt and json (default "txt")-max-distinct-key-groups int The maximum number of distinct key groups with the most memory utilization to present as distinct metrics per database The leftover key groups will be aggregated in the 'overflow' bucket (default 100)-namespace string Namespace for metrics (default "redis")-ping-on-connect Whether to ping the redis instance after connecting-redis-only-metrics Whether to also export go runtime metrics-redis.addr string Address of the Redis instance to scrape (default "redis://localhost:6379")-redis.password string Password of the Redis instance to scrape -redis.user string User name to use for authentication (Redis ACL for Redis 6.0and newer)-script string Path to Lua Redis script for collecting extra metrics-set-client-name Whether to set client name to redis_exporter (default true)-skip-tls-verification Whether to to skip TLS verification-tls-ca-cert-file string Name of the CA certificate file (including full path) if the server requires TLS client authentication -tls-client-cert-file string Name of the client certificate file (including full path) if the server requires TLS client authentication-tls-client-key-file string Name of the client key file (including full path) if the server requires TLS client authentication-tls-server-cert-file string Name of the server certificate file (including full path) if the web interface and telemetry should use TLS-tls-server-key-file string Name of the server key file (including full Path) if the web interface and telemetry should use TLS-version Show version information and exit-web.listen-address string Address to listen on for web interface and telemetry. (default ": 9121")-web.telemetry-path string Path under which to expose metrics. (default "/ metrics")

Deployment script

#! / bin/bash VERSION= "1.15.0" wget-t 100-c https://github.com/oliver006/redis_exporter/releases/download/v${VERSION}/redis_exporter-${VERSION}.linux-amd64.tar.gz if [!-e redis_exporter-$ {VERSION}. Linux-amd64.tar.gz] then echo "installation package download failed" exit 1 fi tar xvfz redis_exporter-$ {VERSION} .linux-amd64.tar .gz-C / opt/ cd / opt ln-s redis_exporter-$ {VERSION} .linux-amd64 redis_exporter cat > / etc/systemd/system/redis_exporter.service

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report