Documentation ¶
Index ¶
- Variables
- func WithStartTime(startTime pcommon.Timestamp) metricBuilderOption
- type AttributeConnectionOp
- type AttributeConnectionType
- type AttributeIndexType
- type AttributeNamespaceComponent
- type AttributeQueryResult
- type AttributeQueryType
- 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) RecordAerospikeNamespaceDiskAvailableDataPoint(ts pcommon.Timestamp, inputVal string) error
- func (mb *MetricsBuilder) RecordAerospikeNamespaceGeojsonRegionQueryCellsDataPoint(ts pcommon.Timestamp, inputVal string) error
- func (mb *MetricsBuilder) RecordAerospikeNamespaceGeojsonRegionQueryFalsePositiveDataPoint(ts pcommon.Timestamp, inputVal string) error
- func (mb *MetricsBuilder) RecordAerospikeNamespaceGeojsonRegionQueryPointsDataPoint(ts pcommon.Timestamp, inputVal string) error
- func (mb *MetricsBuilder) RecordAerospikeNamespaceGeojsonRegionQueryRequestsDataPoint(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) RecordAerospikeNamespaceQueryCountDataPoint(ts pcommon.Timestamp, inputVal string, ...) error
- func (mb *MetricsBuilder) RecordAerospikeNamespaceScanCountDataPoint(ts pcommon.Timestamp, inputVal string, ...) error
- func (mb *MetricsBuilder) RecordAerospikeNamespaceTransactionCountDataPoint(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) RecordAerospikeNodeQueryTrackedDataPoint(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 MapAttributeIndexType = map[string]AttributeIndexType{ "primary": AttributeIndexTypePrimary, "secondary": AttributeIndexTypeSecondary, }
MapAttributeIndexType is a helper map of string to AttributeIndexType 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 MapAttributeQueryResult = map[string]AttributeQueryResult{ "abort": AttributeQueryResultAbort, "complete": AttributeQueryResultComplete, "error": AttributeQueryResultError, "timeout": AttributeQueryResultTimeout, }
MapAttributeQueryResult is a helper map of string to AttributeQueryResult attribute value.
var MapAttributeQueryType = map[string]AttributeQueryType{ "aggregation": AttributeQueryTypeAggregation, "basic": AttributeQueryTypeBasic, "short": AttributeQueryTypeShort, "long_basic": AttributeQueryTypeLongBasic, "short_basic": AttributeQueryTypeShortBasic, "ops_background": AttributeQueryTypeOpsBackground, "udf_background": AttributeQueryTypeUdfBackground, }
MapAttributeQueryType is a helper map of string to AttributeQueryType 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 AttributeIndexType ¶ added in v0.59.0
type AttributeIndexType int
AttributeIndexType specifies the a value index_type attribute.
const ( AttributeIndexTypePrimary AttributeIndexType AttributeIndexTypeSecondary )
func (AttributeIndexType) String ¶ added in v0.59.0
func (av AttributeIndexType) String() string
String returns the string representation of the AttributeIndexType.
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 AttributeQueryResult ¶ added in v0.59.0
type AttributeQueryResult int
AttributeQueryResult specifies the a value query_result attribute.
const ( AttributeQueryResultAbort AttributeQueryResult AttributeQueryResultComplete AttributeQueryResultError AttributeQueryResultTimeout )
func (AttributeQueryResult) String ¶ added in v0.59.0
func (av AttributeQueryResult) String() string
String returns the string representation of the AttributeQueryResult.
type AttributeQueryType ¶ added in v0.59.0
type AttributeQueryType int
AttributeQueryType specifies the a value query_type attribute.
const ( AttributeQueryTypeAggregation AttributeQueryType AttributeQueryTypeBasic AttributeQueryTypeShort AttributeQueryTypeLongBasic AttributeQueryTypeShortBasic AttributeQueryTypeOpsBackground AttributeQueryTypeUdfBackground )
func (AttributeQueryType) String ¶ added in v0.59.0
func (av AttributeQueryType) String() string
String returns the string representation of the AttributeQueryType.
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) RecordAerospikeNamespaceDiskAvailableDataPoint ¶
func (mb *MetricsBuilder) RecordAerospikeNamespaceDiskAvailableDataPoint(ts pcommon.Timestamp, inputVal string) error
RecordAerospikeNamespaceDiskAvailableDataPoint adds a data point to aerospike.namespace.disk.available metric.
func (*MetricsBuilder) RecordAerospikeNamespaceGeojsonRegionQueryCellsDataPoint ¶ added in v0.59.0
func (mb *MetricsBuilder) RecordAerospikeNamespaceGeojsonRegionQueryCellsDataPoint(ts pcommon.Timestamp, inputVal string) error
RecordAerospikeNamespaceGeojsonRegionQueryCellsDataPoint adds a data point to aerospike.namespace.geojson.region_query_cells metric.
func (*MetricsBuilder) RecordAerospikeNamespaceGeojsonRegionQueryFalsePositiveDataPoint ¶ added in v0.59.0
func (mb *MetricsBuilder) RecordAerospikeNamespaceGeojsonRegionQueryFalsePositiveDataPoint(ts pcommon.Timestamp, inputVal string) error
RecordAerospikeNamespaceGeojsonRegionQueryFalsePositiveDataPoint adds a data point to aerospike.namespace.geojson.region_query_false_positive metric.
func (*MetricsBuilder) RecordAerospikeNamespaceGeojsonRegionQueryPointsDataPoint ¶ added in v0.59.0
func (mb *MetricsBuilder) RecordAerospikeNamespaceGeojsonRegionQueryPointsDataPoint(ts pcommon.Timestamp, inputVal string) error
RecordAerospikeNamespaceGeojsonRegionQueryPointsDataPoint adds a data point to aerospike.namespace.geojson.region_query_points metric.
func (*MetricsBuilder) RecordAerospikeNamespaceGeojsonRegionQueryRequestsDataPoint ¶ added in v0.59.0
func (mb *MetricsBuilder) RecordAerospikeNamespaceGeojsonRegionQueryRequestsDataPoint(ts pcommon.Timestamp, inputVal string) error
RecordAerospikeNamespaceGeojsonRegionQueryRequestsDataPoint adds a data point to aerospike.namespace.geojson.region_query_requests 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) RecordAerospikeNamespaceQueryCountDataPoint ¶ added in v0.59.0
func (mb *MetricsBuilder) RecordAerospikeNamespaceQueryCountDataPoint(ts pcommon.Timestamp, inputVal string, queryTypeAttributeValue AttributeQueryType, indexTypeAttributeValue AttributeIndexType, queryResultAttributeValue AttributeQueryResult) error
RecordAerospikeNamespaceQueryCountDataPoint adds a data point to aerospike.namespace.query.count 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) RecordAerospikeNamespaceTransactionCountDataPoint ¶ added in v0.55.0
func (mb *MetricsBuilder) RecordAerospikeNamespaceTransactionCountDataPoint(ts pcommon.Timestamp, inputVal string, transactionTypeAttributeValue AttributeTransactionType, transactionResultAttributeValue AttributeTransactionResult) error
RecordAerospikeNamespaceTransactionCountDataPoint adds a data point to aerospike.namespace.transaction.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) RecordAerospikeNodeQueryTrackedDataPoint ¶ added in v0.59.0
func (mb *MetricsBuilder) RecordAerospikeNodeQueryTrackedDataPoint(ts pcommon.Timestamp, inputVal string) error
RecordAerospikeNodeQueryTrackedDataPoint adds a data point to aerospike.node.query.tracked 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 { AerospikeNamespaceDiskAvailable MetricSettings `mapstructure:"aerospike.namespace.disk.available"` AerospikeNamespaceGeojsonRegionQueryCells MetricSettings `mapstructure:"aerospike.namespace.geojson.region_query_cells"` AerospikeNamespaceGeojsonRegionQueryFalsePositive MetricSettings `mapstructure:"aerospike.namespace.geojson.region_query_false_positive"` AerospikeNamespaceGeojsonRegionQueryPoints MetricSettings `mapstructure:"aerospike.namespace.geojson.region_query_points"` AerospikeNamespaceGeojsonRegionQueryRequests MetricSettings `mapstructure:"aerospike.namespace.geojson.region_query_requests"` AerospikeNamespaceMemoryFree MetricSettings `mapstructure:"aerospike.namespace.memory.free"` AerospikeNamespaceMemoryUsage MetricSettings `mapstructure:"aerospike.namespace.memory.usage"` AerospikeNamespaceQueryCount MetricSettings `mapstructure:"aerospike.namespace.query.count"` AerospikeNamespaceScanCount MetricSettings `mapstructure:"aerospike.namespace.scan.count"` AerospikeNamespaceTransactionCount MetricSettings `mapstructure:"aerospike.namespace.transaction.count"` AerospikeNodeConnectionCount MetricSettings `mapstructure:"aerospike.node.connection.count"` AerospikeNodeConnectionOpen MetricSettings `mapstructure:"aerospike.node.connection.open"` AerospikeNodeMemoryFree MetricSettings `mapstructure:"aerospike.node.memory.free"` AerospikeNodeQueryTracked MetricSettings `mapstructure:"aerospike.node.query.tracked"` }
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.