metadata

package
v0.77.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Type             = "bigipreceiver"
	MetricsStability = component.StabilityLevelBeta
)

Variables

View Source
var MapAttributeActiveStatus = map[string]AttributeActiveStatus{
	"active":   AttributeActiveStatusActive,
	"inactive": AttributeActiveStatusInactive,
}

MapAttributeActiveStatus is a helper map of string to AttributeActiveStatus attribute value.

MapAttributeAvailabilityStatus is a helper map of string to AttributeAvailabilityStatus attribute value.

View Source
var MapAttributeDirection = map[string]AttributeDirection{
	"sent":     AttributeDirectionSent,
	"received": AttributeDirectionReceived,
}

MapAttributeDirection is a helper map of string to AttributeDirection attribute value.

View Source
var MapAttributeEnabledStatus = map[string]AttributeEnabledStatus{
	"disabled": AttributeEnabledStatusDisabled,
	"enabled":  AttributeEnabledStatusEnabled,
}

MapAttributeEnabledStatus is a helper map of string to AttributeEnabledStatus attribute value.

Functions

func WithStartTime

func WithStartTime(startTime pcommon.Timestamp) metricBuilderOption

WithStartTime sets startTime on the metrics builder.

Types

type AttributeActiveStatus

type AttributeActiveStatus int

AttributeActiveStatus specifies the a value active.status attribute.

const (
	AttributeActiveStatusActive AttributeActiveStatus
	AttributeActiveStatusInactive
)

func (AttributeActiveStatus) String

func (av AttributeActiveStatus) String() string

String returns the string representation of the AttributeActiveStatus.

type AttributeAvailabilityStatus

type AttributeAvailabilityStatus int

AttributeAvailabilityStatus specifies the a value availability.status attribute.

const (
	AttributeAvailabilityStatusOffline AttributeAvailabilityStatus
	AttributeAvailabilityStatusUnknown
	AttributeAvailabilityStatusAvailable
)

func (AttributeAvailabilityStatus) String

func (av AttributeAvailabilityStatus) String() string

String returns the string representation of the AttributeAvailabilityStatus.

type AttributeDirection

type AttributeDirection int

AttributeDirection specifies the a value direction attribute.

const (
	AttributeDirectionSent AttributeDirection
	AttributeDirectionReceived
)

func (AttributeDirection) String

func (av AttributeDirection) String() string

String returns the string representation of the AttributeDirection.

type AttributeEnabledStatus

type AttributeEnabledStatus int

AttributeEnabledStatus specifies the a value enabled.status attribute.

const (
	AttributeEnabledStatusDisabled AttributeEnabledStatus
	AttributeEnabledStatusEnabled
)

func (AttributeEnabledStatus) String

func (av AttributeEnabledStatus) String() string

String returns the string representation of the AttributeEnabledStatus.

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

func (mb *MetricsBuilder) RecordBigipNodeAvailabilityDataPoint(ts pcommon.Timestamp, val int64, availabilityStatusAttributeValue AttributeAvailabilityStatus)

RecordBigipNodeAvailabilityDataPoint adds a data point to bigip.node.availability metric.

func (*MetricsBuilder) RecordBigipNodeConnectionCountDataPoint

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

RecordBigipNodeConnectionCountDataPoint adds a data point to bigip.node.connection.count metric.

func (*MetricsBuilder) RecordBigipNodeDataTransmittedDataPoint

func (mb *MetricsBuilder) RecordBigipNodeDataTransmittedDataPoint(ts pcommon.Timestamp, val int64, directionAttributeValue AttributeDirection)

RecordBigipNodeDataTransmittedDataPoint adds a data point to bigip.node.data.transmitted metric.

func (*MetricsBuilder) RecordBigipNodeEnabledDataPoint

func (mb *MetricsBuilder) RecordBigipNodeEnabledDataPoint(ts pcommon.Timestamp, val int64, enabledStatusAttributeValue AttributeEnabledStatus)

RecordBigipNodeEnabledDataPoint adds a data point to bigip.node.enabled metric.

func (*MetricsBuilder) RecordBigipNodePacketCountDataPoint

func (mb *MetricsBuilder) RecordBigipNodePacketCountDataPoint(ts pcommon.Timestamp, val int64, directionAttributeValue AttributeDirection)

RecordBigipNodePacketCountDataPoint adds a data point to bigip.node.packet.count metric.

func (*MetricsBuilder) RecordBigipNodeRequestCountDataPoint

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

RecordBigipNodeRequestCountDataPoint adds a data point to bigip.node.request.count metric.

func (*MetricsBuilder) RecordBigipNodeSessionCountDataPoint

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

RecordBigipNodeSessionCountDataPoint adds a data point to bigip.node.session.count metric.

func (*MetricsBuilder) RecordBigipPoolAvailabilityDataPoint

func (mb *MetricsBuilder) RecordBigipPoolAvailabilityDataPoint(ts pcommon.Timestamp, val int64, availabilityStatusAttributeValue AttributeAvailabilityStatus)

RecordBigipPoolAvailabilityDataPoint adds a data point to bigip.pool.availability metric.

func (*MetricsBuilder) RecordBigipPoolConnectionCountDataPoint

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

RecordBigipPoolConnectionCountDataPoint adds a data point to bigip.pool.connection.count metric.

func (*MetricsBuilder) RecordBigipPoolDataTransmittedDataPoint

func (mb *MetricsBuilder) RecordBigipPoolDataTransmittedDataPoint(ts pcommon.Timestamp, val int64, directionAttributeValue AttributeDirection)

RecordBigipPoolDataTransmittedDataPoint adds a data point to bigip.pool.data.transmitted metric.

func (*MetricsBuilder) RecordBigipPoolEnabledDataPoint

func (mb *MetricsBuilder) RecordBigipPoolEnabledDataPoint(ts pcommon.Timestamp, val int64, enabledStatusAttributeValue AttributeEnabledStatus)

RecordBigipPoolEnabledDataPoint adds a data point to bigip.pool.enabled metric.

func (*MetricsBuilder) RecordBigipPoolMemberAvailabilityDataPoint

func (mb *MetricsBuilder) RecordBigipPoolMemberAvailabilityDataPoint(ts pcommon.Timestamp, val int64, availabilityStatusAttributeValue AttributeAvailabilityStatus)

RecordBigipPoolMemberAvailabilityDataPoint adds a data point to bigip.pool_member.availability metric.

func (*MetricsBuilder) RecordBigipPoolMemberConnectionCountDataPoint

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

RecordBigipPoolMemberConnectionCountDataPoint adds a data point to bigip.pool_member.connection.count metric.

func (*MetricsBuilder) RecordBigipPoolMemberCountDataPoint

func (mb *MetricsBuilder) RecordBigipPoolMemberCountDataPoint(ts pcommon.Timestamp, val int64, activeStatusAttributeValue AttributeActiveStatus)

RecordBigipPoolMemberCountDataPoint adds a data point to bigip.pool.member.count metric.

func (*MetricsBuilder) RecordBigipPoolMemberDataTransmittedDataPoint

func (mb *MetricsBuilder) RecordBigipPoolMemberDataTransmittedDataPoint(ts pcommon.Timestamp, val int64, directionAttributeValue AttributeDirection)

RecordBigipPoolMemberDataTransmittedDataPoint adds a data point to bigip.pool_member.data.transmitted metric.

func (*MetricsBuilder) RecordBigipPoolMemberEnabledDataPoint

func (mb *MetricsBuilder) RecordBigipPoolMemberEnabledDataPoint(ts pcommon.Timestamp, val int64, enabledStatusAttributeValue AttributeEnabledStatus)

RecordBigipPoolMemberEnabledDataPoint adds a data point to bigip.pool_member.enabled metric.

func (*MetricsBuilder) RecordBigipPoolMemberPacketCountDataPoint

func (mb *MetricsBuilder) RecordBigipPoolMemberPacketCountDataPoint(ts pcommon.Timestamp, val int64, directionAttributeValue AttributeDirection)

RecordBigipPoolMemberPacketCountDataPoint adds a data point to bigip.pool_member.packet.count metric.

func (*MetricsBuilder) RecordBigipPoolMemberRequestCountDataPoint

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

RecordBigipPoolMemberRequestCountDataPoint adds a data point to bigip.pool_member.request.count metric.

func (*MetricsBuilder) RecordBigipPoolMemberSessionCountDataPoint

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

RecordBigipPoolMemberSessionCountDataPoint adds a data point to bigip.pool_member.session.count metric.

func (*MetricsBuilder) RecordBigipPoolPacketCountDataPoint

func (mb *MetricsBuilder) RecordBigipPoolPacketCountDataPoint(ts pcommon.Timestamp, val int64, directionAttributeValue AttributeDirection)

RecordBigipPoolPacketCountDataPoint adds a data point to bigip.pool.packet.count metric.

func (*MetricsBuilder) RecordBigipPoolRequestCountDataPoint

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

RecordBigipPoolRequestCountDataPoint adds a data point to bigip.pool.request.count metric.

func (*MetricsBuilder) RecordBigipVirtualServerAvailabilityDataPoint

func (mb *MetricsBuilder) RecordBigipVirtualServerAvailabilityDataPoint(ts pcommon.Timestamp, val int64, availabilityStatusAttributeValue AttributeAvailabilityStatus)

RecordBigipVirtualServerAvailabilityDataPoint adds a data point to bigip.virtual_server.availability metric.

func (*MetricsBuilder) RecordBigipVirtualServerConnectionCountDataPoint

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

RecordBigipVirtualServerConnectionCountDataPoint adds a data point to bigip.virtual_server.connection.count metric.

func (*MetricsBuilder) RecordBigipVirtualServerDataTransmittedDataPoint

func (mb *MetricsBuilder) RecordBigipVirtualServerDataTransmittedDataPoint(ts pcommon.Timestamp, val int64, directionAttributeValue AttributeDirection)

RecordBigipVirtualServerDataTransmittedDataPoint adds a data point to bigip.virtual_server.data.transmitted metric.

func (*MetricsBuilder) RecordBigipVirtualServerEnabledDataPoint

func (mb *MetricsBuilder) RecordBigipVirtualServerEnabledDataPoint(ts pcommon.Timestamp, val int64, enabledStatusAttributeValue AttributeEnabledStatus)

RecordBigipVirtualServerEnabledDataPoint adds a data point to bigip.virtual_server.enabled metric.

func (*MetricsBuilder) RecordBigipVirtualServerPacketCountDataPoint

func (mb *MetricsBuilder) RecordBigipVirtualServerPacketCountDataPoint(ts pcommon.Timestamp, val int64, directionAttributeValue AttributeDirection)

RecordBigipVirtualServerPacketCountDataPoint adds a data point to bigip.virtual_server.packet.count metric.

func (*MetricsBuilder) RecordBigipVirtualServerRequestCountDataPoint

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

RecordBigipVirtualServerRequestCountDataPoint adds a data point to bigip.virtual_server.request.count metric.

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 bigipreceiver metrics builder.

func DefaultMetricsBuilderConfig added in v0.73.0

func DefaultMetricsBuilderConfig() MetricsBuilderConfig

type MetricsConfig added in v0.77.0

type MetricsConfig struct {
	BigipNodeAvailability             MetricConfig `mapstructure:"bigip.node.availability"`
	BigipNodeConnectionCount          MetricConfig `mapstructure:"bigip.node.connection.count"`
	BigipNodeDataTransmitted          MetricConfig `mapstructure:"bigip.node.data.transmitted"`
	BigipNodeEnabled                  MetricConfig `mapstructure:"bigip.node.enabled"`
	BigipNodePacketCount              MetricConfig `mapstructure:"bigip.node.packet.count"`
	BigipNodeRequestCount             MetricConfig `mapstructure:"bigip.node.request.count"`
	BigipNodeSessionCount             MetricConfig `mapstructure:"bigip.node.session.count"`
	BigipPoolAvailability             MetricConfig `mapstructure:"bigip.pool.availability"`
	BigipPoolConnectionCount          MetricConfig `mapstructure:"bigip.pool.connection.count"`
	BigipPoolDataTransmitted          MetricConfig `mapstructure:"bigip.pool.data.transmitted"`
	BigipPoolEnabled                  MetricConfig `mapstructure:"bigip.pool.enabled"`
	BigipPoolMemberCount              MetricConfig `mapstructure:"bigip.pool.member.count"`
	BigipPoolPacketCount              MetricConfig `mapstructure:"bigip.pool.packet.count"`
	BigipPoolRequestCount             MetricConfig `mapstructure:"bigip.pool.request.count"`
	BigipPoolMemberAvailability       MetricConfig `mapstructure:"bigip.pool_member.availability"`
	BigipPoolMemberConnectionCount    MetricConfig `mapstructure:"bigip.pool_member.connection.count"`
	BigipPoolMemberDataTransmitted    MetricConfig `mapstructure:"bigip.pool_member.data.transmitted"`
	BigipPoolMemberEnabled            MetricConfig `mapstructure:"bigip.pool_member.enabled"`
	BigipPoolMemberPacketCount        MetricConfig `mapstructure:"bigip.pool_member.packet.count"`
	BigipPoolMemberRequestCount       MetricConfig `mapstructure:"bigip.pool_member.request.count"`
	BigipPoolMemberSessionCount       MetricConfig `mapstructure:"bigip.pool_member.session.count"`
	BigipVirtualServerAvailability    MetricConfig `mapstructure:"bigip.virtual_server.availability"`
	BigipVirtualServerConnectionCount MetricConfig `mapstructure:"bigip.virtual_server.connection.count"`
	BigipVirtualServerDataTransmitted MetricConfig `mapstructure:"bigip.virtual_server.data.transmitted"`
	BigipVirtualServerEnabled         MetricConfig `mapstructure:"bigip.virtual_server.enabled"`
	BigipVirtualServerPacketCount     MetricConfig `mapstructure:"bigip.virtual_server.packet.count"`
	BigipVirtualServerRequestCount    MetricConfig `mapstructure:"bigip.virtual_server.request.count"`
}

MetricsConfig provides config for bigipreceiver 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"`
}

ResourceAttributeConfig provides common config for a particular resource attribute.

type ResourceAttributesConfig added in v0.77.0

type ResourceAttributesConfig struct {
	BigipNodeIPAddress            ResourceAttributeConfig `mapstructure:"bigip.node.ip_address"`
	BigipNodeName                 ResourceAttributeConfig `mapstructure:"bigip.node.name"`
	BigipPoolName                 ResourceAttributeConfig `mapstructure:"bigip.pool.name"`
	BigipPoolMemberIPAddress      ResourceAttributeConfig `mapstructure:"bigip.pool_member.ip_address"`
	BigipPoolMemberName           ResourceAttributeConfig `mapstructure:"bigip.pool_member.name"`
	BigipVirtualServerDestination ResourceAttributeConfig `mapstructure:"bigip.virtual_server.destination"`
	BigipVirtualServerName        ResourceAttributeConfig `mapstructure:"bigip.virtual_server.name"`
}

ResourceAttributesConfig provides config for bigipreceiver resource attributes.

func DefaultResourceAttributesConfig added in v0.77.0

func DefaultResourceAttributesConfig() ResourceAttributesConfig

type ResourceMetricsOption

type ResourceMetricsOption func(ResourceAttributesConfig, pmetric.ResourceMetrics)

ResourceMetricsOption applies changes to provided resource metrics.

func WithBigipNodeIPAddress

func WithBigipNodeIPAddress(val string) ResourceMetricsOption

WithBigipNodeIPAddress sets provided value as "bigip.node.ip_address" attribute for current resource.

func WithBigipNodeName

func WithBigipNodeName(val string) ResourceMetricsOption

WithBigipNodeName sets provided value as "bigip.node.name" attribute for current resource.

func WithBigipPoolMemberIPAddress

func WithBigipPoolMemberIPAddress(val string) ResourceMetricsOption

WithBigipPoolMemberIPAddress sets provided value as "bigip.pool_member.ip_address" attribute for current resource.

func WithBigipPoolMemberName

func WithBigipPoolMemberName(val string) ResourceMetricsOption

WithBigipPoolMemberName sets provided value as "bigip.pool_member.name" attribute for current resource.

func WithBigipPoolName

func WithBigipPoolName(val string) ResourceMetricsOption

WithBigipPoolName sets provided value as "bigip.pool.name" attribute for current resource.

func WithBigipVirtualServerDestination

func WithBigipVirtualServerDestination(val string) ResourceMetricsOption

WithBigipVirtualServerDestination sets provided value as "bigip.virtual_server.destination" attribute for current resource.

func WithBigipVirtualServerName

func WithBigipVirtualServerName(val string) ResourceMetricsOption

WithBigipVirtualServerName sets provided value as "bigip.virtual_server.name" attribute for current 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