Documentation
¶
Overview ¶
Package integrations holds the integration manifests (what a product looks like, what to alert on) and the database, queue and service collectors that feed them. Credentials and addresses come only from the agent's own config file; remote config may switch a module on or off and change its interval (see modules_infra.go).
Index ¶
- Constants
- func ActiveMQ(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func Artemis(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func Backup(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func BullMQ(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func Cassandra(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func Ceph(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func ClickHouse(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func CockroachDB(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func CollectCockroachDB(ctx context.Context, db *sql.DB, out sink.Sink, now time.Time) error
- func CollectKafka(ctx context.Context, adm *kadm.Client, groups []string, st *KafkaState, ...) error
- func CollectMSSQL(ctx context.Context, db *sql.DB, out sink.Sink, now time.Time) error
- func CollectMSSQLPlans(ctx context.Context, db *sql.DB, out sink.Sink, now time.Time) error
- func CollectMSSQLSchema(ctx context.Context, db *sql.DB, out sink.Sink, now time.Time) error
- func CollectMySQL(ctx context.Context, db *sql.DB, out sink.Sink, now time.Time) error
- func CollectMySQLPlans(ctx context.Context, db *sql.DB, out sink.Sink, now time.Time) error
- func CollectMySQLSchema(ctx context.Context, db *sql.DB, out sink.Sink, now time.Time) error
- func CollectOracle(ctx context.Context, db *sql.DB, out sink.Sink, now time.Time) error
- func CollectPlans(ctx context.Context, dsn string, out sink.Sink, now time.Time) error
- func CollectPostgres(ctx context.Context, dsn string, out sink.Sink, now time.Time) error
- func CollectSQLiteFile(out sink.Sink, path string, gen map[string]sqliteGen, now time.Time) error
- func CollectSchema(ctx context.Context, dsn string, out sink.Sink, now time.Time) error
- func CollectStatementDeltas(ctx context.Context, dsn string, d *dbm.Deltas, out sink.Sink, now time.Time) error
- func CollectTiDB(ctx context.Context, db *sql.DB, st *tidbState, out sink.Sink, now time.Time) error
- func CollectYugabyteDB(ctx context.Context, db *sql.DB, out sink.Sink, now time.Time) error
- func Consul(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func CouchDB(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func Couchbase(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func CypherSafe(q string) string
- func DBSlowLog(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func Databricks(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func Dnsmasq(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func Docker(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func EMQX(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func Elasticsearch(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func EmitApache(out sink.Sink, b []byte, now time.Time) error
- func EmitCRDB(out sink.Sink, kind string, rows []map[string]string, now time.Time)
- func EmitCRDBStatements(out sink.Sink, d *dbm.Deltas, rows []map[string]string, now time.Time) []dbm.StatementDelta
- func EmitCassandraJMX(out sink.Sink, rs []jolokiaResp, now time.Time)
- func EmitClickHouseHealth(out sink.Sink, kind string, body []byte, now time.Time) error
- func EmitClickHouseQueries(out sink.Sink, body []byte, now time.Time) error
- func EmitClusterInfo(out sink.Sink, ci map[string]string, now time.Time)
- func EmitCollStats(out sink.Sink, db, coll string, rows []bson.D, now time.Time)
- func EmitCouchDB(out sink.Sink, db string, info map[string]any, now time.Time)
- func EmitCouchReplications(out sink.Sink, docs []map[string]any, now time.Time)
- func EmitCouchStats(out sink.Sink, stats map[string]any, now time.Time) int
- func EmitCouchTasks(out sink.Sink, tasks []map[string]any, now time.Time)
- func EmitCurrentOp(out sink.Sink, ops []bson.D, now time.Time)
- func EmitDocker(out sink.Sink, body []byte, now time.Time) error
- func EmitDumpFiles(out sink.Sink, f DumpFiles, now time.Time) error
- func EmitEMQXAlarms(out sink.Sink, body []byte, now time.Time) error
- func EmitEMQXMetrics(out sink.Sink, body []byte, now time.Time) error
- func EmitEMQXNodes(out sink.Sink, body []byte, now time.Time) error
- func EmitEMQXStats(out sink.Sink, body []byte, now time.Time) error
- func EmitESAllocation(out sink.Sink, sys string, ex map[string]any, now time.Time)
- func EmitESHotThreads(out sink.Sink, sys, report string, now time.Time)
- func EmitESNodes(out sink.Sink, ns esNodeStats, now time.Time)
- func EmitESShards(out sink.Sink, shards []map[string]string, now time.Time) int
- func EmitESTasks(out sink.Sink, sys string, t esTasks, now time.Time)
- func EmitElasticsearch(out sink.Sink, b []byte, now time.Time) error
- func EmitElasticsearchIndices(out sink.Sink, idx []map[string]string, now time.Time)
- func EmitEtcdDerived(out sink.Sink, fams map[string]*dto.MetricFamily, ...)
- func EmitFamilies(out sink.Sink, fams map[string]*dto.MetricFamily, prefixes []string, ...)
- func EmitHAProxy(out sink.Sink, b []byte, now time.Time) error
- func EmitIndexStats(out sink.Sink, db, coll string, rows []bson.D, now time.Time)
- func EmitJenkins(out sink.Sink, comp, queue, jobs []byte, now time.Time) error
- func EmitKeyPatterns(out sink.Sink, sys string, keys []string, sizes, freqs []int64, dbKeys float64, ...)
- func EmitLatencyLatest(out sink.Sink, v any, now time.Time)
- func EmitMSSQLQueryStats(out sink.Sink, d *dbm.Deltas, rows []map[string]string, now time.Time)
- func EmitMSSQLQueryStore(out sink.Sink, rows []map[string]string, now time.Time)
- func EmitMSSQLRegressions(out sink.Sink, rows []map[string]string, now time.Time)
- func EmitMemcached(out sink.Sink, st map[string]string, now time.Time)
- func EmitMemcachedSlabs(out sink.Sink, slabs, items map[string]string, now time.Time)
- func EmitMemoryDoctor(out sink.Sink, sys, report string, now time.Time)
- func EmitMongoPlan(out sink.Sink, e profEntry, reply bson.D, now time.Time)
- func EmitMosquittoSys(out sink.Sink, sys map[string]string, now time.Time)
- func EmitMySQLDigests(out sink.Sink, d *dbm.Deltas, rows []map[string]string, now time.Time)
- func EmitMySQLReplica(out sink.Sink, r map[string]string, now time.Time)
- func EmitNATSJsz(out sink.Sink, body []byte, now time.Time) error
- func EmitNATSVarz(out sink.Sink, body []byte, now time.Time) error
- func EmitNeo4j(out sink.Sink, r neo4jResult, slowMs int, now time.Time)
- func EmitNginx(out sink.Sink, b []byte, now time.Time) error
- func EmitOracleRound(out sink.Sink, rows []map[string]string, kind string, now time.Time)
- func EmitOracleSQL(out sink.Sink, d *dbm.Deltas, rows []map[string]string, now time.Time) []dbm.StatementDelta
- func EmitPgBackRest(out sink.Sink, p PgBackRest, b []byte, now time.Time) error
- func EmitPlan(out sink.Sink, engine, id, query, plan string, now time.Time)
- func EmitPulsarTopicStats(out sink.Sink, topic string, body []byte, now time.Time) error
- func EmitRabbitFederation(out sink.Sink, body []byte, now time.Time) error
- func EmitRabbitNodes(out sink.Sink, body []byte, now time.Time) error
- func EmitRabbitOverview(out sink.Sink, body []byte, now time.Time) error
- func EmitRabbitQueues(out sink.Sink, body []byte, now time.Time) error
- func EmitRabbitShovels(out sink.Sink, body []byte, now time.Time) error
- func EmitRabbitStreamConsumers(out sink.Sink, body []byte, now time.Time) error
- func EmitRedis(out sink.Sink, info map[string]string, now time.Time)
- func EmitRedisStats(out sink.Sink, info map[string]string, now time.Time)
- func EmitReplSet(out sink.Sink, rs any, now time.Time)
- func EmitSAPLongRunning(out sink.Sink, body []byte, minS int, now time.Time) error
- func EmitSAPProcesses(out sink.Sink, body []byte, now time.Time) error
- func EmitSAPQueues(out sink.Sink, body []byte, now time.Time) error
- func EmitSAPWorkProcesses(out sink.Sink, body []byte, now time.Time) error
- func EmitSchema(out sink.Sink, engine string, order []string, tables map[string][]string, ...)
- func EmitServerStatus(out sink.Sink, ss any, now time.Time) bool
- func EmitSlowQuery(out sink.Sink, engine string, q SlowQuery, at time.Time)
- func EmitSnowflake(out sink.Sink, kind string, rows [][]any, now time.Time)
- func EmitSquid(out sink.Sink, b []byte, now time.Time) error
- func EmitTiDBDeadlocks(out sink.Sink, rows []map[string]string, seen map[string]bool, now time.Time)
- func EmitTiDBStatements(out sink.Sink, d *dbm.Deltas, rows []map[string]string, now time.Time) []dbm.StatementDelta
- func EmitTiDBStores(out sink.Sink, rows []map[string]string, now time.Time)
- func EmitWiredTiger(out sink.Sink, ss any, now time.Time)
- func EmitYB(out sink.Sink, kind string, rows []map[string]string, now time.Time)
- func EmitYBASH(out sink.Sink, rows []map[string]string, window time.Duration, now time.Time) time.Time
- func EmitYBStatements(out sink.Sink, d *dbm.Deltas, rows []map[string]string, now time.Time)
- func Envoy(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func Etcd(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func GitHub(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func GitLab(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func HTTPStatus(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func HyperV(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func IIS(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func IntervalQuantile(prev, cur []*dto.Bucket, q float64) (float64, bool)
- func Istio(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func JMX(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func Jenkins(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func JobFrameworks() []string
- func JobQueue(fw string) func(context.Context, json.RawMessage, sink.Sink) error
- func Kafka(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func Kinesis(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func Kong(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func Listen(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func Loop(ctx context.Context, name string, b Base, def time.Duration, out sink.Sink, ...) error
- func MSSQL(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func MSSQLActivity(rows []map[string]string) []dbm.Activity
- func MSSQLBlocking(out sink.Sink, rows []map[string]string, now time.Time)
- func Memcached(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func Milvus(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func MinIO(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func MongoDB(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func Mosquitto(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func MySQL(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func MySQLActivity(rows []map[string]string) []dbm.Activity
- func MySQLBlocking(out sink.Sink, rows []map[string]string, now time.Time)
- func NATS(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func Neo4j(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func Nomad(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func NormalizePodConfig(module string, cfg map[string]any) map[string]any
- func OplogWindow(first, last bson.Timestamp) float64
- func Oracle(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func OracleActivity(rows []map[string]string) []dbm.Activity
- func OraclePlanJSON(steps []OraclePlanStep) (string, error)
- func ParseRedisInfo(s string) map[string]string
- func PartitionHealth(ps kadm.PartitionDetails) (under, offline int)
- func Pinecone(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func Postgres(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func Pulsar(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func Qdrant(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func RabbitMQ(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func ReadMemcachedStats(r *bufio.Reader) (map[string]string, error)
- func RedactPlan(v any) (any, bool)
- func Redis(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func RedisSystem(info map[string]string) (string, string)
- func RunAnnotated(ctx context.Context, list func() []PodCheck, out sink.Sink, ...)
- func SAPControl(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func SQLite(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func ScrubShowplan(plan string) string
- func ScyllaDB(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func Snowflake(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func Solr(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func Squid(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func TiDB(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func Tomcat(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func Traefik(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func ValidateConfig(kind string, raw json.RawMessage) error
- func Vault(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func Weaviate(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func Windows(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func YugabyteDB(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- func Zookeeper(ctx context.Context, raw json.RawMessage, out sink.Sink) error
- type AlertDoc
- type BackupConfig
- type Base
- type BullMQConfig
- type Dependency
- type Detected
- type Discovery
- type DistSQLConfig
- type DnsmasqConfig
- type DockerConfig
- type DumpFiles
- type ExporterConfig
- type HTTPConfig
- type HTTPStatusConfig
- type JobQueueConfig
- type JolokiaConfig
- type KafkaConfig
- type KafkaState
- type ListenConfig
- type MBeanRead
- type MQTTConfig
- type MSSQLConfig
- type Manifest
- type MemcachedConfig
- type MetricDoc
- type ModuleRef
- type MongoConfig
- type MySQLConfig
- type MySQLDeadlock
- type MySQLDeadlockTxn
- type Neo4jConfig
- type OracleConfig
- type OraclePlanStep
- type PgBackRest
- type PodCheck
- type PostgresConfig
- type RedisConfig
- type SAPConfig
- type SQLiteConfig
- type SQLiteHeader
- type SlowLogConfig
- type SlowQuery
- type Snapshot
- type Socket
- type StatusTarget
- type TiDBConfig
- type TokenConfig
Constants ¶
const ( MaxKafkaGroups = 200 MaxKafkaTopics = 500 // topics with partition health, and lag_sum topics per group )
Series caps. What a cap leaves out is counted in `wt_agent_kafka_dropped_total{what}`.
const DefaultSAPLongRunningS = 300
DefaultSAPLongRunningS is the run time after which a work process counts as long-running.
const XIDWarnAge = 1.5e9
XIDWarnAge is the transaction-ID age at which wraparound becomes urgent (INF-027): the default freeze limit is 2e9, so 1.5e9 leaves a quarter of the runway to act.
Variables ¶
This section is empty.
Functions ¶
func Artemis ¶
Artemis reads an ActiveMQ Artemis broker through its Jolokia endpoint (the console's /console/jolokia): broker memory and disk use, replication, connections, and per queue depth, in-delivery, throughput, expired and killed (dead-lettered) messages and the age of the first message.
func ClickHouse ¶
ClickHouse reads per-statement statistics from system.query_log every minute (the server's own Prometheus endpoint still covers server metrics through the prometheus module).
func CockroachDB ¶
CockroachDB collects cluster health and statement statistics.
func CollectCockroachDB ¶
CollectCockroachDB reads liveness, stores and contended tables.
func CollectKafka ¶
func CollectKafka(ctx context.Context, adm *kadm.Client, groups []string, st *KafkaState, out sink.Sink, now time.Time) error
CollectKafka runs one round. st may be nil.
func CollectMSSQL ¶
CollectMSSQL reads performance counters, wait stats and blocking sessions.
func CollectMSSQLPlans ¶
CollectMSSQLPlans explains the top query-store / cached plans (showplan XML is captured, never executed), literals removed (ScrubShowplan).
func CollectMSSQLSchema ¶
CollectMSSQLSchema logs the columns of every user table (at most 500).
func CollectMySQL ¶
CollectMySQL runs one round.
func CollectMySQLPlans ¶
CollectMySQLPlans explains the top recent SELECTs.
func CollectMySQLSchema ¶
CollectMySQLSchema logs the columns of every user table (at most 500 tables).
func CollectOracle ¶
CollectOracle runs one round of the always-on views.
func CollectPlans ¶
CollectPlans logs generic plans of the top statements.
func CollectPostgres ¶
CollectPostgres runs one round against dsn.
func CollectSQLiteFile ¶
CollectSQLiteFile reports one database file. gen remembers when each WAL generation was first seen. shortcut: the age counts from when the agent first saw the generation (it under-reports right after an agent start); upgrade by persisting gen in the state dir.
func CollectSchema ¶
CollectSchema logs the columns of every user table (at most 500 tables).
func CollectStatementDeltas ¶
func CollectStatementDeltas(ctx context.Context, dsn string, d *dbm.Deltas, out sink.Sink, now time.Time) error
CollectStatementDeltas reads pg_stat_statements (PostgreSQL 13+) and emits the per-queryid series of the statements that ran since the previous round.
func CollectTiDB ¶
func CollectTiDB(ctx context.Context, db *sql.DB, st *tidbState, out sink.Sink, now time.Time) error
CollectTiDB reads stores, lock waits and deadlocks.
func CollectYugabyteDB ¶
CollectYugabyteDB reads servers and local tablets.
func Consul ¶
Consul reads the agent's own Prometheus endpoint (telemetry.prometheus_retention_time > 0).
func CouchDB ¶
CouchDB polls a node every 30 s (url http://host:5984, an admin or a user with _node read).
func Couchbase ¶
Couchbase reads the native /metrics of Couchbase Server 7+ (port 8091, a read-only admin user).
func CypherSafe ¶
CypherSafe removes the literals of a Cypher statement: double-quoted strings here, single-quoted strings and numbers through dbm.BindSafe ($parameters are already placeholders).
func Databricks ¶
Databricks reads cluster states and active job runs of a workspace (personal access token).
func Dnsmasq ¶
Dnsmasq asks dnsmasq's CHAOS-class TXT names (cachesize.bind, hits.bind, ...) for its cache counters.
func Docker ¶
Docker lists containers through the Engine API and reports engine-level counts by state and one `docker.container.up` series per container (at most 500).
func EMQX ¶
EMQX reads the EMQX 5 REST API (an API key and secret as username and password): cluster stats and counters, per node status and resources, and active alarms.
func Elasticsearch ¶
Elasticsearch reads cluster health (the http_status parser), the 200 largest indices and the node, shard, task and hot-thread depth of elasticsearch_deep.go (OpenSearch speaks the same API).
func EmitApache ¶
EmitApache parses mod_status `?auto`.
func EmitCRDBStatements ¶
func EmitCRDBStatements(out sink.Sink, d *dbm.Deltas, rows []map[string]string, now time.Time) []dbm.StatementDelta
EmitCRDBStatements turns one read of the statement statistics into per-fingerprint series. Statement's BlksHit carries rows read.
func EmitCassandraJMX ¶
EmitCassandraJMX turns the Jolokia responses of cassandraReads into series.
func EmitClickHouseHealth ¶
EmitClickHouseHealth turns the rows of one health query (kind as in clickhouseHealthQueries).
func EmitClickHouseQueries ¶
EmitClickHouseQueries turns JSONEachRow rows of clickhouseTopQueries into per-statement sums.
func EmitClusterInfo ¶
EmitClusterInfo emits CLUSTER INFO slot and node health.
func EmitCollStats ¶
EmitCollStats writes $collStats storage figures.
func EmitCouchDB ¶
EmitCouchDB emits one database's sizes, document counts and the share compaction would free.
func EmitCouchReplications ¶
EmitCouchReplications counts scheduler replication documents by state.
func EmitCouchStats ¶
EmitCouchStats walks _stats: every {value, type} leaf becomes couchdb.<path>; counters are sums, gauges gauges, histograms emit their mean and p50/p90/p99. It returns the series count.
func EmitCouchTasks ¶
EmitCouchTasks counts active tasks by type with the oldest one's age and mean progress.
func EmitCurrentOp ¶
EmitCurrentOp reports in-progress operations already running past the slow threshold.
func EmitDocker ¶
EmitDocker parses a /containers/json body.
func EmitDumpFiles ¶
EmitDumpFiles reports the newest file matching the glob that is at least MinBytes.
func EmitEMQXAlarms ¶
EmitEMQXAlarms parses /api/v5/alarms?activated=true: active alarms per name (high_system_memory_usage, conn_congestion, ...).
func EmitEMQXMetrics ¶
EmitEMQXMetrics parses /api/v5/metrics?aggregate=true.
func EmitEMQXNodes ¶
EmitEMQXNodes parses /api/v5/nodes.
func EmitEMQXStats ¶
EmitEMQXStats parses /api/v5/stats: current counts (`x.count`) and their peaks (`x.max`).
func EmitESAllocation ¶
EmitESAllocation files the allocation explanation of the first unassigned shard: the index, shard, why it is unassigned and each node's deciding reason (deduplicated).
func EmitESHotThreads ¶
EmitESHotThreads emits the busiest thread's CPU share and files the report when it is past esHotCPU.
func EmitESNodes ¶
EmitESNodes writes per-node latency totals, thread pools, heap, GC and breakers.
func EmitESShards ¶
EmitESShards counts shards by state and primary/replica, and unassigned shards by reason. It returns the unassigned count.
func EmitESTasks ¶
EmitESTasks reports top-level tasks running past esSlowTask: a gauge per action and a sample each (at most 20) with the indices and running time. The description's query source is dropped.
func EmitElasticsearch ¶
EmitElasticsearch parses _cluster/health. Status is 0 green, 1 yellow, 2 red.
func EmitElasticsearchIndices ¶
EmitElasticsearchIndices writes document counts and store sizes of the 200 largest indices.
func EmitEtcdDerived ¶
func EmitEtcdDerived(out sink.Sink, fams map[string]*dto.MetricFamily, prev map[string][]*dto.Bucket, now time.Time)
EmitEtcdDerived emits interval p99s (prev holds last round's buckets per series), fragmentation, quota use and the defrag hint.
func EmitFamilies ¶
func EmitFamilies(out sink.Sink, fams map[string]*dto.MetricFamily, prefixes []string, at time.Time)
EmitFamilies forwards the families whose name starts with one of prefixes: counters as sums, gauges and untyped as gauges, histograms and summaries as their _count and _sum. It stops after maxSeries points.
func EmitHAProxy ¶
EmitHAProxy parses the CSV stats page: per proxy and server status, sessions, errors.
func EmitIndexStats ¶
EmitIndexStats writes $indexStats accesses (cumulative since the index was loaded).
func EmitJenkins ¶
EmitJenkins turns the three API answers into jenkins.* series.
func EmitKeyPatterns ¶
func EmitKeyPatterns(out sink.Sink, sys string, keys []string, sizes, freqs []int64, dbKeys float64, now time.Time)
EmitKeyPatterns groups sampled keys by pattern and emits the top patterns by memory.
func EmitLatencyLatest ¶
EmitLatencyLatest reads LATENCY LATEST: [event, unix time, latest ms, all-time max ms] rows.
func EmitMSSQLQueryStats ¶
EmitMSSQLQueryStats turns one read of the plan-cache statistics into per-query_hash series. Statement's block counters carry logical and physical reads.
func EmitMSSQLQueryStore ¶
EmitMSSQLQueryStore reports Query Store state (1 for the current one) and storage use. A store that went READ_ONLY because it is full stops capturing silently.
func EmitMSSQLRegressions ¶
EmitMSSQLRegressions reports queries that ran with more than one plan in the last hour.
func EmitMemcached ¶
EmitMemcached emits the headline stats.
func EmitMemcachedSlabs ¶
EmitMemcachedSlabs emits per slab class memory (`stats slabs`) and item eviction figures (`stats items`): which item sizes are starved of memory.
func EmitMemoryDoctor ¶
EmitMemoryDoctor files the MEMORY DOCTOR report as advice unless it found nothing.
func EmitMongoPlan ¶
EmitMongoPlan writes the redacted winning plan of an explain reply.
func EmitMosquittoSys ¶
EmitMosquittoSys turns $SYS topic values into series.
func EmitMySQLDigests ¶
EmitMySQLDigests turns one read of the digest summary into per-digest series. Statement's two block counters carry MySQL's rows examined and no-index-used counts.
func EmitMySQLReplica ¶
EmitMySQLReplica reads one SHOW REPLICA|SLAVE STATUS row (either naming).
func EmitNATSJsz ¶
EmitNATSJsz parses /jsz: server totals and, when account detail is present, per stream and consumer. KV_<b> and OBJ_<b> streams are labelled kind=kv/object with bucket=<b>.
func EmitNATSVarz ¶
EmitNATSVarz parses /varz.
func EmitNeo4j ¶
EmitNeo4j turns the SHOW TRANSACTIONS and SHOW DATABASES rows into series, samples and chains.
func EmitOracleRound ¶
EmitOracleRound maps one view's rows (kind stat, wait, session or tablespace).
func EmitOracleSQL ¶
func EmitOracleSQL(out sink.Sink, d *dbm.Deltas, rows []map[string]string, now time.Time) []dbm.StatementDelta
EmitOracleSQL turns one read of v$sqlarea into per-sql_id series. Statement's block counters carry buffer gets and disk reads.
func EmitPgBackRest ¶
EmitPgBackRest reads `pgbackrest info --output=json`: per stanza and backup type, the newest backup without an error.
func EmitPulsarTopicStats ¶
EmitPulsarTopicStats parses one topic's admin stats.
func EmitRabbitFederation ¶
EmitRabbitFederation parses /api/federation-links: 1 while a link is running, 0 otherwise.
func EmitRabbitNodes ¶
EmitRabbitNodes parses /api/nodes (needs the monitoring tag): resource use and alarms per node.
func EmitRabbitOverview ¶
EmitRabbitOverview parses /api/overview; every series carries the cluster name.
func EmitRabbitQueues ¶
EmitRabbitQueues parses /api/queues: a paged `{items: [...]}` object or a plain array.
func EmitRabbitShovels ¶
EmitRabbitShovels parses /api/shovels: 1 while a shovel is running, 0 otherwise.
func EmitRabbitStreamConsumers ¶
EmitRabbitStreamConsumers parses /api/stream/consumers (rabbitmq_stream_management): per stream, the consumer count and the largest offset lag (messages between a consumer and the stream end).
func EmitRedisStats ¶
EmitRedisStats emits commandstats, latencystats, errorstats, keyspace expiry and replica lag.
func EmitReplSet ¶
EmitReplSet emits each member's health and its optime lag behind the primary.
func EmitSAPLongRunning ¶
EmitSAPLongRunning counts, per type, the work processes of an ABAPGetWPTable response that have been running for at least minS seconds.
func EmitSAPProcesses ¶
EmitSAPProcesses parses a GetProcessList response: one sap.process.status per process.
func EmitSAPQueues ¶
EmitSAPQueues parses a GetQueueStatistic response: current, peak and maximum length of each dispatcher queue (DIA, BTC, UPD, ...).
func EmitSAPWorkProcesses ¶
EmitSAPWorkProcesses parses an ABAPGetWPTable response: work processes counted by type and status (e.g. DIA/Run), plus the busy share per type.
func EmitSchema ¶
func EmitSchema(out sink.Sink, engine string, order []string, tables map[string][]string, now time.Time)
EmitSchema writes one log record per table.
func EmitServerStatus ¶
EmitServerStatus emits connections, opcounters and memory from a serverStatus reply (bson.D or bson.M). It reports whether the connection counts were present.
func EmitSlowQuery ¶
EmitSlowQuery writes the sample and, when there is one, the plan.
func EmitSnowflake ¶
EmitSnowflake writes one SQL API result (`[[key, number-as-string], ...]`).
func EmitSquid ¶
EmitSquid turns `client_http.requests = 123` lines into cumulative sums (`sample_time` skipped).
func EmitTiDBDeadlocks ¶
func EmitTiDBDeadlocks(out sink.Sink, rows []map[string]string, seen map[string]bool, now time.Time)
EmitTiDBDeadlocks reports each deadlock not seen before as one db.deadlock record. KEY and the handle values of KEY_INFO are row data and are dropped; the table and index names are kept.
func EmitTiDBStatements ¶
func EmitTiDBStatements(out sink.Sink, d *dbm.Deltas, rows []map[string]string, now time.Time) []dbm.StatementDelta
EmitTiDBStatements turns one read of the statement summary into per-digest series. Statement's block counters carry processed keys and total keys (total much higher than processed means MVCC versions or tombstones are being scanned).
func EmitTiDBStores ¶
EmitTiDBStores reports each TiKV/TiFlash store.
func EmitWiredTiger ¶
EmitWiredTiger emits storage-engine cache, eviction, ticket and latency figures of serverStatus.
func EmitYBASH ¶
func EmitYBASH(out sink.Sink, rows []map[string]string, window time.Duration, now time.Time) time.Time
EmitYBASH turns ASH sample counts over window into average sessions (ASH samples once a second) and returns the newest sample time seen.
func EmitYBStatements ¶
EmitYBStatements turns one read of pg_stat_statements into per-queryid series.
func Etcd ¶
Etcd scrapes a member (use the plain-HTTP --listen-metrics-urls port, 2381 by convention, when 2379 requires client certificates).
func GitLab ¶
GitLab reads /-/metrics of a self-managed instance (the agent's address on the monitoring allowlist).
func HTTPStatus ¶
HTTPStatus reads the status page of nginx (stub_status), Apache (mod_status ?auto), HAProxy (stats ;csv) or Elasticsearch (_cluster/health) for every target, concurrently, each under its own timeout. Each target reports `wt.integration.up{integration=<kind>,service=<service>}`.
func IntervalQuantile ¶
IntervalQuantile estimates quantile q of the observations made between two scrapes of one cumulative histogram (linear interpolation inside the bucket, as PromQL histogram_quantile). It reports false when nothing was observed or the counter reset.
func Istio ¶
Istio reads istiod's monitoring port (15014): xDS pushes, proxy convergence, cert signing.
func JMX ¶
JMX reads JVM (or any MBean) numbers through a Jolokia agent as `jmx.attribute{mbean,attribute}`.
func Jenkins ¶
Jenkins reads the JSON API (a user and API token as username/password): executors, offline agents, the build queue and the last build of up to 500 jobs.
func JobFrameworks ¶
func JobFrameworks() []string
JobFrameworks lists the job framework module names, sorted.
func Kafka ¶
Kafka reports consumer lag per group and partition, and under-replicated and offline partitions per topic, through the Kafka admin API.
func Kinesis ¶
Kinesis scrapes a CloudWatch exporter (YACE or cloudwatch_exporter) configured for AWS/Kinesis.
func Listen ¶
Listen reports `wt.agent.listening` (value 1; port, process, and integration when matched) for up to 200 listening TCP sockets every 60 s, so the API can say "postgres on :5432 on host X".
func Loop ¶
func Loop(ctx context.Context, name string, b Base, def time.Duration, out sink.Sink, collect func(ctx context.Context, now time.Time) error, ) error
Loop runs collect every interval (default def, at least 5 s) until ctx ends and reports `wt.integration.up` (1 or 0) per round, so an unreachable product is an alertable series. A disabled module just waits.
func MSSQLActivity ¶
MSSQLActivity maps sampled requests.
func MSSQLBlocking ¶
MSSQLBlocking emits one gauge per blocked session.
func Milvus ¶
Milvus reads a component's /metrics (port 9091): proxy search latency, entities, collections.
func MinIO ¶
MinIO reads the cluster metrics (v2); Token is the bearer from `mc admin prometheus generate`.
func MongoDB ¶
MongoDB runs serverStatus and replSetGetStatus, then the deeper reads of mongodb_dbm.go.
func Mosquitto ¶
Mosquitto subscribes to $SYS/# over MQTT 3.1.1 and reads the broker's statistics (Mosquitto publishes them retained, every sys_interval). Bridge state topics ($SYS/broker/connection/<name>/state) become mosquitto.bridge.up.
func MySQLActivity ¶
MySQLActivity maps sampled rows; a wait "wait/io/table/sql/handler" has type "io".
func MySQLBlocking ¶
MySQLBlocking turns sys.innodb_lock_waits rows into blocking chains.
func NATS ¶
NATS reads the monitoring endpoints /varz and /jsz (with per-account stream and consumer detail, so JetStream streams, KV buckets, object stores and their consumers become series).
func NormalizePodConfig ¶
NormalizePodConfig turns an annotation config into the module's own config: the first entry of `instances` is merged over the top level, and `host` plus `port` become the module's address.
func OplogWindow ¶
OplogWindow is the time the oplog covers, from its first and last entries.
func OracleActivity ¶
OracleActivity maps sampled sessions; a session not waiting is on CPU.
func OraclePlanJSON ¶
func OraclePlanJSON(steps []OraclePlanStep) (string, error)
OraclePlanJSON builds the plan tree in the same JSON shape as a PostgreSQL plan ("Node Type", "Total Cost", "Plans"), so the plan views and EmitPlan read every engine alike, and removes the literals from its predicates.
func ParseRedisInfo ¶
ParseRedisInfo reads INFO text: `key:value` lines, section headers and blanks skipped.
func PartitionHealth ¶
func PartitionHealth(ps kadm.PartitionDetails) (under, offline int)
PartitionHealth counts partitions whose in-sync replicas are fewer than their replicas, and partitions without a leader.
func Pinecone ¶
Pinecone reads the project's Prometheus HTTP service discovery (url ending in /discovery, Token the API key) and scrapes each listed HTTPS target with the same key; a plain url is scraped directly.
func Postgres ¶
Postgres collects pg_stat_database, replication lag, XID age, dead tuples, WAL archiving failures and the top 50 statements by total time (when pg_stat_statements is installed).
func Pulsar ¶
Pulsar reads the broker's /metrics (per-topic backlog, rates and subscriptions) and the age of the most backlogged subscriptions from the admin API (pulsar.go).
func RabbitMQ ¶
RabbitMQ reads the management API every round: the 200 deepest queues (depth, rates, consumer capacity, oldest message age, quorum members, dead-letter target), the cluster overview (message rates, unroutable drops, connection and channel churn) and, when the management user may read them, nodes (memory and disk alarms, partitions, descriptors), consumers (prefetch and ack mode per queue), streams, shovels and federation links.
func ReadMemcachedStats ¶
ReadMemcachedStats reads `STAT name value` lines up to END.
func RedactPlan ¶
RedactPlan keeps stages, index names and key patterns of a plan and shapes every value-bearing part.
func Redis ¶
Redis runs INFO over RESP and emits the server, client, memory, stats and replication sections, the deeper reads of redis_deep.go (Valkey, Dragonfly and KeyDB speak the same), then streams, their consumer groups and consumers (redis_streams.go).
func RedisSystem ¶
RedisSystem names the server from INFO: redis, valkey, dragonfly or keydb.
func RunAnnotated ¶
RunAnnotated keeps one running module per annotated pod container. Every interval it asks list for the current bindings, starts the new ones, restarts a changed one and stops the ones whose pod is gone. A rejected binding is logged once per change and skipped.
func SAPControl ¶
SAPControl polls GetProcessList and ABAPGetWPTable (the latter only exists on ABAP instances).
func ScrubShowplan ¶
ScrubShowplan removes literals from a showplan XML: the attributes that carry statement text, scalar expressions, constants and sniffed parameter values go through BindSafe; costs and row estimates are kept.
func ScyllaDB ¶
ScyllaDB scrapes the node's Prometheus endpoint (default http://host:9180/metrics).
func Snowflake ¶
Snowflake runs two ACCOUNT_USAGE queries through the SQL API (programmatic access token): credits per warehouse and query counts per status over the last hour.
func ValidateConfig ¶
func ValidateConfig(kind string, raw json.RawMessage) error
ValidateConfig checks a module config of kind (a manifest's module.kind) the way the module does when it starts. Kinds that are not one of this package's modules (host, prometheus) are validated by their own packages.
func Windows ¶
Windows scrapes windows_exporter: perf counters, services, IIS and (for Hyper-V) hyperv.
func YugabyteDB ¶
YugabyteDB collects one YugabyteDB node.
Types ¶
type AlertDoc ¶
type AlertDoc struct {
Name string `yaml:"name" json:"name"`
Rule map[string]any `yaml:"rule" json:"rule"`
ThresholdRationale string `yaml:"threshold_rationale" json:"threshold_rationale"`
RunbookURL string `yaml:"runbook_url" json:"runbook_url"`
DefaultEnabled bool `yaml:"default_enabled" json:"default_enabled"`
}
AlertDoc is one stock alert: a rule document (the API validates it as a RuleSpec).
type BackupConfig ¶
type BackupConfig struct {
Base
PgBackRest []PgBackRest `json:"pgbackrest"`
Files []DumpFiles `json:"files"`
Snapshots []Snapshot `json:"snapshots"`
}
BackupConfig is the backup module's config (agent file only).
type BullMQConfig ¶
type BullMQConfig struct {
Base
RedisDSN string `json:"redis_dsn"`
Prefix string `json:"prefix"` // BullMQ's key prefix, default "bull"
Queues []string `json:"queues"`
}
BullMQConfig is the bullmq module's config. RedisDSN is local-file only (it may carry the password): `redis://[user:password@]host[:port][/db]`, or `rediss://` for TLS.
type Dependency ¶
type Dependency struct {
ParentKind string `yaml:"parent_kind" json:"parent_kind"`
EqualLabels []string `yaml:"equal_labels" json:"equal_labels"`
}
Dependency makes this product's alerts depend on another kind's "down" alert: while the parent is firing for the same values of EqualLabels, the children are inhibited.
type Detected ¶
Detected is a manifest matched by a listening socket.
type Discovery ¶
type Discovery struct {
ProcessNames []string `yaml:"process_names" json:"process_names"`
Ports []int `yaml:"ports" json:"ports"`
K8sLabels map[string]string `yaml:"k8s_labels" json:"k8s_labels"`
}
Discovery says how a running product is recognized.
type DistSQLConfig ¶
type DistSQLConfig struct {
Base
DSN string `json:"dsn"` // postgres://user:pass@host:26257/defaultdb?sslmode=verify-full
DBM bool `json:"dbm"`
Explain bool `json:"explain"`
}
DistSQLConfig is the config of the cockroachdb and yugabytedb modules (PostgreSQL wire).
type DnsmasqConfig ¶
DnsmasqConfig is the dnsmasq DNS address (host:port, default 127.0.0.1:53).
type DockerConfig ¶
DockerConfig is the docker module's config: the Engine API endpoint, local-file only. Socket is a unix socket path (default /var/run/docker.sock) or, with URL, a TCP endpoint.
type DumpFiles ¶
type DumpFiles struct {
Name string `json:"name"`
Glob string `json:"glob"` // e.g. /backups/mysql/*.sql.gz
Kind string `json:"kind"` // mysqldump, mongodump, pg_dump, ... (a label only)
MinBytes int64 `json:"min_bytes"` // a smaller newest file is not a good backup
MaxAge string `json:"max_age"`
}
DumpFiles is a set of dump files; the newest one counts.
type ExporterConfig ¶
type ExporterConfig struct {
Base
URL string `json:"url"`
Username string `json:"username"`
Password string `json:"password"`
Token string `json:"token"`
// Prefixes narrows the scrape to metric names starting with one of them (a module has a default).
Prefixes []string `json:"prefixes"`
}
ExporterConfig is the config of every module that reads a product's Prometheus text endpoint: the product's own (consul, vault, pulsar, ceph) or a well-known exporter next to it (mssql, oracle, cassandra, windows, kinesis). URL, Token and the password exist only in the agent's file.
type HTTPConfig ¶
type HTTPConfig struct {
Base
URL string `json:"url"`
Username string `json:"username"`
Password string `json:"password"`
}
HTTPConfig is shared by the modules that read a product's HTTP status or management API. URL and credentials are local-file only.
type HTTPStatusConfig ¶
type HTTPStatusConfig struct {
Base
Targets []StatusTarget `json:"targets"`
}
HTTPStatusConfig is the http_status module's config: up to 16 targets, local file only.
type JobQueueConfig ¶
type JobQueueConfig struct {
Base
DSN string `json:"dsn"` // Postgres (postgres://...) or SQL Server (sqlserver://...)
Addr string `json:"addr"` // Redis or Faktory host:port
Username string `json:"username"`
Password string `json:"password"`
TLS bool `json:"tls"`
DB int `json:"db"` // Redis database number
Prefix string `json:"prefix"` // Redis key prefix (framework default when empty)
HorizonPrefix string `json:"horizon_prefix"` // Laravel Horizon's own key prefix
Schema string `json:"schema"` // SQL schema of the framework's tables
URL string `json:"url"` // Temporal HTTP API
Token string `json:"token"` // Temporal API key
Namespace string `json:"namespace"` // Temporal namespace
Queues []string `json:"queues"` // filter; required where the store has no queue registry
StallAfter string `json:"stall_after"` // a running job older than this is stalled (default 1h)
// contains filtered or unexported fields
}
JobQueueConfig is the config of every job framework module. DSN, Addr, Password and Token are local-file only.
type JolokiaConfig ¶
type JolokiaConfig struct {
HTTPConfig
Reads []MBeanRead `json:"reads"`
}
JolokiaConfig is the jmx and activemq config: the Jolokia agent's URL (for example http://host:8778/jolokia) and, for jmx, the reads to make (a JVM default is used when empty).
type KafkaConfig ¶
type KafkaConfig struct {
Base
Brokers []string `json:"brokers"`
SASLUser string `json:"sasl_user"`
SASLPassword string `json:"sasl_password"`
TLS bool `json:"tls"`
// Groups limits lag to these consumer groups (default: all). Either way at most
// MaxKafkaGroups groups are described, the first by name.
Groups []string `json:"groups"`
}
KafkaConfig is the kafka module's config. Brokers and credentials are local-file only.
type KafkaState ¶
type KafkaState struct {
// contains filtered or unexported fields
}
KafkaState carries what a collector keeps between rounds: the cumulative drop counters and the end offset history behind lag in time (kafka_lagtime.go).
type ListenConfig ¶
type ListenConfig struct {
Base
// ManifestsDir (optional) lets the agent name the matched integration itself; the API
// matches against its own copy either way.
ManifestsDir string `json:"manifests_dir"`
}
ListenConfig is the listen module's config. ManifestsDir is local-file only.
type MBeanRead ¶
MBeanRead is one Jolokia read: an MBean (a `*` pattern is allowed) and the attributes to read.
type MQTTConfig ¶
type MQTTConfig struct {
Base
Addr string `json:"addr"` // host:port of an MQTT listener, usually 127.0.0.1:1883
Username string `json:"username"`
Password string `json:"password"`
TLS bool `json:"tls"`
}
MQTTConfig is the mosquitto module's config. Addr and the credentials are local-file only.
type MSSQLConfig ¶
type MSSQLConfig struct {
Base
DSN string `json:"dsn"` // sqlserver://user:pass@host:1433?database=master
Explain bool `json:"explain"`
Schema bool `json:"schema"`
// Database Monitoring (mssql_dbm.go).
DBM bool `json:"dbm"`
CollectSamples bool `json:"collect_samples"`
}
MSSQLConfig is the module config. ApplicationIntent=ReadOnly is forced on the connection.
type Manifest ¶
type Manifest struct {
Name string `yaml:"name" json:"name"`
Version string `yaml:"version" json:"version"`
Discovery Discovery `yaml:"discovery" json:"discovery"`
Module ModuleRef `yaml:"module" json:"module"`
Metrics []MetricDoc `yaml:"metrics" json:"metrics"`
Dashboards []any `yaml:"dashboards" json:"dashboards"`
Alerts []AlertDoc `yaml:"alerts" json:"alerts"`
DependsOn []Dependency `yaml:"depends_on" json:"depends_on"`
}
Manifest is one integrations/<name>/manifest.yaml (shape: integrations/schema.json).
type MemcachedConfig ¶
MemcachedConfig is the memcached module's config.
type MetricDoc ¶
type MetricDoc struct {
Name string `yaml:"name" json:"name"`
Unit string `yaml:"unit" json:"unit"`
Description string `yaml:"description" json:"description"`
}
MetricDoc documents one emitted metric.
type ModuleRef ¶
type ModuleRef struct {
Kind string `yaml:"kind" json:"kind"`
ConfigDefaults map[string]any `yaml:"config_defaults" json:"config_defaults"`
}
ModuleRef names the agent module that collects the product and its local config defaults.
type MongoConfig ¶
type MongoConfig struct {
Base
URI string `json:"uri"`
// Databases whose profiler, index and collection stats are read; default every non-system one (at most 20).
Databases []string `json:"databases"`
// SlowMs is the running time past which an operation is sampled (default 1000).
SlowMs int `json:"slow_ms"`
}
MongoConfig is the mongodb module's config. URI (with credentials) is local-file only.
type MySQLConfig ¶
type MySQLConfig struct {
Base
DSN string `json:"dsn"`
Schema bool `json:"schema"` // table/column snapshot every 120 rounds (as postgres)
Explain bool `json:"explain"` // EXPLAIN FORMAT=JSON of slow recent statements (mysql_explain.go)
// Database Monitoring (mysql_dbm.go): per-digest deltas and deadlock history, 1 s samples.
DBM bool `json:"dbm"`
CollectSamples bool `json:"collect_samples"`
}
MySQLConfig is the mysql module's config. DSN (user:pass@tcp(host:3306)/) is local-file only.
type MySQLDeadlock ¶
type MySQLDeadlock struct {
At string `json:"at"`
Transactions []MySQLDeadlockTxn `json:"transactions"`
RolledBack int `json:"rolled_back,omitempty"` // 1-based index into Transactions
}
MySQLDeadlock is the LATEST DETECTED DEADLOCK section of SHOW ENGINE INNODB STATUS without its row dumps.
func ParseInnoDBDeadlock ¶
func ParseInnoDBDeadlock(status string) (MySQLDeadlock, bool)
ParseInnoDBDeadlock reads the deadlock section; false when there is none.
type MySQLDeadlockTxn ¶
type MySQLDeadlockTxn struct {
Query string `json:"query"`
Table string `json:"table,omitempty"`
Index string `json:"index,omitempty"`
Holds string `json:"holds,omitempty"`
WaitsFor string `json:"waits_for,omitempty"`
}
MySQLDeadlockTxn is one transaction of a deadlock: its statement and the lock it held and the one it waited for.
type Neo4jConfig ¶
type Neo4jConfig struct {
HTTPConfig
SlowMs int `json:"slow_ms"` // transactions running longer are sampled (default 1000)
}
Neo4jConfig is the neo4j module's config: the HTTP endpoint (http://host:7474) and a user with the SHOW TRANSACTION and SHOW DATABASE privileges.
type OracleConfig ¶
type OracleConfig struct {
ExporterConfig
DSN string `json:"dsn"`
DBM bool `json:"dbm"`
CollectSamples bool `json:"collect_samples"`
Explain bool `json:"explain"`
}
OracleConfig is either the exporter scrape (url) or the native reader (dsn).
type OraclePlanStep ¶
type OraclePlanStep struct {
ID, Parent int
Operation string
Object string
Cost, Rows float64
Access, Filter string
}
OraclePlanStep is one v$sql_plan row.
type PgBackRest ¶
type PgBackRest struct {
Name string `json:"name"`
Path string `json:"path"` // the pgbackrest binary
Stanza string `json:"stanza"` // empty: every stanza
MaxAge string `json:"max_age"`
}
PgBackRest is one pgBackRest repository.
type PodCheck ¶
type PodCheck struct {
Namespace, Pod, UID, Container, Module string
PodIP string
Config map[string]any
}
PodCheck is one integration module an annotated pod asks for (k8s.CheckTarget without the k8s types, so this package stays free of the Kubernetes client).
type PostgresConfig ¶
type PostgresConfig struct {
Base
DSN string `json:"dsn"`
Explain bool `json:"explain"` // generic plans of top statements (postgres_plans.go)
Schema bool `json:"schema"` // table/column snapshot
// Database Monitoring (postgres_dbm.go): per-queryid deltas, 1 s activity samples and
// plans of sampled statements through ExplainFunction.
DBM bool `json:"dbm"`
CollectSamples bool `json:"collect_samples"`
ExplainFunction string `json:"explain_function"`
}
PostgresConfig is the postgres module's config. DSN is local-file only (it carries the password); remote config may set Enabled and Interval.
type RedisConfig ¶
type RedisConfig struct {
Base
Addr string `json:"addr"` // host:port
Password string `json:"password"`
Username string `json:"username"`
TLS bool `json:"tls"`
// Streams are the stream keys to inspect (XINFO); empty means the ones SCAN TYPE stream finds.
Streams []string `json:"streams"`
// KeySample is how many keys a keyspace pass (every 20th round) sizes with MEMORY USAGE; 0 means 1000, -1 off.
KeySample int `json:"key_sample"`
}
RedisConfig is the redis module's config. Addr and Password are local-file only.
type SAPConfig ¶
type SAPConfig struct {
HTTPConfig
Service string `json:"service"`
LongRunningS int `json:"long_running_s"`
}
SAPConfig is the `sap` module's config.
type SQLiteConfig ¶
SQLiteConfig lists the database files (paths or globs, at most 100 files).
type SQLiteHeader ¶
type SQLiteHeader struct {
PageSize, Pages, FreePages int64
WALMode bool
WALSalt uint64 // checkpoint sequence and salt-1: changes when the WAL restarts
WALSize int64
}
SQLiteHeader is what the module reads from one database file and its WAL.
func ReadSQLiteHeader ¶
func ReadSQLiteHeader(dbHead, walHead []byte) (SQLiteHeader, error)
ReadSQLiteHeader parses the database header (and WAL header when walHead is 32 bytes).
type SlowLogConfig ¶
type SlowLogConfig struct {
Base
Engine string `json:"engine"` // mysql (MariaDB too) or postgresql
Path string `json:"path"` // file or glob
}
SlowLogConfig is the db_slow_log module's local config.
type SlowQuery ¶
type SlowQuery struct {
Source string `json:"source"`
Database string `json:"-"`
Query string `json:"query"`
DurationMs float64 `json:"duration_ms"`
LockMs float64 `json:"lock_ms,omitempty"`
RowsSent float64 `json:"rows_sent,omitempty"`
RowsExamined float64 `json:"rows_examined,omitempty"`
User string `json:"user,omitempty"`
Plan string `json:"-"` // bind-safe JSON plan (auto_explain json)
Hash string `json:"-"` // db.query.hash of the raw statement
}
SlowQuery is one statement from a slow log, already bind-safe.
func ParseMySQLSlow ¶
ParseMySQLSlow reads one record of a MySQL/MariaDB slow log. Before 5.7 several statements may share one "# Time:" line, so a record can hold more than one.
func ParsePGSlow ¶
ParsePGSlow reads one PostgreSQL log record: a log_min_duration_statement line ("duration: 12 ms statement: ...", or "execute <name>: ...") or an auto_explain one ("duration: 12 ms plan:" followed by the indented plan). The database and user come from db=%d / user=%u in log_line_prefix when present.
type Snapshot ¶
type Snapshot struct {
Name string `json:"name"`
Provider string `json:"provider"` // aws_ebs or aws_rds
Region string `json:"region"`
Resource string `json:"resource"` // vol-... or the DB instance identifier
MaxAge string `json:"max_age"`
}
Snapshot names one volume or instance whose snapshots are watched.
type StatusTarget ¶
type StatusTarget struct {
Kind string `json:"kind"`
URL string `json:"url"`
Service string `json:"service"`
Username string `json:"username"`
Password string `json:"password"`
// Timeout of one fetch (default 10s, at most 30s).
Timeout string `json:"timeout"`
}
StatusTarget is one status page. Kind picks the format; Service names the instance (default: the kind) and becomes the `service` label of every metric of the target, so two nginx servers or an nginx and an Elasticsearch on one host stay apart.
type TiDBConfig ¶
type TiDBConfig struct {
Base
DSN string `json:"dsn"`
DBM bool `json:"dbm"`
Explain bool `json:"explain"`
}
TiDBConfig is the tidb module's config. DSN (user:pass@tcp(host:4000)/) is local-file only.
type TokenConfig ¶
type TokenConfig struct {
HTTPConfig
Token string `json:"token"`
Repos []string `json:"repos"` // github: owner/name
// snowflake
Warehouse string `json:"warehouse"`
}
TokenConfig is an HTTP API with a bearer-style token (or basic auth via HTTPConfig).
Source Files
¶
- annotated.go
- artemis.go
- backup.go
- backup_cloud.go
- bullmq.go
- cassandra.go
- clickhouse.go
- clickhouse_parts.go
- cockroachdb.go
- couchdb.go
- dbsample.go
- dbslowlog.go
- dnsmasq.go
- docker.go
- elasticsearch_deep.go
- emqx.go
- etcd.go
- exporter.go
- http_status.go
- jobqueue.go
- jobqueue_other.go
- jobqueue_pg.go
- jobqueue_redis.go
- jolokia.go
- kafka.go
- kafka_lagtime.go
- kafka_topology.go
- listen.go
- loader.go
- mongodb.go
- mongodb_dbm.go
- mosquitto.go
- mssql.go
- mssql_dbm.go
- mysql.go
- mysql_dbm.go
- mysql_explain.go
- nats.go
- neo4j.go
- oracle.go
- platform_packs.go
- postgres.go
- postgres_dbm.go
- postgres_plans.go
- pulsar.go
- rabbitmq.go
- rabbitmq_cluster.go
- redis.go
- redis_deep.go
- redis_streams.go
- saas.go
- sapabap.go
- sapcontrol.go
- sqlite.go
- tidb.go
- vectordb.go
- yugabytedb.go