SampleConfig (redis/redis.go)

telegraf · plugins/inputs/redis/redis.go · go · MIT
database

Telegraf Redis input plugin gathering metrics from Redis servers.

// Source: https://github.com/influxdata/telegraf | License: MIT | Copyright 2015-2025 InfluxData Inc
// Provided via justclaw.it.com; keep this notice with the code.
//go:generate ../../../tools/readme_config_includer/generator
package redis

import (
	"bufio"
	"context"
	_ "embed"
	"fmt"
	"io"
	"maps"
	"net/url"
	"reflect"
	"regexp"
	"strconv"
	"strings"
	"sync"
	"time"

	"github.com/go-redis/redis/v8"

	"github.com/influxdata/telegraf"
	"github.com/influxdata/telegraf/plugins/common/tls"
	"github.com/influxdata/telegraf/plugins/inputs"
)

//go:embed sample.conf
var sampleConfig string

var (
	replicationSlaveMetricPrefix = regexp.MustCompile(`^slave\d+`)
	tracking                     = map[string]string{
		"uptime_in_seconds": "uptime",
		"connected_clients": "clients",
		"role":       

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key