metadata

package
v0.41.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const Type config.Type = "postgresql"

Type is the component type name.

Variables

A is an alias for Attributes.

View Source
var AttributeOperation = struct {
	Ins    string
	Upd    string
	Del    string
	HotUpd string
}{
	"ins",
	"upd",
	"del",
	"hot_upd",
}

AttributeOperation are the possible values that the attribute "operation" can have.

View Source
var AttributeSource = struct {
	HeapRead  string
	HeapHit   string
	IdxRead   string
	IdxHit    string
	ToastRead string
	ToastHit  string
	TidxRead  string
	TidxHit   string
}{
	"heap_read",
	"heap_hit",
	"idx_read",
	"idx_hit",
	"toast_read",
	"toast_hit",
	"tidx_read",
	"tidx_hit",
}

AttributeSource are the possible values that the attribute "source" can have.

View Source
var AttributeState = struct {
	Dead string
	Live string
}{
	"dead",
	"live",
}

AttributeState are the possible values that the attribute "state" can have.

View Source
var Attributes = struct {
	// Database (The name of the database.)
	Database string
	// Operation (The database operation.)
	Operation string
	// Source (The block read source type.)
	Source string
	// State (The tuple (row) state.)
	State string
	// Table (The schema name followed by the table name.)
	Table string
}{
	"database",
	"operation",
	"source",
	"state",
	"table",
}

Attributes contains the possible metric attributes that can be used.

M contains a set of methods for each metric that help with manipulating those metrics. M is an alias for Metrics

View Source
var Metrics = &metricStruct{
	&metricImpl{
		"postgresql.backends",
		func(metric pdata.Metric) {
			metric.SetName("postgresql.backends")
			metric.SetDescription("The number of backends.")
			metric.SetUnit("1")
			metric.SetDataType(pdata.MetricDataTypeSum)
			metric.Sum().SetIsMonotonic(false)
			metric.Sum().SetAggregationTemporality(pdata.MetricAggregationTemporalityCumulative)
		},
	},
	&metricImpl{
		"postgresql.blocks_read",
		func(metric pdata.Metric) {
			metric.SetName("postgresql.blocks_read")
			metric.SetDescription("The number of blocks read.")
			metric.SetUnit("1")
			metric.SetDataType(pdata.MetricDataTypeSum)
			metric.Sum().SetIsMonotonic(true)
			metric.Sum().SetAggregationTemporality(pdata.MetricAggregationTemporalityCumulative)
		},
	},
	&metricImpl{
		"postgresql.commits",
		func(metric pdata.Metric) {
			metric.SetName("postgresql.commits")
			metric.SetDescription("The number of commits.")
			metric.SetUnit("1")
			metric.SetDataType(pdata.MetricDataTypeSum)
			metric.Sum().SetIsMonotonic(true)
			metric.Sum().SetAggregationTemporality(pdata.MetricAggregationTemporalityCumulative)
		},
	},
	&metricImpl{
		"postgresql.db_size",
		func(metric pdata.Metric) {
			metric.SetName("postgresql.db_size")
			metric.SetDescription("The database disk usage.")
			metric.SetUnit("By")
			metric.SetDataType(pdata.MetricDataTypeSum)
			metric.Sum().SetIsMonotonic(false)
			metric.Sum().SetAggregationTemporality(pdata.MetricAggregationTemporalityCumulative)
		},
	},
	&metricImpl{
		"postgresql.operations",
		func(metric pdata.Metric) {
			metric.SetName("postgresql.operations")
			metric.SetDescription("The number of db row operations.")
			metric.SetUnit("1")
			metric.SetDataType(pdata.MetricDataTypeSum)
			metric.Sum().SetIsMonotonic(true)
			metric.Sum().SetAggregationTemporality(pdata.MetricAggregationTemporalityCumulative)
		},
	},
	&metricImpl{
		"postgresql.rollbacks",
		func(metric pdata.Metric) {
			metric.SetName("postgresql.rollbacks")
			metric.SetDescription("The number of rollbacks.")
			metric.SetUnit("1")
			metric.SetDataType(pdata.MetricDataTypeSum)
			metric.Sum().SetIsMonotonic(true)
			metric.Sum().SetAggregationTemporality(pdata.MetricAggregationTemporalityCumulative)
		},
	},
	&metricImpl{
		"postgresql.rows",
		func(metric pdata.Metric) {
			metric.SetName("postgresql.rows")
			metric.SetDescription("The number of rows in the database.")
			metric.SetUnit("1")
			metric.SetDataType(pdata.MetricDataTypeSum)
			metric.Sum().SetIsMonotonic(false)
			metric.Sum().SetAggregationTemporality(pdata.MetricAggregationTemporalityCumulative)
		},
	},
}

Metrics contains a set of methods for each metric that help with manipulating those metrics.

Functions

This section is empty.

Types

type MetricIntf

type MetricIntf interface {
	Name() string
	New() pdata.Metric
	Init(metric pdata.Metric)
}

MetricIntf is an interface to generically interact with generated metric.

Jump to

Keyboard shortcuts

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