package
0.7.0
Repository: https://github.com/vonng/pg_exporter.git
Documentation: pkg.go.dev

# Functions

DryRun will explain all query fetched from configs.
DummyServer response with a dummy metrics pg_up 0 or pgbouncer_up 0.
GetConfig will try load config from target path.
GetPGURL will retrieve, parse, modify postgres connection string.
LoadConfig will read single conf file or read multiple conf file if a dir is given conf file in a dir will be load in alphabetic order, query with same name will overwrite predecessor.
NewCollector will generate query instance from query, Injecting a server object.
NewExporter construct a PG Exporter instance for given dsn.
NewServer will check dsn, but not trying to connect.
ParseArgs will parse cli args with kingpin.
ParseConfig turn config content into Query struct.
ParseDatname extract database name part of a pgurl.
ParseQuery generate a single query from config string.
ParseSemver will turn semantic version string into integer.
PgbouncerPrecheck checks pgbouncer connection before scrape.
PostgresPrecheck checks postgres connection and gathering facts if any important fact changed, it will trigger a plan before next scrape.
ProcessPGURL will fix URL with default options.
Reload will launch a new pg exporter instance.
ReloadFunc handles reload request.
ReplaceDatname will replace pgurl with new database name.
RetrievePGURL retrieve pg target url from multiple sources according to precedence priority: cli-args > env > env file path 1.
Run pg_exporter.
ShadowPGURL will hide password part of dsn.
TitleFunc responding a description message.
VersionFunc responding current pg_exporter version.
WithAutoDiscovery configures exporter with excluded database.
WithCacheDisabled set cache param to exporter.
WithCachePolicy will pass cache option to server.
WithConfig add config path to Exporter.
WithConnectTimeout will specify timeout for conn pre-check.
WithConstLabel copy constant label map to server.
WithConstLabels add const label to exporter.
WithExcludeDatabase configures exporter with excluded database.
WithFailFast marks exporter fail instead of waiting during start-up.
WithIncludeDatabase configures exporter with included database.
WithIntroDisabled will pass introspection option to server.
WithNamespace will specify metric namespace, by default is pg or pgbouncer.
WithQueries set server's default query set.
WithServerConnectTimeout will set a connect timeout for server precheck queries otherwise, a default value 100ms will be used.
WithServerTags will mark server only execute query without cluster tag.
WithTags will register given tags to Exporter and all belonged servers.

# Constants

Use this column as a counter.
Ignore this column (when SELECT *).
Use this column as a gauge.
Use this column as a histogram.
Use this column as a label.

# Variables

ColumnUsage determine how to use query result column.
PgExporter is the global singleton of Exporter.
PgExporter is the global singleton of Exporter.
PgExporter is the global singleton of Exporter.
Version is read by make build procedure.

# Structs

Collector holds runtime information of a Query running on a Server It is deeply coupled with Server.
Column holds the metadata of query result.
Exporter implement prometheus.Collector interface exporter contains one or more (auto-discover-database) servers that can scrape metrics with Query.
MetricDesc is generated by collector's column definition.
A PredicateQuery is a query that returns a 1-column resultset that's used to decide whether to run the main query.
Query hold the information of how to fetch metric and parse them.
Server represent a postgres connection, with additional fact, conf, runtime info.

# Type aliases

ExporterOpt configures Exporter.
ServerOpt configures Server.