integrations

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: Apache-2.0 Imports: 56 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
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}`.

View Source
const DefaultSAPLongRunningS = 300

DefaultSAPLongRunningS is the run time after which a work process counts as long-running.

View Source
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

View Source
var LogPaths = map[string][]string{
	"activemq":        {"/opt/activemq/data/activemq.log"},
	"aerospike":       {"/var/log/aerospike/aerospike.log"},
	"airflow":         {"/opt/airflow/logs/scheduler/latest/*.log", "/var/log/airflow/*.log"},
	"apache":          {"/var/log/apache2/access.log", "/var/log/apache2/error.log", "/var/log/httpd/access_log", "/var/log/httpd/error_log"},
	"argocd":          {"/var/log/argocd/application-controller.log"},
	"artemis":         {"/var/lib/artemis/log/artemis.log"},
	"asynq":           {"/var/log/asynq/*.log"},
	"bullmq":          {"/var/log/bullmq/*.log"},
	"calico":          {"/var/log/calico/felix.log"},
	"cassandra":       {"/var/log/cassandra/system.log"},
	"celery":          {"/var/log/celery/*.log"},
	"ceph":            {"/var/log/ceph/*.log"},
	"certmanager":     {"/var/log/cert-manager/cert-manager.log"},
	"cilium":          {"/var/run/cilium/cilium.log"},
	"clickhouse":      {"/var/log/clickhouse-server/clickhouse-server.log"},
	"cockroachdb":     {"/var/log/cockroach/cockroach.log"},
	"consul":          {"/var/log/consul/consul.log"},
	"coredns":         {"/var/log/coredns/coredns.log"},
	"couchbase":       {"/opt/couchbase/var/lib/couchbase/logs/info.log"},
	"couchdb":         {"/var/log/couchdb/couchdb.log"},
	"docker":          {"/var/log/docker.log"},
	"dramatiq":        {"/var/log/dramatiq/*.log"},
	"elasticsearch":   {"/var/log/elasticsearch/*_server.json"},
	"emqx":            {"/var/log/emqx/emqx.log.*"},
	"envoy":           {"/var/log/envoy/envoy.log"},
	"etcd":            {"/var/log/etcd/etcd.log"},
	"faktory":         {"/var/log/faktory/*.log"},
	"flink":           {"/opt/flink/log/*.log"},
	"gitlab":          {"/var/log/gitlab/gitlab-rails/production_json.log", "/var/log/gitlab/gitlab-rails/application_json.log"},
	"gitlab_runner":   {"/var/log/gitlab-runner/runner.log"},
	"good_job":        {"/var/log/good_job/*.log"},
	"graphile_worker": {"/var/log/graphile-worker/*.log"},
	"gunicorn":        {"/var/log/gunicorn/error.log"},
	"hadoop":          {"/var/log/hadoop/*.log", "/opt/hadoop/logs/*.log"},
	"hangfire":        {"/var/log/hangfire/*.log"},
	"haproxy":         {"/var/log/haproxy.log"},
	"horizon":         {"/var/log/horizon/*.log"},
	"host":            {"/var/log/syslog", "/var/log/messages"},
	"iis":             {"C:\\inetpub\\logs\\LogFiles\\*\\*.log"},
	"istio":           {"/var/log/istio/istiod.log"},
	"jboss":           {"/opt/jboss/standalone/log/server.log", "/opt/wildfly/standalone/log/server.log"},
	"jenkins":         {"/var/log/jenkins/jenkins.log"},
	"jmx":             {"/var/log/app/*.log"},
	"kafka":           {"/opt/kafka/logs/server.log", "/var/log/kafka/server.log"},
	"karpenter":       {"/var/log/karpenter/controller.log"},
	"kong":            {"/usr/local/kong/logs/error.log", "/usr/local/kong/logs/access.log"},
	"linkerd":         {"/var/log/linkerd/proxy.log"},
	"milvus":          {"/var/lib/milvus/logs/milvus.log"},
	"minio":           {"/var/log/minio/minio.log"},
	"mongodb":         {"/var/log/mongodb/mongod.log"},
	"mosquitto":       {"/var/log/mosquitto/mosquitto.log"},
	"mssql":           {"/var/opt/mssql/log/errorlog"},
	"mysql":           {"/var/log/mysql/error.log"},
	"nats":            {"/var/log/nats-server.log"},
	"neo4j":           {"/var/log/neo4j/neo4j.log"},
	"nginx":           {"/var/log/nginx/access.log", "/var/log/nginx/error.log"},
	"nomad":           {"/var/log/nomad/nomad.log"},
	"ntp":             {"/var/log/chrony/chrony.log", "/var/log/ntp.log"},
	"oban":            {"/var/log/oban/*.log"},
	"opensearch":      {"/usr/share/opensearch/logs/*.json", "/var/log/opensearch/*.json"},
	"oracle":          {"/u01/app/oracle/diag/rdbms/*/*/trace/alert_*.log"},
	"pgboss":          {"/var/log/pgboss/*.log"},
	"phpfpm":          {"/var/log/php-fpm/error.log", "/var/log/php8*-fpm.log"},
	"postgres":        {"/var/log/postgresql/postgresql-*.log"},
	"pulsar":          {"/pulsar/logs/pulsar.log"},
	"puma":            {"/var/log/puma/puma.log", "/var/log/puma/puma_error.log"},
	"qdrant":          {"/qdrant/logs/qdrant.log"},
	"que":             {"/var/log/que/*.log"},
	"rabbitmq":        {"/var/log/rabbitmq/*.log"},
	"redis":           {"/var/log/redis/redis-server.log"},
	"resque":          {"/var/log/resque/*.log"},
	"river":           {"/var/log/river/*.log"},
	"rq":              {"/var/log/rq/*.log"},
	"sap":             {"/usr/sap/*/*/work/dev_w0"},
	"scylladb":        {"/var/log/scylla/scylla.log"},
	"sidekiq":         {"/var/log/sidekiq/*.log"},
	"solid_queue":     {"/var/log/solid_queue/*.log"},
	"solr":            {"/var/solr/logs/solr.log"},
	"spark":           {"/opt/spark/logs/*.out", "/var/log/spark/*.log"},
	"squid":           {"/var/log/squid/access.log"},
	"temporal":        {"/var/log/temporal/*.log"},
	"tidb":            {"/tidb-deploy/tidb-4000/log/tidb.log"},
	"tomcat":          {"/opt/tomcat/logs/catalina.*.log"},
	"traefik":         {"/var/log/traefik/access.log", "/var/log/traefik/traefik.log"},
	"uwsgi":           {"/var/log/uwsgi/uwsgi.log"},
	"varnish":         {"/var/log/varnish/varnishncsa.log"},
	"vault":           {"/var/log/vault/vault.log"},
	"weaviate":        {"/var/log/weaviate/weaviate.log"},
	"weblogic":        {"/u01/oracle/user_projects/domains/*/servers/*/logs/*.log"},
	"yugabytedb":      {"/home/yugabyte/yb-data/tserver/logs/yb-tserver.INFO"},
	"zookeeper":       {"/opt/zookeeper/logs/zookeeper.log"},
}

LogPaths maps an integration to the log file globs its manifest names (pseudo sources such as eventlog:// are left out). The agent tails them when remote config enables the integration's logs: the paths come from this table, never from remote config.

Functions

func ActiveMQ

func ActiveMQ(ctx context.Context, raw json.RawMessage, out sink.Sink) error

ActiveMQ reads the queue topology of a classic broker through its Jolokia agent.

func Artemis

func Artemis(ctx context.Context, raw json.RawMessage, out sink.Sink) error

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 Backup

func Backup(ctx context.Context, raw json.RawMessage, out sink.Sink) error

Backup is the backup module: every interval (default 5 min), each source is read.

func BullMQ

func BullMQ(ctx context.Context, raw json.RawMessage, out sink.Sink) error

BullMQ collects queue depth per state, oldest waiting age and stalled jobs per queue.

func Cassandra

func Cassandra(ctx context.Context, raw json.RawMessage, out sink.Sink) error

Cassandra reads MBeans through Jolokia, or scrapes an exporter.

func Ceph

func Ceph(ctx context.Context, raw json.RawMessage, out sink.Sink) error

Ceph scrapes the manager's prometheus module (port 9283).

func ClickHouse

func ClickHouse(ctx context.Context, raw json.RawMessage, out sink.Sink) error

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

func CockroachDB(ctx context.Context, raw json.RawMessage, out sink.Sink) error

CockroachDB collects cluster health and statement statistics.

func CollectCockroachDB

func CollectCockroachDB(ctx context.Context, db *sql.DB, out sink.Sink, now time.Time) error

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

func CollectMSSQL(ctx context.Context, db *sql.DB, out sink.Sink, now time.Time) error

CollectMSSQL reads performance counters, wait stats and blocking sessions.

func CollectMSSQLPlans

func CollectMSSQLPlans(ctx context.Context, db *sql.DB, out sink.Sink, now time.Time) error

CollectMSSQLPlans explains the top query-store / cached plans (showplan XML is captured, never executed), literals removed (ScrubShowplan).

func CollectMSSQLSchema

func CollectMSSQLSchema(ctx context.Context, db *sql.DB, out sink.Sink, now time.Time) error

CollectMSSQLSchema logs the columns of every user table (at most 500).

func CollectMySQL

func CollectMySQL(ctx context.Context, db *sql.DB, out sink.Sink, now time.Time) error

CollectMySQL runs one round.

func CollectMySQLPlans

func CollectMySQLPlans(ctx context.Context, db *sql.DB, out sink.Sink, now time.Time) error

CollectMySQLPlans explains the top recent SELECTs.

func CollectMySQLSchema

func CollectMySQLSchema(ctx context.Context, db *sql.DB, out sink.Sink, now time.Time) error

CollectMySQLSchema logs the columns of every user table (at most 500 tables).

func CollectOracle

func CollectOracle(ctx context.Context, db *sql.DB, out sink.Sink, now time.Time) error

CollectOracle runs one round of the always-on views.

func CollectPlans

func CollectPlans(ctx context.Context, dsn string, out sink.Sink, now time.Time) error

CollectPlans logs generic plans of the top statements.

func CollectPostgres

func CollectPostgres(ctx context.Context, dsn string, out sink.Sink, now time.Time) error

CollectPostgres runs one round against dsn.

func CollectSQLiteFile

func CollectSQLiteFile(out sink.Sink, path string, gen map[string]sqliteGen, now time.Time) error

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

func CollectSchema(ctx context.Context, dsn string, out sink.Sink, now time.Time) error

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

func CollectYugabyteDB(ctx context.Context, db *sql.DB, out sink.Sink, now time.Time) error

CollectYugabyteDB reads servers and local tablets.

func Consul

func Consul(ctx context.Context, raw json.RawMessage, out sink.Sink) error

Consul reads the agent's own Prometheus endpoint (telemetry.prometheus_retention_time > 0).

func CouchDB

func CouchDB(ctx context.Context, raw json.RawMessage, out sink.Sink) error

CouchDB polls a node every 30 s (url http://host:5984, an admin or a user with _node read).

func Couchbase

func Couchbase(ctx context.Context, raw json.RawMessage, out sink.Sink) error

Couchbase reads the native /metrics of Couchbase Server 7+ (port 8091, a read-only admin user).

func CypherSafe

func CypherSafe(q string) string

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 DBSlowLog

func DBSlowLog(ctx context.Context, raw json.RawMessage, out sink.Sink) error

DBSlowLog follows the log until ctx ends.

func Databricks

func Databricks(ctx context.Context, raw json.RawMessage, out sink.Sink) error

Databricks reads cluster states and active job runs of a workspace (personal access token).

func Dnsmasq

func Dnsmasq(ctx context.Context, raw json.RawMessage, out sink.Sink) error

Dnsmasq asks dnsmasq's CHAOS-class TXT names (cachesize.bind, hits.bind, ...) for its cache counters.

func Docker

func Docker(ctx context.Context, raw json.RawMessage, out sink.Sink) error

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

func EMQX(ctx context.Context, raw json.RawMessage, out sink.Sink) error

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

func Elasticsearch(ctx context.Context, raw json.RawMessage, out sink.Sink) error

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

func EmitApache(out sink.Sink, b []byte, now time.Time) error

EmitApache parses mod_status `?auto`.

func EmitCRDB

func EmitCRDB(out sink.Sink, kind string, rows []map[string]string, now time.Time)

EmitCRDB maps one view's rows (kind nodes, stores or contention).

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

func EmitCassandraJMX(out sink.Sink, rs []jolokiaResp, now time.Time)

EmitCassandraJMX turns the Jolokia responses of cassandraReads into series.

func EmitClickHouseHealth

func EmitClickHouseHealth(out sink.Sink, kind string, body []byte, now time.Time) error

EmitClickHouseHealth turns the rows of one health query (kind as in clickhouseHealthQueries).

func EmitClickHouseQueries

func EmitClickHouseQueries(out sink.Sink, body []byte, now time.Time) error

EmitClickHouseQueries turns JSONEachRow rows of clickhouseTopQueries into per-statement sums.

func EmitClusterInfo

func EmitClusterInfo(out sink.Sink, ci map[string]string, now time.Time)

EmitClusterInfo emits CLUSTER INFO slot and node health.

func EmitCollStats

func EmitCollStats(out sink.Sink, db, coll string, rows []bson.D, now time.Time)

EmitCollStats writes $collStats storage figures.

func EmitCouchDB

func EmitCouchDB(out sink.Sink, db string, info map[string]any, now time.Time)

EmitCouchDB emits one database's sizes, document counts and the share compaction would free.

func EmitCouchReplications

func EmitCouchReplications(out sink.Sink, docs []map[string]any, now time.Time)

EmitCouchReplications counts scheduler replication documents by state.

func EmitCouchStats

func EmitCouchStats(out sink.Sink, stats map[string]any, now time.Time) int

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

func EmitCouchTasks(out sink.Sink, tasks []map[string]any, now time.Time)

EmitCouchTasks counts active tasks by type with the oldest one's age and mean progress.

func EmitCurrentOp

func EmitCurrentOp(out sink.Sink, ops []bson.D, now time.Time)

EmitCurrentOp reports in-progress operations already running past the slow threshold.

func EmitDocker

func EmitDocker(out sink.Sink, body []byte, now time.Time) error

EmitDocker parses a /containers/json body.

func EmitDumpFiles

func EmitDumpFiles(out sink.Sink, f DumpFiles, now time.Time) error

EmitDumpFiles reports the newest file matching the glob that is at least MinBytes.

func EmitEMQXAlarms

func EmitEMQXAlarms(out sink.Sink, body []byte, now time.Time) error

EmitEMQXAlarms parses /api/v5/alarms?activated=true: active alarms per name (high_system_memory_usage, conn_congestion, ...).

func EmitEMQXMetrics

func EmitEMQXMetrics(out sink.Sink, body []byte, now time.Time) error

EmitEMQXMetrics parses /api/v5/metrics?aggregate=true.

func EmitEMQXNodes

func EmitEMQXNodes(out sink.Sink, body []byte, now time.Time) error

EmitEMQXNodes parses /api/v5/nodes.

func EmitEMQXStats

func EmitEMQXStats(out sink.Sink, body []byte, now time.Time) error

EmitEMQXStats parses /api/v5/stats: current counts (`x.count`) and their peaks (`x.max`).

func EmitESAllocation

func EmitESAllocation(out sink.Sink, sys string, ex map[string]any, now time.Time)

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

func EmitESHotThreads(out sink.Sink, sys, report string, now time.Time)

EmitESHotThreads emits the busiest thread's CPU share and files the report when it is past esHotCPU.

func EmitESNodes

func EmitESNodes(out sink.Sink, ns esNodeStats, now time.Time)

EmitESNodes writes per-node latency totals, thread pools, heap, GC and breakers.

func EmitESShards

func EmitESShards(out sink.Sink, shards []map[string]string, now time.Time) int

EmitESShards counts shards by state and primary/replica, and unassigned shards by reason. It returns the unassigned count.

func EmitESTasks

func EmitESTasks(out sink.Sink, sys string, t esTasks, now time.Time)

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

func EmitElasticsearch(out sink.Sink, b []byte, now time.Time) error

EmitElasticsearch parses _cluster/health. Status is 0 green, 1 yellow, 2 red.

func EmitElasticsearchIndices

func EmitElasticsearchIndices(out sink.Sink, idx []map[string]string, now time.Time)

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

func EmitHAProxy(out sink.Sink, b []byte, now time.Time) error

EmitHAProxy parses the CSV stats page: per proxy and server status, sessions, errors.

func EmitIndexStats

func EmitIndexStats(out sink.Sink, db, coll string, rows []bson.D, now time.Time)

EmitIndexStats writes $indexStats accesses (cumulative since the index was loaded).

func EmitJenkins

func EmitJenkins(out sink.Sink, comp, queue, jobs []byte, now time.Time) error

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

func EmitLatencyLatest(out sink.Sink, v any, now time.Time)

EmitLatencyLatest reads LATENCY LATEST: [event, unix time, latest ms, all-time max ms] rows.

func EmitMSSQLQueryStats

func EmitMSSQLQueryStats(out sink.Sink, d *dbm.Deltas, rows []map[string]string, now time.Time)

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

func EmitMSSQLQueryStore(out sink.Sink, rows []map[string]string, now time.Time)

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

func EmitMSSQLRegressions(out sink.Sink, rows []map[string]string, now time.Time)

EmitMSSQLRegressions reports queries that ran with more than one plan in the last hour.

func EmitMemcached

func EmitMemcached(out sink.Sink, st map[string]string, now time.Time)

EmitMemcached emits the headline stats.

func EmitMemcachedSlabs

func EmitMemcachedSlabs(out sink.Sink, slabs, items map[string]string, now time.Time)

EmitMemcachedSlabs emits per slab class memory (`stats slabs`) and item eviction figures (`stats items`): which item sizes are starved of memory.

func EmitMemoryDoctor

func EmitMemoryDoctor(out sink.Sink, sys, report string, now time.Time)

EmitMemoryDoctor files the MEMORY DOCTOR report as advice unless it found nothing.

func EmitMongoPlan

func EmitMongoPlan(out sink.Sink, e profEntry, reply bson.D, now time.Time)

EmitMongoPlan writes the redacted winning plan of an explain reply.

func EmitMosquittoSys

func EmitMosquittoSys(out sink.Sink, sys map[string]string, now time.Time)

EmitMosquittoSys turns $SYS topic values into series.

func EmitMySQLDigests

func EmitMySQLDigests(out sink.Sink, d *dbm.Deltas, rows []map[string]string, now time.Time)

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

func EmitMySQLReplica(out sink.Sink, r map[string]string, now time.Time)

EmitMySQLReplica reads one SHOW REPLICA|SLAVE STATUS row (either naming).

func EmitNATSJsz

func EmitNATSJsz(out sink.Sink, body []byte, now time.Time) error

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

func EmitNATSVarz(out sink.Sink, body []byte, now time.Time) error

EmitNATSVarz parses /varz.

func EmitNeo4j

func EmitNeo4j(out sink.Sink, r neo4jResult, slowMs int, now time.Time)

EmitNeo4j turns the SHOW TRANSACTIONS and SHOW DATABASES rows into series, samples and chains.

func EmitNginx

func EmitNginx(out sink.Sink, b []byte, now time.Time) error

EmitNginx parses stub_status.

func EmitOracleRound

func EmitOracleRound(out sink.Sink, rows []map[string]string, kind string, now time.Time)

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

func EmitPgBackRest(out sink.Sink, p PgBackRest, b []byte, now time.Time) error

EmitPgBackRest reads `pgbackrest info --output=json`: per stanza and backup type, the newest backup without an error.

func EmitPlan

func EmitPlan(out sink.Sink, engine, id, query, plan string, now time.Time)

EmitPlan writes one plan as a log record with its total cost.

func EmitPulsarTopicStats

func EmitPulsarTopicStats(out sink.Sink, topic string, body []byte, now time.Time) error

EmitPulsarTopicStats parses one topic's admin stats.

func EmitRabbitFederation

func EmitRabbitFederation(out sink.Sink, body []byte, now time.Time) error

EmitRabbitFederation parses /api/federation-links: 1 while a link is running, 0 otherwise.

func EmitRabbitNodes

func EmitRabbitNodes(out sink.Sink, body []byte, now time.Time) error

EmitRabbitNodes parses /api/nodes (needs the monitoring tag): resource use and alarms per node.

func EmitRabbitOverview

func EmitRabbitOverview(out sink.Sink, body []byte, now time.Time) error

EmitRabbitOverview parses /api/overview; every series carries the cluster name.

func EmitRabbitQueues

func EmitRabbitQueues(out sink.Sink, body []byte, now time.Time) error

EmitRabbitQueues parses /api/queues: a paged `{items: [...]}` object or a plain array.

func EmitRabbitShovels

func EmitRabbitShovels(out sink.Sink, body []byte, now time.Time) error

EmitRabbitShovels parses /api/shovels: 1 while a shovel is running, 0 otherwise.

func EmitRabbitStreamConsumers

func EmitRabbitStreamConsumers(out sink.Sink, body []byte, now time.Time) error

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 EmitRedis

func EmitRedis(out sink.Sink, info map[string]string, now time.Time)

EmitRedis turns parsed INFO into metrics.

func EmitRedisStats

func EmitRedisStats(out sink.Sink, info map[string]string, now time.Time)

EmitRedisStats emits commandstats, latencystats, errorstats, keyspace expiry and replica lag.

func EmitReplSet

func EmitReplSet(out sink.Sink, rs any, now time.Time)

EmitReplSet emits each member's health and its optime lag behind the primary.

func EmitSAPLongRunning

func EmitSAPLongRunning(out sink.Sink, body []byte, minS int, now time.Time) error

EmitSAPLongRunning counts, per type, the work processes of an ABAPGetWPTable response that have been running for at least minS seconds.

func EmitSAPProcesses

func EmitSAPProcesses(out sink.Sink, body []byte, now time.Time) error

EmitSAPProcesses parses a GetProcessList response: one sap.process.status per process.

func EmitSAPQueues

func EmitSAPQueues(out sink.Sink, body []byte, now time.Time) error

EmitSAPQueues parses a GetQueueStatistic response: current, peak and maximum length of each dispatcher queue (DIA, BTC, UPD, ...).

func EmitSAPWorkProcesses

func EmitSAPWorkProcesses(out sink.Sink, body []byte, now time.Time) error

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

func EmitServerStatus(out sink.Sink, ss any, now time.Time) bool

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

func EmitSlowQuery(out sink.Sink, engine string, q SlowQuery, at time.Time)

EmitSlowQuery writes the sample and, when there is one, the plan.

func EmitSnowflake

func EmitSnowflake(out sink.Sink, kind string, rows [][]any, now time.Time)

EmitSnowflake writes one SQL API result (`[[key, number-as-string], ...]`).

func EmitSquid

func EmitSquid(out sink.Sink, b []byte, now time.Time) error

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

func EmitTiDBStores(out sink.Sink, rows []map[string]string, now time.Time)

EmitTiDBStores reports each TiKV/TiFlash store.

func EmitWiredTiger

func EmitWiredTiger(out sink.Sink, ss any, now time.Time)

EmitWiredTiger emits storage-engine cache, eviction, ticket and latency figures of serverStatus.

func EmitYB

func EmitYB(out sink.Sink, kind string, rows []map[string]string, now time.Time)

EmitYB maps rows of kind servers or tablets.

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

func EmitYBStatements(out sink.Sink, d *dbm.Deltas, rows []map[string]string, now time.Time)

EmitYBStatements turns one read of pg_stat_statements into per-queryid series.

func Envoy

func Envoy(ctx context.Context, raw json.RawMessage, out sink.Sink) error

Envoy reads the admin listener's /stats/prometheus (port 9901).

func Etcd

func Etcd(ctx context.Context, raw json.RawMessage, out sink.Sink) error

Etcd scrapes a member (use the plain-HTTP --listen-metrics-urls port, 2381 by convention, when 2379 requires client certificates).

func GitHub

func GitHub(ctx context.Context, raw json.RawMessage, out sink.Sink) error

GitHub reads repository counters and the token's API rate limit.

func GitLab

func GitLab(ctx context.Context, raw json.RawMessage, out sink.Sink) error

GitLab reads /-/metrics of a self-managed instance (the agent's address on the monitoring allowlist).

func HTTPStatus

func HTTPStatus(ctx context.Context, raw json.RawMessage, out sink.Sink) error

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 HyperV

func HyperV(ctx context.Context, raw json.RawMessage, out sink.Sink) error

HyperV reads the Hyper-V collector of windows_exporter (VMs, vCPU, memory, switches).

func IIS

func IIS(ctx context.Context, raw json.RawMessage, out sink.Sink) error

IIS scrapes windows_exporter's iis collector.

func IntervalQuantile

func IntervalQuantile(prev, cur []*dto.Bucket, q float64) (float64, bool)

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

func Istio(ctx context.Context, raw json.RawMessage, out sink.Sink) error

Istio reads istiod's monitoring port (15014): xDS pushes, proxy convergence, cert signing.

func JMX

func JMX(ctx context.Context, raw json.RawMessage, out sink.Sink) error

JMX reads JVM (or any MBean) numbers through a Jolokia agent as `jmx.attribute{mbean,attribute}`.

func Jenkins

func Jenkins(ctx context.Context, raw json.RawMessage, out sink.Sink) error

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 JobQueue

func JobQueue(fw string) func(context.Context, json.RawMessage, sink.Sink) error

JobQueue returns the module of one job framework.

func Kafka

func Kafka(ctx context.Context, raw json.RawMessage, out sink.Sink) error

Kafka reports consumer lag per group and partition, and under-replicated and offline partitions per topic, through the Kafka admin API.

func Kinesis

func Kinesis(ctx context.Context, raw json.RawMessage, out sink.Sink) error

Kinesis scrapes a CloudWatch exporter (YACE or cloudwatch_exporter) configured for AWS/Kinesis.

func Kong

func Kong(ctx context.Context, raw json.RawMessage, out sink.Sink) error

Kong reads the Prometheus plugin's /metrics on the Admin or Status API.

func Listen

func Listen(ctx context.Context, raw json.RawMessage, out sink.Sink) error

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 MSSQL

func MSSQL(ctx context.Context, raw json.RawMessage, out sink.Sink) error

MSSQL collects from SQL Server through the DMVs.

func MSSQLActivity

func MSSQLActivity(rows []map[string]string) []dbm.Activity

MSSQLActivity maps sampled requests.

func MSSQLBlocking

func MSSQLBlocking(out sink.Sink, rows []map[string]string, now time.Time)

MSSQLBlocking emits one gauge per blocked session.

func Memcached

func Memcached(ctx context.Context, raw json.RawMessage, out sink.Sink) error

Memcached sends `stats` over the text protocol.

func Milvus

func Milvus(ctx context.Context, raw json.RawMessage, out sink.Sink) error

Milvus reads a component's /metrics (port 9091): proxy search latency, entities, collections.

func MinIO

func MinIO(ctx context.Context, raw json.RawMessage, out sink.Sink) error

MinIO reads the cluster metrics (v2); Token is the bearer from `mc admin prometheus generate`.

func MongoDB

func MongoDB(ctx context.Context, raw json.RawMessage, out sink.Sink) error

MongoDB runs serverStatus and replSetGetStatus, then the deeper reads of mongodb_dbm.go.

func Mosquitto

func Mosquitto(ctx context.Context, raw json.RawMessage, out sink.Sink) error

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 MySQL

func MySQL(ctx context.Context, raw json.RawMessage, out sink.Sink) error

MySQL collects global status, replica lag and the top 50 statement digests.

func MySQLActivity

func MySQLActivity(rows []map[string]string) []dbm.Activity

MySQLActivity maps sampled rows; a wait "wait/io/table/sql/handler" has type "io".

func MySQLBlocking

func MySQLBlocking(out sink.Sink, rows []map[string]string, now time.Time)

MySQLBlocking turns sys.innodb_lock_waits rows into blocking chains.

func NATS

func NATS(ctx context.Context, raw json.RawMessage, out sink.Sink) error

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 NTP added in v0.3.1

func NTP(ctx context.Context, raw json.RawMessage, out sink.Sink) error

NTP queries each server with one SNTP request per round and reports `ntp.offset` (positive: the local clock is behind), `ntp.offset_abs`, `ntp.delay` and `ntp.stratum` per server.

func Neo4j

func Neo4j(ctx context.Context, raw json.RawMessage, out sink.Sink) error

Neo4j polls transactions and databases every 30 s.

func Nomad

func Nomad(ctx context.Context, raw json.RawMessage, out sink.Sink) error

Nomad reads /v1/metrics (telemetry.prometheus_metrics = true); Token is an ACL token.

func NormalizePodConfig

func NormalizePodConfig(module string, cfg map[string]any) map[string]any

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 Okta added in v0.3.1

func Okta(ctx context.Context, raw json.RawMessage, out sink.Sink) error

Okta polls the System Log and counts events by type and outcome as `okta.system_log.events` (cumulative since the agent started). shortcut: one page of up to 1000 events per round, so a burst beyond that between polls is under-counted; shorten the interval.

func OplogWindow

func OplogWindow(first, last bson.Timestamp) float64

OplogWindow is the time the oplog covers, from its first and last entries.

func Oracle

func Oracle(ctx context.Context, raw json.RawMessage, out sink.Sink) error

Oracle reads Oracle natively when dsn is set, else scrapes oracledb_exporter.

func OracleActivity

func OracleActivity(rows []map[string]string) []dbm.Activity

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 PackCollectors added in v0.3.1

func PackCollectors() map[string]Collector

PackCollectors returns the collectors of the 2026-11 integration pack by module name: the Prometheus-endpoint products, the Jolokia servers, the host and status-page checks.

func PackNames added in v0.3.1

func PackNames() []string

PackNames is PackCollectors' keys, sorted.

func ParseRedisInfo

func ParseRedisInfo(s string) map[string]string

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

func Pinecone(ctx context.Context, raw json.RawMessage, out sink.Sink) error

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

func Postgres(ctx context.Context, raw json.RawMessage, out sink.Sink) error

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

func Pulsar(ctx context.Context, raw json.RawMessage, out sink.Sink) error

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 Qdrant

func Qdrant(ctx context.Context, raw json.RawMessage, out sink.Sink) error

Qdrant reads /metrics (port 6333); Token is the api-key when the instance has one.

func RabbitMQ

func RabbitMQ(ctx context.Context, raw json.RawMessage, out sink.Sink) error

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

func ReadMemcachedStats(r *bufio.Reader) (map[string]string, error)

ReadMemcachedStats reads `STAT name value` lines up to END.

func RedactPlan

func RedactPlan(v any) (any, bool)

RedactPlan keeps stages, index names and key patterns of a plan and shapes every value-bearing part.

func Redis

func Redis(ctx context.Context, raw json.RawMessage, out sink.Sink) error

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

func RedisSystem(info map[string]string) (string, string)

RedisSystem names the server from INFO: redis, valkey, dragonfly or keydb.

func RunAnnotated

func RunAnnotated(ctx context.Context, list func() []PodCheck, out sink.Sink, every time.Duration)

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

func SAPControl(ctx context.Context, raw json.RawMessage, out sink.Sink) error

SAPControl polls GetProcessList and ABAPGetWPTable (the latter only exists on ABAP instances).

func SQLite

func SQLite(ctx context.Context, raw json.RawMessage, out sink.Sink) error

SQLite watches the files until ctx ends.

func ScrubShowplan

func ScrubShowplan(plan string) string

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

func ScyllaDB(ctx context.Context, raw json.RawMessage, out sink.Sink) error

ScyllaDB scrapes the node's Prometheus endpoint (default http://host:9180/metrics).

func Snowflake

func Snowflake(ctx context.Context, raw json.RawMessage, out sink.Sink) error

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 Solr

func Solr(ctx context.Context, raw json.RawMessage, out sink.Sink) error

Solr reads the solr-exporter (port 9854).

func Squid

func Squid(ctx context.Context, raw json.RawMessage, out sink.Sink) error

Squid reads the cache manager's counters page (`squid-internal-mgr/counters`).

func Systemd added in v0.3.1

func Systemd(ctx context.Context, raw json.RawMessage, out sink.Sink) error

Systemd reports `systemd.unit.active` (1 while active, with active_state and sub_state) per service unit and `systemd.units.failed` from `systemctl list-units`.

func TLSCert added in v0.3.1

func TLSCert(ctx context.Context, raw json.RawMessage, out sink.Sink) error

TLSCert reports `tls.cert.expiry_seconds` (negative once expired) and `tls.cert.hostname_match` for each target's leaf certificate and each certificate in each file.

func TiDB

func TiDB(ctx context.Context, raw json.RawMessage, out sink.Sink) error

TiDB collects one TiDB cluster.

func Tomcat

func Tomcat(ctx context.Context, raw json.RawMessage, out sink.Sink) error

Tomcat reads Catalina MBeans through a Jolokia agent (or the jolokia.war in webapps).

func Traefik

func Traefik(ctx context.Context, raw json.RawMessage, out sink.Sink) error

Traefik reads the entrypoint's /metrics (metrics.prometheus enabled).

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 Vault

func Vault(ctx context.Context, raw json.RawMessage, out sink.Sink) error

Vault reads /v1/sys/metrics; Token is a Vault token with read on sys/metrics.

func Weaviate

func Weaviate(ctx context.Context, raw json.RawMessage, out sink.Sink) error

Weaviate reads the PROMETHEUS_MONITORING_ENABLED endpoint (port 2112).

func Windows

func Windows(ctx context.Context, raw json.RawMessage, out sink.Sink) error

Windows scrapes windows_exporter: perf counters, services, IIS and (for Hyper-V) hyperv.

func YugabyteDB

func YugabyteDB(ctx context.Context, raw json.RawMessage, out sink.Sink) error

YugabyteDB collects one YugabyteDB node.

func Zookeeper

func Zookeeper(ctx context.Context, raw json.RawMessage, out sink.Sink) error

Zookeeper reads the PrometheusMetricsProvider endpoint (port 7000); its names are unprefixed.

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 Base

type Base struct {
	Enabled  *bool  `json:"enabled"`
	Interval string `json:"interval"`
}

Base is the part of every module config that remote config may change.

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 Collector added in v0.3.1

type Collector = func(context.Context, json.RawMessage, sink.Sink) error

Collector is a module body: it runs until ctx ends and reports through out.

func CollectorFor added in v0.3.1

func CollectorFor(kind string) Collector

CollectorFor returns the URL-driven collector for a manifest's module kind: the 2026-11 pack and the earlier Prometheus-endpoint packs. It is what `wtctl integration test` replays a recorded payload through; kinds that need a database connection return nil.

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

type Detected struct {
	Integration string
	Port        int
	Process     string
}

Detected is a manifest matched by a listening socket.

func Match

func Match(ms []*Manifest, socks []Socket) []Detected

Match returns, per socket, the first manifest (in name order) whose discovery lists the socket's port or process name (case-insensitive, `.exe` ignored). A process name wins over a port, so a service on a non-standard port is still found.

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

type DnsmasqConfig struct {
	Base
	Address string `json:"address"`
}

DnsmasqConfig is the dnsmasq DNS address (host:port, default 127.0.0.1:53).

type DockerConfig

type DockerConfig struct {
	Base
	Socket string `json:"socket"`
	URL    string `json:"url"`
}

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 LogsDoc added in v0.3.1

type LogsDoc struct {
	Paths    []string       `yaml:"paths" json:"paths"`
	Pipeline map[string]any `yaml:"pipeline" json:"pipeline"`
}

LogsDoc is a manifest's log pipeline: file globs (or pseudo sources such as eventlog://Application) and a pipeline config v1 (crates/wt-pipeline) applied to records the agent tags with `agent.integration=<name>`.

type MBeanRead

type MBeanRead struct {
	MBean      string   `json:"mbean"`
	Attributes []string `json:"attributes"`
}

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"`
	// Logs says where the product writes logs and how to parse them. Optional: SaaS and
	// metrics-only integrations have none.
	Logs *LogsDoc `yaml:"logs,omitempty" json:"logs,omitempty"`
}

Manifest is one integrations/<name>/manifest.yaml (shape: integrations/schema.json).

func LoadFS

func LoadFS(fsys fs.FS) ([]*Manifest, error)

LoadFS reads <dir>/manifest.yaml for every directory of fsys, sorted by name.

func Parse

func Parse(b []byte) (*Manifest, error)

Parse decodes one manifest strictly (unknown fields are an error) and validates it.

func (*Manifest) Validate

func (m *Manifest) Validate() error

Validate checks what integrations/schema.json states.

type MemcachedConfig

type MemcachedConfig struct {
	Base
	Addr string `json:"addr"`
}

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 NTPConfig added in v0.3.1

type NTPConfig struct {
	Base
	Servers []string `json:"servers"`
}

NTPConfig is the ntp module config: the servers to query (host or host:port; port 123).

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 OktaConfig added in v0.3.1

type OktaConfig struct {
	Base
	URL   string `json:"url"`
	Token string `json:"token"`
}

OktaConfig is the okta module config: the org URL and an API token (SSWS) with log read access.

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

type SQLiteConfig struct {
	Base
	Paths []string `json:"paths"`
}

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

func ParseMySQLSlow(body string) []SlowQuery

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

func ParsePGSlow(body string) (SlowQuery, bool)

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 Socket

type Socket struct {
	Port    int
	Process string
}

Socket is one listening TCP socket and the process that owns it.

func ListeningSockets

func ListeningSockets(ctx context.Context) ([]Socket, error)

ListeningSockets lists TCP sockets in LISTEN state with their process names, by port.

type StatusPageConfig added in v0.3.1

type StatusPageConfig struct {
	Base
	URL string `json:"url"`
}

StatusPageConfig is the config of the vendor status integrations (githubstatus.com, Twilio, Stripe). URL is optional: each has a default public endpoint.

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 SystemdConfig added in v0.3.1

type SystemdConfig struct {
	Base
	Units []string `json:"units"`
}

SystemdConfig is the systemd module config. Units limits the report to these unit names (globs allowed, e.g. "nginx.service", "postgresql@*.service"); empty reports every service unit.

type TLSCertConfig added in v0.3.1

type TLSCertConfig struct {
	Base
	Targets []string `json:"targets"`
	Files   []string `json:"files"`
}

TLSCertConfig is the tlscert module config: host:port targets to handshake with and PEM files to read. Both live only in the agent's own file.

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).

Jump to

Keyboard shortcuts

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