metadata

package
v0.99.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetricsStability = component.StabilityLevelAlpha
)

Variables

View Source
var MapAttributeDiskDirection = map[string]AttributeDiskDirection{
	"read":  AttributeDiskDirectionRead,
	"write": AttributeDiskDirectionWrite,
}

MapAttributeDiskDirection is a helper map of string to AttributeDiskDirection attribute value.

View Source
var MapAttributeDiskState = map[string]AttributeDiskState{
	"available": AttributeDiskStateAvailable,
	"used":      AttributeDiskStateUsed,
}

MapAttributeDiskState is a helper map of string to AttributeDiskState attribute value.

View Source
var MapAttributeDiskType = map[string]AttributeDiskType{
	"virtual":  AttributeDiskTypeVirtual,
	"physical": AttributeDiskTypePhysical,
}

MapAttributeDiskType is a helper map of string to AttributeDiskType attribute value.

View Source
var MapAttributeThroughputDirection = map[string]AttributeThroughputDirection{
	"transmitted": AttributeThroughputDirectionTransmitted,
	"received":    AttributeThroughputDirectionReceived,
}

MapAttributeThroughputDirection is a helper map of string to AttributeThroughputDirection attribute value.

MapAttributeVMCountPowerState is a helper map of string to AttributeVMCountPowerState attribute value.

View Source
var (
	Type = component.MustNewType("vcenter")
)

Functions

func Meter added in v0.92.0

func Meter(settings component.TelemetrySettings) metric.Meter

func Tracer added in v0.92.0

func Tracer(settings component.TelemetrySettings) trace.Tracer

func WithStartTime

func WithStartTime(startTime pcommon.Timestamp) metricBuilderOption

WithStartTime sets startTime on the metrics builder.

Types

type AttributeDiskDirection

type AttributeDiskDirection int

AttributeDiskDirection specifies the a value disk_direction attribute.

const (
	AttributeDiskDirectionRead AttributeDiskDirection
	AttributeDiskDirectionWrite
)

func (AttributeDiskDirection) String

func (av AttributeDiskDirection) String() string

String returns the string representation of the AttributeDiskDirection.

type AttributeDiskState

type AttributeDiskState int

AttributeDiskState specifies the a value disk_state attribute.

const (
	AttributeDiskStateAvailable AttributeDiskState
	AttributeDiskStateUsed
)

func (AttributeDiskState) String

func (av AttributeDiskState) String() string

String returns the string representation of the AttributeDiskState.

type AttributeDiskType

type AttributeDiskType int

AttributeDiskType specifies the a value disk_type attribute.

const (
	AttributeDiskTypeVirtual AttributeDiskType
	AttributeDiskTypePhysical
)

func (AttributeDiskType) String

func (av AttributeDiskType) String() string

String returns the string representation of the AttributeDiskType.

type AttributeThroughputDirection

type AttributeThroughputDirection int

AttributeThroughputDirection specifies the a value throughput_direction attribute.

const (
	AttributeThroughputDirectionTransmitted AttributeThroughputDirection
	AttributeThroughputDirectionReceived
)

func (AttributeThroughputDirection) String

String returns the string representation of the AttributeThroughputDirection.

type AttributeVMCountPowerState

type AttributeVMCountPowerState int

AttributeVMCountPowerState specifies the a value vm_count_power_state attribute.

const (
	AttributeVMCountPowerStateOn AttributeVMCountPowerState
	AttributeVMCountPowerStateOff
)

func (AttributeVMCountPowerState) String

func (av AttributeVMCountPowerState) String() string

String returns the string representation of the AttributeVMCountPowerState.

type MetricConfig added in v0.77.0

type MetricConfig struct {
	Enabled bool `mapstructure:"enabled"`
	// contains filtered or unexported fields
}

MetricConfig provides common config for a particular metric.

func (*MetricConfig) Unmarshal added in v0.77.0

func (ms *MetricConfig) Unmarshal(parser *confmap.Conf) error

type MetricsBuilder

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

MetricsBuilder provides an interface for scrapers to report metrics while taking care of all the transformations required to produce metric representation defined in metadata and user config.

func NewMetricsBuilder

func NewMetricsBuilder(mbc MetricsBuilderConfig, settings receiver.CreateSettings, options ...metricBuilderOption) *MetricsBuilder

func (*MetricsBuilder) Emit

Emit returns all the metrics accumulated by the metrics builder and updates the internal state to be ready for recording another set of metrics. This function will be responsible for applying all the transformations required to produce metric representation defined in metadata and user config, e.g. delta or cumulative.

func (*MetricsBuilder) EmitForResource

func (mb *MetricsBuilder) EmitForResource(rmo ...ResourceMetricsOption)

EmitForResource saves all the generated metrics under a new resource and updates the internal state to be ready for recording another set of data points as part of another resource. This function can be helpful when one scraper needs to emit metrics from several resources. Otherwise calling this function is not required, just `Emit` function can be called instead. Resource attributes should be provided as ResourceMetricsOption arguments.

func (*MetricsBuilder) NewResourceBuilder added in v0.83.0

func (mb *MetricsBuilder) NewResourceBuilder() *ResourceBuilder

NewResourceBuilder returns a new resource builder that should be used to build a resource associated with for the emitted metrics.

func (*MetricsBuilder) RecordVcenterClusterCPUEffectiveDataPoint

func (mb *MetricsBuilder) RecordVcenterClusterCPUEffectiveDataPoint(ts pcommon.Timestamp, val int64)

RecordVcenterClusterCPUEffectiveDataPoint adds a data point to vcenter.cluster.cpu.effective metric.

func (*MetricsBuilder) RecordVcenterClusterCPULimitDataPoint

func (mb *MetricsBuilder) RecordVcenterClusterCPULimitDataPoint(ts pcommon.Timestamp, val int64)

RecordVcenterClusterCPULimitDataPoint adds a data point to vcenter.cluster.cpu.limit metric.

func (*MetricsBuilder) RecordVcenterClusterHostCountDataPoint

func (mb *MetricsBuilder) RecordVcenterClusterHostCountDataPoint(ts pcommon.Timestamp, val int64, hostEffectiveAttributeValue bool)

RecordVcenterClusterHostCountDataPoint adds a data point to vcenter.cluster.host.count metric.

func (*MetricsBuilder) RecordVcenterClusterMemoryEffectiveDataPoint

func (mb *MetricsBuilder) RecordVcenterClusterMemoryEffectiveDataPoint(ts pcommon.Timestamp, val int64)

RecordVcenterClusterMemoryEffectiveDataPoint adds a data point to vcenter.cluster.memory.effective metric.

func (*MetricsBuilder) RecordVcenterClusterMemoryLimitDataPoint

func (mb *MetricsBuilder) RecordVcenterClusterMemoryLimitDataPoint(ts pcommon.Timestamp, val int64)

RecordVcenterClusterMemoryLimitDataPoint adds a data point to vcenter.cluster.memory.limit metric.

func (*MetricsBuilder) RecordVcenterClusterMemoryUsedDataPoint

func (mb *MetricsBuilder) RecordVcenterClusterMemoryUsedDataPoint(ts pcommon.Timestamp, val int64)

RecordVcenterClusterMemoryUsedDataPoint adds a data point to vcenter.cluster.memory.used metric.

func (*MetricsBuilder) RecordVcenterClusterVMCountDataPoint

func (mb *MetricsBuilder) RecordVcenterClusterVMCountDataPoint(ts pcommon.Timestamp, val int64, vmCountPowerStateAttributeValue AttributeVMCountPowerState)

RecordVcenterClusterVMCountDataPoint adds a data point to vcenter.cluster.vm.count metric.

func (*MetricsBuilder) RecordVcenterDatastoreDiskUsageDataPoint

func (mb *MetricsBuilder) RecordVcenterDatastoreDiskUsageDataPoint(ts pcommon.Timestamp, val int64, diskStateAttributeValue AttributeDiskState)

RecordVcenterDatastoreDiskUsageDataPoint adds a data point to vcenter.datastore.disk.usage metric.

func (*MetricsBuilder) RecordVcenterDatastoreDiskUtilizationDataPoint

func (mb *MetricsBuilder) RecordVcenterDatastoreDiskUtilizationDataPoint(ts pcommon.Timestamp, val float64)

RecordVcenterDatastoreDiskUtilizationDataPoint adds a data point to vcenter.datastore.disk.utilization metric.

func (*MetricsBuilder) RecordVcenterHostCPUUsageDataPoint

func (mb *MetricsBuilder) RecordVcenterHostCPUUsageDataPoint(ts pcommon.Timestamp, val int64)

RecordVcenterHostCPUUsageDataPoint adds a data point to vcenter.host.cpu.usage metric.

func (*MetricsBuilder) RecordVcenterHostCPUUtilizationDataPoint

func (mb *MetricsBuilder) RecordVcenterHostCPUUtilizationDataPoint(ts pcommon.Timestamp, val float64)

RecordVcenterHostCPUUtilizationDataPoint adds a data point to vcenter.host.cpu.utilization metric.

func (*MetricsBuilder) RecordVcenterHostDiskLatencyAvgDataPoint

func (mb *MetricsBuilder) RecordVcenterHostDiskLatencyAvgDataPoint(ts pcommon.Timestamp, val int64, diskDirectionAttributeValue AttributeDiskDirection, objectNameAttributeValue string)

RecordVcenterHostDiskLatencyAvgDataPoint adds a data point to vcenter.host.disk.latency.avg metric.

func (*MetricsBuilder) RecordVcenterHostDiskLatencyAvgDataPointWithoutObject added in v0.84.0

func (mb *MetricsBuilder) RecordVcenterHostDiskLatencyAvgDataPointWithoutObject(ts pcommon.Timestamp, val int64, diskDirection AttributeDiskDirection)

RecordVcenterHostDiskLatencyAvgDataPointWithoutObject adds a data point to vcenter.host.disk.latency.avg metric without an object metric attribute

func (*MetricsBuilder) RecordVcenterHostDiskLatencyMaxDataPoint

func (mb *MetricsBuilder) RecordVcenterHostDiskLatencyMaxDataPoint(ts pcommon.Timestamp, val int64, objectNameAttributeValue string)

RecordVcenterHostDiskLatencyMaxDataPoint adds a data point to vcenter.host.disk.latency.max metric.

func (*MetricsBuilder) RecordVcenterHostDiskLatencyMaxDataPointWithoutObject added in v0.84.0

func (mb *MetricsBuilder) RecordVcenterHostDiskLatencyMaxDataPointWithoutObject(ts pcommon.Timestamp, val int64)

RecordVcenterHostDiskLatencyMaxDataPointWithoutObject adds a data point to vcenter.host.disk.latency.max metric without an object metric attribute

func (*MetricsBuilder) RecordVcenterHostDiskThroughputDataPoint

func (mb *MetricsBuilder) RecordVcenterHostDiskThroughputDataPoint(ts pcommon.Timestamp, val int64, diskDirectionAttributeValue AttributeDiskDirection, objectNameAttributeValue string)

RecordVcenterHostDiskThroughputDataPoint adds a data point to vcenter.host.disk.throughput metric.

func (*MetricsBuilder) RecordVcenterHostDiskThroughputDataPointWithoutObject added in v0.84.0

func (mb *MetricsBuilder) RecordVcenterHostDiskThroughputDataPointWithoutObject(ts pcommon.Timestamp, val int64, diskDirection AttributeDiskDirection)

RecordVcenterHostDiskThroughputDataPointWithoutObject adds a data point to vcenter.host.disk.throughput metric without an object metric attribute

func (*MetricsBuilder) RecordVcenterHostMemoryUsageDataPoint

func (mb *MetricsBuilder) RecordVcenterHostMemoryUsageDataPoint(ts pcommon.Timestamp, val int64)

RecordVcenterHostMemoryUsageDataPoint adds a data point to vcenter.host.memory.usage metric.

func (*MetricsBuilder) RecordVcenterHostMemoryUtilizationDataPoint

func (mb *MetricsBuilder) RecordVcenterHostMemoryUtilizationDataPoint(ts pcommon.Timestamp, val float64)

RecordVcenterHostMemoryUtilizationDataPoint adds a data point to vcenter.host.memory.utilization metric.

func (*MetricsBuilder) RecordVcenterHostNetworkPacketCountDataPoint

func (mb *MetricsBuilder) RecordVcenterHostNetworkPacketCountDataPoint(ts pcommon.Timestamp, val int64, throughputDirectionAttributeValue AttributeThroughputDirection, objectNameAttributeValue string)

RecordVcenterHostNetworkPacketCountDataPoint adds a data point to vcenter.host.network.packet.count metric.

func (*MetricsBuilder) RecordVcenterHostNetworkPacketCountDataPointWithoutObject added in v0.84.0

func (mb *MetricsBuilder) RecordVcenterHostNetworkPacketCountDataPointWithoutObject(ts pcommon.Timestamp, val int64, attr AttributeThroughputDirection)

RecordVcenterHostNetworkPacketCountDataPointWithoutObject adds a data point to vcenter.host.network.packet.count metric without an object metric attribute

func (*MetricsBuilder) RecordVcenterHostNetworkPacketErrorsDataPoint

func (mb *MetricsBuilder) RecordVcenterHostNetworkPacketErrorsDataPoint(ts pcommon.Timestamp, val int64, throughputDirectionAttributeValue AttributeThroughputDirection, objectNameAttributeValue string)

RecordVcenterHostNetworkPacketErrorsDataPoint adds a data point to vcenter.host.network.packet.errors metric.

func (*MetricsBuilder) RecordVcenterHostNetworkPacketErrorsDataPointWithoutObject added in v0.84.0

func (mb *MetricsBuilder) RecordVcenterHostNetworkPacketErrorsDataPointWithoutObject(ts pcommon.Timestamp, val int64, throughputDirection AttributeThroughputDirection)

RecordVcenterHostNetworkPacketErrorsDataPointWithoutObject adds a data point to vcenter.host.network.packet.errors metric without an object metric attribute

func (*MetricsBuilder) RecordVcenterHostNetworkThroughputDataPoint

func (mb *MetricsBuilder) RecordVcenterHostNetworkThroughputDataPoint(ts pcommon.Timestamp, val int64, throughputDirectionAttributeValue AttributeThroughputDirection, objectNameAttributeValue string)

RecordVcenterHostNetworkThroughputDataPoint adds a data point to vcenter.host.network.throughput metric.

func (*MetricsBuilder) RecordVcenterHostNetworkThroughputDataPointWithoutObject added in v0.84.0

func (mb *MetricsBuilder) RecordVcenterHostNetworkThroughputDataPointWithoutObject(ts pcommon.Timestamp, val int64, attr AttributeThroughputDirection)

RecordVcenterHostNetworkThroughputDataPointWithoutObject adds a data point to vcenter.host.network.throughput metric without an object metric attribute

func (*MetricsBuilder) RecordVcenterHostNetworkUsageDataPoint

func (mb *MetricsBuilder) RecordVcenterHostNetworkUsageDataPoint(ts pcommon.Timestamp, val int64, objectNameAttributeValue string)

RecordVcenterHostNetworkUsageDataPoint adds a data point to vcenter.host.network.usage metric.

func (*MetricsBuilder) RecordVcenterHostNetworkUsageDataPointWithoutObject added in v0.84.0

func (mb *MetricsBuilder) RecordVcenterHostNetworkUsageDataPointWithoutObject(ts pcommon.Timestamp, val int64)

RecordVcenterHostNetworkUsageDataPointWithoutObject adds a data point to vcenter.host.network.usage metric without an object metric attribute

func (*MetricsBuilder) RecordVcenterResourcePoolCPUSharesDataPoint

func (mb *MetricsBuilder) RecordVcenterResourcePoolCPUSharesDataPoint(ts pcommon.Timestamp, val int64)

RecordVcenterResourcePoolCPUSharesDataPoint adds a data point to vcenter.resource_pool.cpu.shares metric.

func (*MetricsBuilder) RecordVcenterResourcePoolCPUUsageDataPoint

func (mb *MetricsBuilder) RecordVcenterResourcePoolCPUUsageDataPoint(ts pcommon.Timestamp, val int64)

RecordVcenterResourcePoolCPUUsageDataPoint adds a data point to vcenter.resource_pool.cpu.usage metric.

func (*MetricsBuilder) RecordVcenterResourcePoolMemorySharesDataPoint

func (mb *MetricsBuilder) RecordVcenterResourcePoolMemorySharesDataPoint(ts pcommon.Timestamp, val int64)

RecordVcenterResourcePoolMemorySharesDataPoint adds a data point to vcenter.resource_pool.memory.shares metric.

func (*MetricsBuilder) RecordVcenterResourcePoolMemoryUsageDataPoint

func (mb *MetricsBuilder) RecordVcenterResourcePoolMemoryUsageDataPoint(ts pcommon.Timestamp, val int64)

RecordVcenterResourcePoolMemoryUsageDataPoint adds a data point to vcenter.resource_pool.memory.usage metric.

func (*MetricsBuilder) RecordVcenterVMCPUUsageDataPoint added in v0.76.1

func (mb *MetricsBuilder) RecordVcenterVMCPUUsageDataPoint(ts pcommon.Timestamp, val int64)

RecordVcenterVMCPUUsageDataPoint adds a data point to vcenter.vm.cpu.usage metric.

func (*MetricsBuilder) RecordVcenterVMCPUUtilizationDataPoint

func (mb *MetricsBuilder) RecordVcenterVMCPUUtilizationDataPoint(ts pcommon.Timestamp, val float64)

RecordVcenterVMCPUUtilizationDataPoint adds a data point to vcenter.vm.cpu.utilization metric.

func (*MetricsBuilder) RecordVcenterVMDiskLatencyAvgDataPoint

func (mb *MetricsBuilder) RecordVcenterVMDiskLatencyAvgDataPoint(ts pcommon.Timestamp, val int64, diskDirectionAttributeValue AttributeDiskDirection, diskTypeAttributeValue AttributeDiskType, objectNameAttributeValue string)

RecordVcenterVMDiskLatencyAvgDataPoint adds a data point to vcenter.vm.disk.latency.avg metric.

func (*MetricsBuilder) RecordVcenterVMDiskLatencyAvgDataPointWithoutObject added in v0.84.0

func (mb *MetricsBuilder) RecordVcenterVMDiskLatencyAvgDataPointWithoutObject(ts pcommon.Timestamp, val int64, diskDirection AttributeDiskDirection, diskType AttributeDiskType)

RecordVcenterVMDiskLatencyAvgDataPointWithoutObject adds a data point to vcenter.vm.disk.latency.avg metric without an object metric attribute

func (*MetricsBuilder) RecordVcenterVMDiskLatencyMaxDataPoint

func (mb *MetricsBuilder) RecordVcenterVMDiskLatencyMaxDataPoint(ts pcommon.Timestamp, val int64, objectNameAttributeValue string)

RecordVcenterVMDiskLatencyMaxDataPoint adds a data point to vcenter.vm.disk.latency.max metric.

func (*MetricsBuilder) RecordVcenterVMDiskLatencyMaxDataPointWithoutObject added in v0.84.0

func (mb *MetricsBuilder) RecordVcenterVMDiskLatencyMaxDataPointWithoutObject(ts pcommon.Timestamp, val int64)

RecordVcenterVMDiskLatencyMaxDataPointWithoutObject adds a data point to vcenter.vm.disk.latency.max metric without an object metric attribute

func (*MetricsBuilder) RecordVcenterVMDiskThroughputDataPoint

func (mb *MetricsBuilder) RecordVcenterVMDiskThroughputDataPoint(ts pcommon.Timestamp, val int64, objectNameAttributeValue string)

RecordVcenterVMDiskThroughputDataPoint adds a data point to vcenter.vm.disk.throughput metric.

func (*MetricsBuilder) RecordVcenterVMDiskUsageDataPoint

func (mb *MetricsBuilder) RecordVcenterVMDiskUsageDataPoint(ts pcommon.Timestamp, val int64, diskStateAttributeValue AttributeDiskState)

RecordVcenterVMDiskUsageDataPoint adds a data point to vcenter.vm.disk.usage metric.

func (*MetricsBuilder) RecordVcenterVMDiskUtilizationDataPoint

func (mb *MetricsBuilder) RecordVcenterVMDiskUtilizationDataPoint(ts pcommon.Timestamp, val float64)

RecordVcenterVMDiskUtilizationDataPoint adds a data point to vcenter.vm.disk.utilization metric.

func (*MetricsBuilder) RecordVcenterVMMemoryBalloonedDataPoint

func (mb *MetricsBuilder) RecordVcenterVMMemoryBalloonedDataPoint(ts pcommon.Timestamp, val int64)

RecordVcenterVMMemoryBalloonedDataPoint adds a data point to vcenter.vm.memory.ballooned metric.

func (*MetricsBuilder) RecordVcenterVMMemorySwappedDataPoint added in v0.67.0

func (mb *MetricsBuilder) RecordVcenterVMMemorySwappedDataPoint(ts pcommon.Timestamp, val int64)

RecordVcenterVMMemorySwappedDataPoint adds a data point to vcenter.vm.memory.swapped metric.

func (*MetricsBuilder) RecordVcenterVMMemorySwappedSsdDataPoint added in v0.67.0

func (mb *MetricsBuilder) RecordVcenterVMMemorySwappedSsdDataPoint(ts pcommon.Timestamp, val int64)

RecordVcenterVMMemorySwappedSsdDataPoint adds a data point to vcenter.vm.memory.swapped_ssd metric.

func (*MetricsBuilder) RecordVcenterVMMemoryUsageDataPoint

func (mb *MetricsBuilder) RecordVcenterVMMemoryUsageDataPoint(ts pcommon.Timestamp, val int64)

RecordVcenterVMMemoryUsageDataPoint adds a data point to vcenter.vm.memory.usage metric.

func (*MetricsBuilder) RecordVcenterVMMemoryUtilizationDataPoint added in v0.79.0

func (mb *MetricsBuilder) RecordVcenterVMMemoryUtilizationDataPoint(ts pcommon.Timestamp, val float64)

RecordVcenterVMMemoryUtilizationDataPoint adds a data point to vcenter.vm.memory.utilization metric.

func (*MetricsBuilder) RecordVcenterVMNetworkPacketCountDataPoint

func (mb *MetricsBuilder) RecordVcenterVMNetworkPacketCountDataPoint(ts pcommon.Timestamp, val int64, throughputDirectionAttributeValue AttributeThroughputDirection, objectNameAttributeValue string)

RecordVcenterVMNetworkPacketCountDataPoint adds a data point to vcenter.vm.network.packet.count metric.

func (*MetricsBuilder) RecordVcenterVMNetworkPacketCountDataPointWithoutObject added in v0.84.0

func (mb *MetricsBuilder) RecordVcenterVMNetworkPacketCountDataPointWithoutObject(ts pcommon.Timestamp, val int64, attr AttributeThroughputDirection)

RecordVcenterVMNetworkPacketCountDataPointWithoutObject adds a data point to vcenter.vm.network.packet.count metric without an object metric attribute

func (*MetricsBuilder) RecordVcenterVMNetworkThroughputDataPoint

func (mb *MetricsBuilder) RecordVcenterVMNetworkThroughputDataPoint(ts pcommon.Timestamp, val int64, throughputDirectionAttributeValue AttributeThroughputDirection, objectNameAttributeValue string)

RecordVcenterVMNetworkThroughputDataPoint adds a data point to vcenter.vm.network.throughput metric.

func (*MetricsBuilder) RecordVcenterVMNetworkThroughputDataPointWithoutObject added in v0.84.0

func (mb *MetricsBuilder) RecordVcenterVMNetworkThroughputDataPointWithoutObject(ts pcommon.Timestamp, val int64, attr AttributeThroughputDirection)

RecordVcenterVMNetworkThroughputDataPointWithoutObject adds a data point to vcenter.vm.network.throughput metric without an object metric attribute

func (*MetricsBuilder) RecordVcenterVMNetworkUsageDataPoint

func (mb *MetricsBuilder) RecordVcenterVMNetworkUsageDataPoint(ts pcommon.Timestamp, val int64, objectNameAttributeValue string)

RecordVcenterVMNetworkUsageDataPoint adds a data point to vcenter.vm.network.usage metric.

func (*MetricsBuilder) RecordVcenterVMNetworkUsageDataPointWithoutObject added in v0.84.0

func (mb *MetricsBuilder) RecordVcenterVMNetworkUsageDataPointWithoutObject(ts pcommon.Timestamp, val int64)

RecordVcenterVMNetworkUsageDataPointWithoutObject adds a data point to vcenter.vm.network.usage metric without an object metric attribute

func (*MetricsBuilder) Reset

func (mb *MetricsBuilder) Reset(options ...metricBuilderOption)

Reset resets metrics builder to its initial state. It should be used when external metrics source is restarted, and metrics builder should update its startTime and reset it's internal state accordingly.

type MetricsBuilderConfig added in v0.73.0

type MetricsBuilderConfig struct {
	Metrics            MetricsConfig            `mapstructure:"metrics"`
	ResourceAttributes ResourceAttributesConfig `mapstructure:"resource_attributes"`
}

MetricsBuilderConfig is a configuration for vcenter metrics builder.

func DefaultMetricsBuilderConfig added in v0.73.0

func DefaultMetricsBuilderConfig() MetricsBuilderConfig

type MetricsConfig added in v0.77.0

type MetricsConfig struct {
	VcenterClusterCPUEffective      MetricConfig `mapstructure:"vcenter.cluster.cpu.effective"`
	VcenterClusterCPULimit          MetricConfig `mapstructure:"vcenter.cluster.cpu.limit"`
	VcenterClusterHostCount         MetricConfig `mapstructure:"vcenter.cluster.host.count"`
	VcenterClusterMemoryEffective   MetricConfig `mapstructure:"vcenter.cluster.memory.effective"`
	VcenterClusterMemoryLimit       MetricConfig `mapstructure:"vcenter.cluster.memory.limit"`
	VcenterClusterMemoryUsed        MetricConfig `mapstructure:"vcenter.cluster.memory.used"`
	VcenterClusterVMCount           MetricConfig `mapstructure:"vcenter.cluster.vm.count"`
	VcenterDatastoreDiskUsage       MetricConfig `mapstructure:"vcenter.datastore.disk.usage"`
	VcenterDatastoreDiskUtilization MetricConfig `mapstructure:"vcenter.datastore.disk.utilization"`
	VcenterHostCPUUsage             MetricConfig `mapstructure:"vcenter.host.cpu.usage"`
	VcenterHostCPUUtilization       MetricConfig `mapstructure:"vcenter.host.cpu.utilization"`
	VcenterHostDiskLatencyAvg       MetricConfig `mapstructure:"vcenter.host.disk.latency.avg"`
	VcenterHostDiskLatencyMax       MetricConfig `mapstructure:"vcenter.host.disk.latency.max"`
	VcenterHostDiskThroughput       MetricConfig `mapstructure:"vcenter.host.disk.throughput"`
	VcenterHostMemoryUsage          MetricConfig `mapstructure:"vcenter.host.memory.usage"`
	VcenterHostMemoryUtilization    MetricConfig `mapstructure:"vcenter.host.memory.utilization"`
	VcenterHostNetworkPacketCount   MetricConfig `mapstructure:"vcenter.host.network.packet.count"`
	VcenterHostNetworkPacketErrors  MetricConfig `mapstructure:"vcenter.host.network.packet.errors"`
	VcenterHostNetworkThroughput    MetricConfig `mapstructure:"vcenter.host.network.throughput"`
	VcenterHostNetworkUsage         MetricConfig `mapstructure:"vcenter.host.network.usage"`
	VcenterResourcePoolCPUShares    MetricConfig `mapstructure:"vcenter.resource_pool.cpu.shares"`
	VcenterResourcePoolCPUUsage     MetricConfig `mapstructure:"vcenter.resource_pool.cpu.usage"`
	VcenterResourcePoolMemoryShares MetricConfig `mapstructure:"vcenter.resource_pool.memory.shares"`
	VcenterResourcePoolMemoryUsage  MetricConfig `mapstructure:"vcenter.resource_pool.memory.usage"`
	VcenterVMCPUUsage               MetricConfig `mapstructure:"vcenter.vm.cpu.usage"`
	VcenterVMCPUUtilization         MetricConfig `mapstructure:"vcenter.vm.cpu.utilization"`
	VcenterVMDiskLatencyAvg         MetricConfig `mapstructure:"vcenter.vm.disk.latency.avg"`
	VcenterVMDiskLatencyMax         MetricConfig `mapstructure:"vcenter.vm.disk.latency.max"`
	VcenterVMDiskThroughput         MetricConfig `mapstructure:"vcenter.vm.disk.throughput"`
	VcenterVMDiskUsage              MetricConfig `mapstructure:"vcenter.vm.disk.usage"`
	VcenterVMDiskUtilization        MetricConfig `mapstructure:"vcenter.vm.disk.utilization"`
	VcenterVMMemoryBallooned        MetricConfig `mapstructure:"vcenter.vm.memory.ballooned"`
	VcenterVMMemorySwapped          MetricConfig `mapstructure:"vcenter.vm.memory.swapped"`
	VcenterVMMemorySwappedSsd       MetricConfig `mapstructure:"vcenter.vm.memory.swapped_ssd"`
	VcenterVMMemoryUsage            MetricConfig `mapstructure:"vcenter.vm.memory.usage"`
	VcenterVMMemoryUtilization      MetricConfig `mapstructure:"vcenter.vm.memory.utilization"`
	VcenterVMNetworkPacketCount     MetricConfig `mapstructure:"vcenter.vm.network.packet.count"`
	VcenterVMNetworkThroughput      MetricConfig `mapstructure:"vcenter.vm.network.throughput"`
	VcenterVMNetworkUsage           MetricConfig `mapstructure:"vcenter.vm.network.usage"`
}

MetricsConfig provides config for vcenter metrics.

func DefaultMetricsConfig added in v0.77.0

func DefaultMetricsConfig() MetricsConfig

type ResourceAttributeConfig added in v0.77.0

type ResourceAttributeConfig struct {
	Enabled bool `mapstructure:"enabled"`
	// Experimental: MetricsInclude defines a list of filters for attribute values.
	// If the list is not empty, only metrics with matching resource attribute values will be emitted.
	MetricsInclude []filter.Config `mapstructure:"metrics_include"`
	// Experimental: MetricsExclude defines a list of filters for attribute values.
	// If the list is not empty, metrics with matching resource attribute values will not be emitted.
	// MetricsInclude has higher priority than MetricsExclude.
	MetricsExclude []filter.Config `mapstructure:"metrics_exclude"`
	// contains filtered or unexported fields
}

ResourceAttributeConfig provides common config for a particular resource attribute.

func (*ResourceAttributeConfig) Unmarshal added in v0.87.0

func (rac *ResourceAttributeConfig) Unmarshal(parser *confmap.Conf) error

type ResourceAttributesConfig added in v0.77.0

type ResourceAttributesConfig struct {
	VcenterClusterName               ResourceAttributeConfig `mapstructure:"vcenter.cluster.name"`
	VcenterDatastoreName             ResourceAttributeConfig `mapstructure:"vcenter.datastore.name"`
	VcenterHostName                  ResourceAttributeConfig `mapstructure:"vcenter.host.name"`
	VcenterResourcePoolInventoryPath ResourceAttributeConfig `mapstructure:"vcenter.resource_pool.inventory_path"`
	VcenterResourcePoolName          ResourceAttributeConfig `mapstructure:"vcenter.resource_pool.name"`
	VcenterVMID                      ResourceAttributeConfig `mapstructure:"vcenter.vm.id"`
	VcenterVMName                    ResourceAttributeConfig `mapstructure:"vcenter.vm.name"`
}

ResourceAttributesConfig provides config for vcenter resource attributes.

func DefaultResourceAttributesConfig added in v0.77.0

func DefaultResourceAttributesConfig() ResourceAttributesConfig

type ResourceBuilder added in v0.82.0

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

ResourceBuilder is a helper struct to build resources predefined in metadata.yaml. The ResourceBuilder is not thread-safe and must not to be used in multiple goroutines.

func NewResourceBuilder added in v0.82.0

func NewResourceBuilder(rac ResourceAttributesConfig) *ResourceBuilder

NewResourceBuilder creates a new ResourceBuilder. This method should be called on the start of the application.

func (*ResourceBuilder) Emit added in v0.82.0

func (rb *ResourceBuilder) Emit() pcommon.Resource

Emit returns the built resource and resets the internal builder state.

func (*ResourceBuilder) SetVcenterClusterName added in v0.82.0

func (rb *ResourceBuilder) SetVcenterClusterName(val string)

SetVcenterClusterName sets provided value as "vcenter.cluster.name" attribute.

func (*ResourceBuilder) SetVcenterDatastoreName added in v0.82.0

func (rb *ResourceBuilder) SetVcenterDatastoreName(val string)

SetVcenterDatastoreName sets provided value as "vcenter.datastore.name" attribute.

func (*ResourceBuilder) SetVcenterHostName added in v0.82.0

func (rb *ResourceBuilder) SetVcenterHostName(val string)

SetVcenterHostName sets provided value as "vcenter.host.name" attribute.

func (*ResourceBuilder) SetVcenterResourcePoolInventoryPath added in v0.84.0

func (rb *ResourceBuilder) SetVcenterResourcePoolInventoryPath(val string)

SetVcenterResourcePoolInventoryPath sets provided value as "vcenter.resource_pool.inventory_path" attribute.

func (*ResourceBuilder) SetVcenterResourcePoolName added in v0.82.0

func (rb *ResourceBuilder) SetVcenterResourcePoolName(val string)

SetVcenterResourcePoolName sets provided value as "vcenter.resource_pool.name" attribute.

func (*ResourceBuilder) SetVcenterVMID added in v0.82.0

func (rb *ResourceBuilder) SetVcenterVMID(val string)

SetVcenterVMID sets provided value as "vcenter.vm.id" attribute.

func (*ResourceBuilder) SetVcenterVMName added in v0.82.0

func (rb *ResourceBuilder) SetVcenterVMName(val string)

SetVcenterVMName sets provided value as "vcenter.vm.name" attribute.

type ResourceMetricsOption

type ResourceMetricsOption func(pmetric.ResourceMetrics)

ResourceMetricsOption applies changes to provided resource metrics.

func WithResource added in v0.82.0

func WithResource(res pcommon.Resource) ResourceMetricsOption

WithResource sets the provided resource on the emitted ResourceMetrics. It's recommended to use ResourceBuilder to create the resource.

func WithStartTimeOverride

func WithStartTimeOverride(start pcommon.Timestamp) ResourceMetricsOption

WithStartTimeOverride overrides start time for all the resource metrics data points. This option should be only used if different start time has to be set on metrics coming from different resources.

Jump to

Keyboard shortcuts

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