redis

package
v0.0.0-...-5655933 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2023 License: MIT Imports: 14 Imported by: 0

README

redis

redis 的监控原理,就是连上 redis,执行 info 命令,解析结果,整理成监控数据上报。

Configuration

redis 插件的配置在 conf/input.redis/redis.toml 最简单的配置如下:

[[instances]]
address = "127.0.0.1:6379"
username = ""
password = ""
labels = { instance="n9e-10.23.25.2:6379" }

如果要监控多个 redis 实例,就增加 instances 即可:

[[instances]]
address = "10.23.25.2:6379"
username = ""
password = ""
labels = { instance="n9e-10.23.25.2:6379" }

[[instances]]
address = "10.23.25.3:6379"
username = ""
password = ""
labels = { instance="n9e-10.23.25.3:6379" }

建议通过 labels 配置附加一个 instance 标签,便于后面复用监控大盘。

监控大盘和告警规则

该 README 的同级目录下,提供了 dashboard.json 就是监控大盘的配置,alerts.json 是告警规则,可以导入夜莺使用。

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Command []interface{} `toml:"command"`
	Metric  string        `toml:"metric"`
}

type Instance

type Instance struct {
	config.InstanceConfig

	Address  string    `toml:"address"`
	Username string    `toml:"username"`
	Password string    `toml:"password"`
	PoolSize int       `toml:"pool_size"`
	Commands []Command `toml:"commands"`

	tls.ClientConfig
	// contains filtered or unexported fields
}

func (*Instance) Gather

func (ins *Instance) Gather(slist *types.SampleList)

func (*Instance) Init

func (ins *Instance) Init() error

type Redis

type Redis struct {
	config.PluginConfig
	Instances []*Instance `toml:"instances"`
}

func (*Redis) Clone

func (r *Redis) Clone() inputs.Input

func (*Redis) Drop

func (r *Redis) Drop()

func (*Redis) GetInstances

func (r *Redis) GetInstances() []inputs.Instance

func (*Redis) Name

func (r *Redis) Name() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL