Documentation ¶
Index ¶
- Variables
- func WithStartTime(startTime pcommon.Timestamp) metricBuilderOption
- type AttributeConnectionOp
- type AttributeConnectionType
- type AttributeNamespaceComponent
- type AttributeScanResult
- type AttributeScanType
- type AttributeTransactionResult
- type AttributeTransactionType
- type MetricSettings
- type MetricsBuilder
- func (mb *MetricsBuilder) Emit(rmo ...ResourceMetricsOption) pmetric.Metrics
- func (mb *MetricsBuilder) EmitForResource(rmo ...ResourceMetricsOption)
- func (mb *MetricsBuilder) RecordAeropsikeNamespaceTransactionCountDataPoint(ts pcommon.Timestamp, inputVal string, ...) error
- func (mb *MetricsBuilder) RecordAerospikeNamespaceDiskAvailableDataPoint(ts pcommon.Timestamp, inputVal string) error
- func (mb *MetricsBuilder) RecordAerospikeNamespaceMemoryFreeDataPoint(ts pcommon.Timestamp, inputVal string) error
- func (mb *MetricsBuilder) RecordAerospikeNamespaceMemoryUsageDataPoint(ts pcommon.Timestamp, inputVal string, ...) error
- func (mb *MetricsBuilder) RecordAerospikeNamespaceScanCountDataPoint(ts pcommon.Timestamp, inputVal string, ...) error
- func (mb *MetricsBuilder) RecordAerospikeNodeConnectionCountDataPoint(ts pcommon.Timestamp, inputVal string, ...) error
- func (mb *MetricsBuilder) RecordAerospikeNodeConnectionOpenDataPoint(ts pcommon.Timestamp, inputVal string, ...) error
- func (mb *MetricsBuilder) RecordAerospikeNodeMemoryFreeDataPoint(ts pcommon.Timestamp, inputVal string) error
- func (mb *MetricsBuilder) Reset(options ...metricBuilderOption)
- type MetricsSettings
- type ResourceMetricsOption
Constants ¶
This section is empty.
Variables ¶
var MapAttributeConnectionOp = map[string]AttributeConnectionOp{ "close": AttributeConnectionOpClose, "open": AttributeConnectionOpOpen, }
MapAttributeConnectionOp is a helper map of string to AttributeConnectionOp attribute value.
var MapAttributeConnectionType = map[string]AttributeConnectionType{ "client": AttributeConnectionTypeClient, "fabric": AttributeConnectionTypeFabric, "heartbeat": AttributeConnectionTypeHeartbeat, }
MapAttributeConnectionType is a helper map of string to AttributeConnectionType attribute value.
var MapAttributeNamespaceComponent = map[string]AttributeNamespaceComponent{ "data": AttributeNamespaceComponentData, "index": AttributeNamespaceComponentIndex, "set_index": AttributeNamespaceComponentSetIndex, "secondary_index": AttributeNamespaceComponentSecondaryIndex, }
MapAttributeNamespaceComponent is a helper map of string to AttributeNamespaceComponent attribute value.
var MapAttributeScanResult = map[string]AttributeScanResult{ "abort": AttributeScanResultAbort, "complete": AttributeScanResultComplete, "error": AttributeScanResultError, }
MapAttributeScanResult is a helper map of string to AttributeScanResult attribute value.
var MapAttributeScanType = map[string]AttributeScanType{ "aggregation": AttributeScanTypeAggregation, "basic": AttributeScanTypeBasic, "ops_background": AttributeScanTypeOpsBackground, "udf_background": AttributeScanTypeUdfBackground, }
MapAttributeScanType is a helper map of string to AttributeScanType attribute value.
var MapAttributeTransactionResult = map[string]AttributeTransactionResult{ "error": AttributeTransactionResultError, "filtered_out": AttributeTransactionResultFilteredOut, "not_found": AttributeTransactionResultNotFound, "success": AttributeTransactionResultSuccess, "timeout": AttributeTransactionResultTimeout, }
MapAttributeTransactionResult is a helper map of string to AttributeTransactionResult attribute value.
var MapAttributeTransactionType = map[string]AttributeTransactionType{ "delete": AttributeTransactionTypeDelete, "read": AttributeTransactionTypeRead, "udf": AttributeTransactionTypeUdf, "write": AttributeTransactionTypeWrite, }
MapAttributeTransactionType is a helper map of string to AttributeTransactionType attribute value.
Functions ¶
func WithStartTime ¶
WithStartTime sets startTime on the metrics builder.
Types ¶
type AttributeConnectionOp ¶
type AttributeConnectionOp int
AttributeConnectionOp specifies the a value connection_op attribute.
const ( AttributeConnectionOpClose AttributeConnectionOp AttributeConnectionOpOpen )
func (AttributeConnectionOp) String ¶
func (av AttributeConnectionOp) String() string
String returns the string representation of the AttributeConnectionOp.
type AttributeConnectionType ¶
type AttributeConnectionType int
AttributeConnectionType specifies the a value connection_type attribute.
const ( AttributeConnectionTypeClient AttributeConnectionType AttributeConnectionTypeFabric AttributeConnectionTypeHeartbeat )
func (AttributeConnectionType) String ¶
func (av AttributeConnectionType) String() string
String returns the string representation of the AttributeConnectionType.
type AttributeNamespaceComponent ¶
type AttributeNamespaceComponent int
AttributeNamespaceComponent specifies the a value namespace_component attribute.
const ( AttributeNamespaceComponentData AttributeNamespaceComponent AttributeNamespaceComponentIndex AttributeNamespaceComponentSetIndex AttributeNamespaceComponentSecondaryIndex )
func (AttributeNamespaceComponent) String ¶
func (av AttributeNamespaceComponent) String() string
String returns the string representation of the AttributeNamespaceComponent.
type AttributeScanResult ¶
type AttributeScanResult int
AttributeScanResult specifies the a value scan_result attribute.
const ( AttributeScanResultAbort AttributeScanResult AttributeScanResultComplete AttributeScanResultError )
func (AttributeScanResult) String ¶
func (av AttributeScanResult) String() string
String returns the string representation of the AttributeScanResult.
type AttributeScanType ¶
type AttributeScanType int
AttributeScanType specifies the a value scan_type attribute.
const ( AttributeScanTypeAggregation AttributeScanType AttributeScanTypeBasic AttributeScanTypeOpsBackground AttributeScanTypeUdfBackground )
func (AttributeScanType) String ¶
func (av AttributeScanType) String() string
String returns the string representation of the AttributeScanType.
type AttributeTransactionResult ¶
type AttributeTransactionResult int
AttributeTransactionResult specifies the a value transaction_result attribute.
const ( AttributeTransactionResultError AttributeTransactionResult AttributeTransactionResultFilteredOut AttributeTransactionResultNotFound AttributeTransactionResultSuccess AttributeTransactionResultTimeout )
func (AttributeTransactionResult) String ¶
func (av AttributeTransactionResult) String() string
String returns the string representation of the AttributeTransactionResult.
type AttributeTransactionType ¶
type AttributeTransactionType int
AttributeTransactionType specifies the a value transaction_type attribute.
const ( AttributeTransactionTypeDelete AttributeTransactionType AttributeTransactionTypeRead AttributeTransactionTypeUdf AttributeTransactionTypeWrite )
func (AttributeTransactionType) String ¶
func (av AttributeTransactionType) String() string
String returns the string representation of the AttributeTransactionType.
type MetricSettings ¶
type MetricSettings struct {
Enabled bool `mapstructure:"enabled"`
}
MetricSettings provides common settings for a particular metric.
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 settings.
func NewMetricsBuilder ¶
func NewMetricsBuilder(settings MetricsSettings, buildInfo component.BuildInfo, options ...metricBuilderOption) *MetricsBuilder
func (*MetricsBuilder) Emit ¶
func (mb *MetricsBuilder) Emit(rmo ...ResourceMetricsOption) pmetric.Metrics
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 settings, 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) RecordAeropsikeNamespaceTransactionCountDataPoint ¶
func (mb *MetricsBuilder) RecordAeropsikeNamespaceTransactionCountDataPoint(ts pcommon.Timestamp, inputVal string, transactionTypeAttributeValue AttributeTransactionType, transactionResultAttributeValue AttributeTransactionResult) error
RecordAeropsikeNamespaceTransactionCountDataPoint adds a data point to aeropsike.namespace.transaction.count metric.
func (*MetricsBuilder) RecordAerospikeNamespaceDiskAvailableDataPoint ¶
func (mb *MetricsBuilder) RecordAerospikeNamespaceDiskAvailableDataPoint(ts pcommon.Timestamp, inputVal string) error
RecordAerospikeNamespaceDiskAvailableDataPoint adds a data point to aerospike.namespace.disk.available metric.
func (*MetricsBuilder) RecordAerospikeNamespaceMemoryFreeDataPoint ¶
func (mb *MetricsBuilder) RecordAerospikeNamespaceMemoryFreeDataPoint(ts pcommon.Timestamp, inputVal string) error
RecordAerospikeNamespaceMemoryFreeDataPoint adds a data point to aerospike.namespace.memory.free metric.
func (*MetricsBuilder) RecordAerospikeNamespaceMemoryUsageDataPoint ¶
func (mb *MetricsBuilder) RecordAerospikeNamespaceMemoryUsageDataPoint(ts pcommon.Timestamp, inputVal string, namespaceComponentAttributeValue AttributeNamespaceComponent) error
RecordAerospikeNamespaceMemoryUsageDataPoint adds a data point to aerospike.namespace.memory.usage metric.
func (*MetricsBuilder) RecordAerospikeNamespaceScanCountDataPoint ¶
func (mb *MetricsBuilder) RecordAerospikeNamespaceScanCountDataPoint(ts pcommon.Timestamp, inputVal string, scanTypeAttributeValue AttributeScanType, scanResultAttributeValue AttributeScanResult) error
RecordAerospikeNamespaceScanCountDataPoint adds a data point to aerospike.namespace.scan.count metric.
func (*MetricsBuilder) RecordAerospikeNodeConnectionCountDataPoint ¶
func (mb *MetricsBuilder) RecordAerospikeNodeConnectionCountDataPoint(ts pcommon.Timestamp, inputVal string, connectionTypeAttributeValue AttributeConnectionType, connectionOpAttributeValue AttributeConnectionOp) error
RecordAerospikeNodeConnectionCountDataPoint adds a data point to aerospike.node.connection.count metric.
func (*MetricsBuilder) RecordAerospikeNodeConnectionOpenDataPoint ¶
func (mb *MetricsBuilder) RecordAerospikeNodeConnectionOpenDataPoint(ts pcommon.Timestamp, inputVal string, connectionTypeAttributeValue AttributeConnectionType) error
RecordAerospikeNodeConnectionOpenDataPoint adds a data point to aerospike.node.connection.open metric.
func (*MetricsBuilder) RecordAerospikeNodeMemoryFreeDataPoint ¶
func (mb *MetricsBuilder) RecordAerospikeNodeMemoryFreeDataPoint(ts pcommon.Timestamp, inputVal string) error
RecordAerospikeNodeMemoryFreeDataPoint adds a data point to aerospike.node.memory.free 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 MetricsSettings ¶
type MetricsSettings struct { AeropsikeNamespaceTransactionCount MetricSettings `mapstructure:"aeropsike.namespace.transaction.count"` AerospikeNamespaceDiskAvailable MetricSettings `mapstructure:"aerospike.namespace.disk.available"` AerospikeNamespaceMemoryFree MetricSettings `mapstructure:"aerospike.namespace.memory.free"` AerospikeNamespaceMemoryUsage MetricSettings `mapstructure:"aerospike.namespace.memory.usage"` AerospikeNamespaceScanCount MetricSettings `mapstructure:"aerospike.namespace.scan.count"` AerospikeNodeConnectionCount MetricSettings `mapstructure:"aerospike.node.connection.count"` AerospikeNodeConnectionOpen MetricSettings `mapstructure:"aerospike.node.connection.open"` AerospikeNodeMemoryFree MetricSettings `mapstructure:"aerospike.node.memory.free"` }
MetricsSettings provides settings for aerospikereceiver metrics.
func DefaultMetricsSettings ¶
func DefaultMetricsSettings() MetricsSettings
type ResourceMetricsOption ¶
type ResourceMetricsOption func(pmetric.ResourceMetrics)
ResourceMetricsOption applies changes to provided resource metrics.
func WithAerospikeNamespace ¶
func WithAerospikeNamespace(val string) ResourceMetricsOption
WithAerospikeNamespace sets provided value as "aerospike.namespace" attribute for current resource.
func WithAerospikeNodeName ¶
func WithAerospikeNodeName(val string) ResourceMetricsOption
WithAerospikeNodeName sets provided value as "aerospike.node.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.