collector

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Copyright 2023 The Prometheus Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2023 The Prometheus Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var ErrNoData = errors.New("collector returned no data")

ErrNoData indicates the collector found no data to collect, but had no other error.

Functions

func IsNoDataError

func IsNoDataError(err error) bool

Types

type Collector

type Collector interface {
	Update(ctx context.Context, instance *instance, ch chan<- prometheus.Metric) error
}

func NewPGDatabaseCollector

func NewPGDatabaseCollector(config collectorConfig) (Collector, error)

func NewPGDatabaseWraparoundCollector

func NewPGDatabaseWraparoundCollector(config collectorConfig) (Collector, error)

func NewPGLocksCollector

func NewPGLocksCollector(config collectorConfig) (Collector, error)

func NewPGLongRunningTransactionsCollector

func NewPGLongRunningTransactionsCollector(config collectorConfig) (Collector, error)

func NewPGPostmasterCollector

func NewPGPostmasterCollector(collectorConfig) (Collector, error)

func NewPGProcessIdleCollector

func NewPGProcessIdleCollector(config collectorConfig) (Collector, error)

func NewPGReplicationCollector

func NewPGReplicationCollector(collectorConfig) (Collector, error)

func NewPGReplicationSlotCollector

func NewPGReplicationSlotCollector(config collectorConfig) (Collector, error)

func NewPGStatActivityAutovacuumCollector

func NewPGStatActivityAutovacuumCollector(config collectorConfig) (Collector, error)

func NewPGStatBGWriterCollector

func NewPGStatBGWriterCollector(collectorConfig) (Collector, error)

func NewPGStatDatabaseCollector

func NewPGStatDatabaseCollector(config collectorConfig) (Collector, error)

func NewPGStatIOUserTablesCollector

func NewPGStatIOUserTablesCollector(config collectorConfig) (Collector, error)

func NewPGStatStatementsCollector

func NewPGStatStatementsCollector(config collectorConfig) (Collector, error)

func NewPGStatUserTablesCollector

func NewPGStatUserTablesCollector(config collectorConfig) (Collector, error)

func NewPGStatWalReceiverCollector

func NewPGStatWalReceiverCollector(config collectorConfig) (Collector, error)

func NewPGStatioUserIndexesCollector

func NewPGStatioUserIndexesCollector(config collectorConfig) (Collector, error)

func NewPGWALCollector

func NewPGWALCollector(config collectorConfig) (Collector, error)

func NewPGXlogLocationCollector

func NewPGXlogLocationCollector(config collectorConfig) (Collector, error)

type PGDatabaseCollector

type PGDatabaseCollector struct {
	// contains filtered or unexported fields
}

func (PGDatabaseCollector) Update

func (c PGDatabaseCollector) Update(ctx context.Context, instance *instance, ch chan<- prometheus.Metric) error

Update implements Collector and exposes database size. It is called by the Prometheus registry when collecting metrics. The list of databases is retrieved from pg_database and filtered by the excludeDatabase config parameter. The tradeoff here is that we have to query the list of databases and then query the size of each database individually. This is because we can't filter the list of databases in the query because the list of excluded databases is dynamic.

type PGDatabaseWraparoundCollector

type PGDatabaseWraparoundCollector struct {
}

func (*PGDatabaseWraparoundCollector) Update

func (c *PGDatabaseWraparoundCollector) Update(ctx context.Context, instance *instance, ch chan<- prometheus.Metric) error

type PGLocksCollector

type PGLocksCollector struct {
}

func (PGLocksCollector) Update

func (c PGLocksCollector) Update(ctx context.Context, instance *instance, ch chan<- prometheus.Metric) error

Update implements Collector and exposes database locks. It is called by the Prometheus registry when collecting metrics.

type PGLongRunningTransactionsCollector

type PGLongRunningTransactionsCollector struct {
}

func (PGLongRunningTransactionsCollector) Update

func (PGLongRunningTransactionsCollector) Update(ctx context.Context, instance *instance, ch chan<- prometheus.Metric) error

type PGPostmasterCollector

type PGPostmasterCollector struct {
}

func (*PGPostmasterCollector) Update

func (c *PGPostmasterCollector) Update(ctx context.Context, instance *instance, ch chan<- prometheus.Metric) error

type PGProcessIdleCollector

type PGProcessIdleCollector struct {
}

func (PGProcessIdleCollector) Update

func (PGProcessIdleCollector) Update(ctx context.Context, instance *instance, ch chan<- prometheus.Metric) error

type PGReplicationCollector

type PGReplicationCollector struct {
}

func (*PGReplicationCollector) Update

func (c *PGReplicationCollector) Update(ctx context.Context, instance *instance, ch chan<- prometheus.Metric) error

type PGReplicationSlotCollector

type PGReplicationSlotCollector struct {
}

func (PGReplicationSlotCollector) Update

func (PGReplicationSlotCollector) Update(ctx context.Context, instance *instance, ch chan<- prometheus.Metric) error

type PGStatActivityAutovacuumCollector

type PGStatActivityAutovacuumCollector struct {
}

func (PGStatActivityAutovacuumCollector) Update

func (PGStatActivityAutovacuumCollector) Update(ctx context.Context, instance *instance, ch chan<- prometheus.Metric) error

type PGStatBGWriterCollector

type PGStatBGWriterCollector struct {
}

func (PGStatBGWriterCollector) Update

func (PGStatBGWriterCollector) Update(ctx context.Context, instance *instance, ch chan<- prometheus.Metric) error

type PGStatDatabaseCollector

type PGStatDatabaseCollector struct {
}

func (*PGStatDatabaseCollector) Update

func (c *PGStatDatabaseCollector) Update(ctx context.Context, instance *instance, ch chan<- prometheus.Metric) error

type PGStatIOUserTablesCollector

type PGStatIOUserTablesCollector struct {
}

func (PGStatIOUserTablesCollector) Update

func (PGStatIOUserTablesCollector) Update(ctx context.Context, instance *instance, ch chan<- prometheus.Metric) error

type PGStatStatementsCollector

type PGStatStatementsCollector struct {
}

func (PGStatStatementsCollector) Update

func (PGStatStatementsCollector) Update(ctx context.Context, instance *instance, ch chan<- prometheus.Metric) error

type PGStatUserTablesCollector

type PGStatUserTablesCollector struct {
}

func (*PGStatUserTablesCollector) Update

func (c *PGStatUserTablesCollector) Update(ctx context.Context, instance *instance, ch chan<- prometheus.Metric) error

type PGStatWalReceiverCollector

type PGStatWalReceiverCollector struct {
}

func (*PGStatWalReceiverCollector) Update

func (c *PGStatWalReceiverCollector) Update(ctx context.Context, instance *instance, ch chan<- prometheus.Metric) error

type PGStatioUserIndexesCollector

type PGStatioUserIndexesCollector struct {
}

func (*PGStatioUserIndexesCollector) Update

func (c *PGStatioUserIndexesCollector) Update(ctx context.Context, instance *instance, ch chan<- prometheus.Metric) error

type PGWALCollector

type PGWALCollector struct {
}

func (PGWALCollector) Update

func (c PGWALCollector) Update(ctx context.Context, instance *instance, ch chan<- prometheus.Metric) error

type PGXlogLocationCollector

type PGXlogLocationCollector struct {
}

func (PGXlogLocationCollector) Update

func (c PGXlogLocationCollector) Update(ctx context.Context, instance *instance, ch chan<- prometheus.Metric) error

type ProbeCollector

type ProbeCollector struct {
	// contains filtered or unexported fields
}

func NewProbeCollector

func NewProbeCollector(dsn dsn.DSN, enabledCollectors []string) (*ProbeCollector, error)

func (*ProbeCollector) Close

func (pc *ProbeCollector) Close() error

func (*ProbeCollector) Collect

func (pc *ProbeCollector) Collect(ch chan<- prometheus.Metric)

func (*ProbeCollector) Describe

func (pc *ProbeCollector) Describe(ch chan<- *prometheus.Desc)

Jump to

Keyboard shortcuts

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