Documentation ¶
Index ¶
- Variables
- func WithStartTime(startTime pcommon.Timestamp) metricBuilderOption
- type AttributeDirection
- type MetricSettings
- type MetricsBuilder
- func (mb *MetricsBuilder) Emit(rmo ...ResourceMetricsOption) pmetric.Metrics
- func (mb *MetricsBuilder) EmitForResource(rmo ...ResourceMetricsOption)
- func (mb *MetricsBuilder) RecordSystemDiskIoDataPoint(ts pcommon.Timestamp, val int64, deviceAttributeValue string, ...)
- func (mb *MetricsBuilder) RecordSystemDiskIoReadDataPoint(ts pcommon.Timestamp, val int64, deviceAttributeValue string)
- func (mb *MetricsBuilder) RecordSystemDiskIoTimeDataPoint(ts pcommon.Timestamp, val float64, deviceAttributeValue string)
- func (mb *MetricsBuilder) RecordSystemDiskIoWriteDataPoint(ts pcommon.Timestamp, val int64, deviceAttributeValue string)
- func (mb *MetricsBuilder) RecordSystemDiskMergedDataPoint(ts pcommon.Timestamp, val int64, deviceAttributeValue string, ...)
- func (mb *MetricsBuilder) RecordSystemDiskMergedReadDataPoint(ts pcommon.Timestamp, val int64, deviceAttributeValue string)
- func (mb *MetricsBuilder) RecordSystemDiskMergedWriteDataPoint(ts pcommon.Timestamp, val int64, deviceAttributeValue string)
- func (mb *MetricsBuilder) RecordSystemDiskOperationTimeDataPoint(ts pcommon.Timestamp, val float64, deviceAttributeValue string, ...)
- func (mb *MetricsBuilder) RecordSystemDiskOperationTimeReadDataPoint(ts pcommon.Timestamp, val float64, deviceAttributeValue string)
- func (mb *MetricsBuilder) RecordSystemDiskOperationTimeWriteDataPoint(ts pcommon.Timestamp, val float64, deviceAttributeValue string)
- func (mb *MetricsBuilder) RecordSystemDiskOperationsDataPoint(ts pcommon.Timestamp, val int64, deviceAttributeValue string, ...)
- func (mb *MetricsBuilder) RecordSystemDiskOperationsReadDataPoint(ts pcommon.Timestamp, val int64, deviceAttributeValue string)
- func (mb *MetricsBuilder) RecordSystemDiskOperationsWriteDataPoint(ts pcommon.Timestamp, val int64, deviceAttributeValue string)
- func (mb *MetricsBuilder) RecordSystemDiskPendingOperationsDataPoint(ts pcommon.Timestamp, val int64, deviceAttributeValue string)
- func (mb *MetricsBuilder) RecordSystemDiskWeightedIoTimeDataPoint(ts pcommon.Timestamp, val float64, deviceAttributeValue string)
- func (mb *MetricsBuilder) Reset(options ...metricBuilderOption)
- type MetricsSettings
- type ResourceMetricsOption
Constants ¶
This section is empty.
Variables ¶
var MapAttributeDirection = map[string]AttributeDirection{ "read": AttributeDirectionRead, "write": AttributeDirectionWrite, }
MapAttributeDirection is a helper map of string to AttributeDirection attribute value.
Functions ¶
func WithStartTime ¶ added in v0.42.0
WithStartTime sets startTime on the metrics builder.
Types ¶
type AttributeDirection ¶ added in v0.39.0
type AttributeDirection int
AttributeDirection specifies the a value direction attribute.
const ( AttributeDirectionRead AttributeDirection AttributeDirectionWrite )
func (AttributeDirection) String ¶ added in v0.51.0
func (av AttributeDirection) String() string
String returns the string representation of the AttributeDirection.
type MetricSettings ¶ added in v0.42.0
type MetricSettings struct {
Enabled bool `mapstructure:"enabled"`
}
MetricSettings provides common settings for a particular metric.
type MetricsBuilder ¶ added in v0.42.0
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 ¶ added in v0.42.0
func NewMetricsBuilder(settings MetricsSettings, buildInfo component.BuildInfo, options ...metricBuilderOption) *MetricsBuilder
func (*MetricsBuilder) Emit ¶ added in v0.42.0
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 ¶ added in v0.48.0
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) RecordSystemDiskIoDataPoint ¶ added in v0.42.0
func (mb *MetricsBuilder) RecordSystemDiskIoDataPoint(ts pcommon.Timestamp, val int64, deviceAttributeValue string, directionAttributeValue AttributeDirection)
RecordSystemDiskIoDataPoint adds a data point to system.disk.io metric.
func (*MetricsBuilder) RecordSystemDiskIoReadDataPoint ¶ added in v0.56.0
func (mb *MetricsBuilder) RecordSystemDiskIoReadDataPoint(ts pcommon.Timestamp, val int64, deviceAttributeValue string)
RecordSystemDiskIoReadDataPoint adds a data point to system.disk.io.read metric.
func (*MetricsBuilder) RecordSystemDiskIoTimeDataPoint ¶ added in v0.42.0
func (mb *MetricsBuilder) RecordSystemDiskIoTimeDataPoint(ts pcommon.Timestamp, val float64, deviceAttributeValue string)
RecordSystemDiskIoTimeDataPoint adds a data point to system.disk.io_time metric.
func (*MetricsBuilder) RecordSystemDiskIoWriteDataPoint ¶ added in v0.56.0
func (mb *MetricsBuilder) RecordSystemDiskIoWriteDataPoint(ts pcommon.Timestamp, val int64, deviceAttributeValue string)
RecordSystemDiskIoWriteDataPoint adds a data point to system.disk.io.write metric.
func (*MetricsBuilder) RecordSystemDiskMergedDataPoint ¶ added in v0.42.0
func (mb *MetricsBuilder) RecordSystemDiskMergedDataPoint(ts pcommon.Timestamp, val int64, deviceAttributeValue string, directionAttributeValue AttributeDirection)
RecordSystemDiskMergedDataPoint adds a data point to system.disk.merged metric.
func (*MetricsBuilder) RecordSystemDiskMergedReadDataPoint ¶ added in v0.56.0
func (mb *MetricsBuilder) RecordSystemDiskMergedReadDataPoint(ts pcommon.Timestamp, val int64, deviceAttributeValue string)
RecordSystemDiskMergedReadDataPoint adds a data point to system.disk.merged.read metric.
func (*MetricsBuilder) RecordSystemDiskMergedWriteDataPoint ¶ added in v0.56.0
func (mb *MetricsBuilder) RecordSystemDiskMergedWriteDataPoint(ts pcommon.Timestamp, val int64, deviceAttributeValue string)
RecordSystemDiskMergedWriteDataPoint adds a data point to system.disk.merged.write metric.
func (*MetricsBuilder) RecordSystemDiskOperationTimeDataPoint ¶ added in v0.42.0
func (mb *MetricsBuilder) RecordSystemDiskOperationTimeDataPoint(ts pcommon.Timestamp, val float64, deviceAttributeValue string, directionAttributeValue AttributeDirection)
RecordSystemDiskOperationTimeDataPoint adds a data point to system.disk.operation_time metric.
func (*MetricsBuilder) RecordSystemDiskOperationTimeReadDataPoint ¶ added in v0.56.0
func (mb *MetricsBuilder) RecordSystemDiskOperationTimeReadDataPoint(ts pcommon.Timestamp, val float64, deviceAttributeValue string)
RecordSystemDiskOperationTimeReadDataPoint adds a data point to system.disk.operation_time.read metric.
func (*MetricsBuilder) RecordSystemDiskOperationTimeWriteDataPoint ¶ added in v0.56.0
func (mb *MetricsBuilder) RecordSystemDiskOperationTimeWriteDataPoint(ts pcommon.Timestamp, val float64, deviceAttributeValue string)
RecordSystemDiskOperationTimeWriteDataPoint adds a data point to system.disk.operation_time.write metric.
func (*MetricsBuilder) RecordSystemDiskOperationsDataPoint ¶ added in v0.42.0
func (mb *MetricsBuilder) RecordSystemDiskOperationsDataPoint(ts pcommon.Timestamp, val int64, deviceAttributeValue string, directionAttributeValue AttributeDirection)
RecordSystemDiskOperationsDataPoint adds a data point to system.disk.operations metric.
func (*MetricsBuilder) RecordSystemDiskOperationsReadDataPoint ¶ added in v0.56.0
func (mb *MetricsBuilder) RecordSystemDiskOperationsReadDataPoint(ts pcommon.Timestamp, val int64, deviceAttributeValue string)
RecordSystemDiskOperationsReadDataPoint adds a data point to system.disk.operations.read metric.
func (*MetricsBuilder) RecordSystemDiskOperationsWriteDataPoint ¶ added in v0.56.0
func (mb *MetricsBuilder) RecordSystemDiskOperationsWriteDataPoint(ts pcommon.Timestamp, val int64, deviceAttributeValue string)
RecordSystemDiskOperationsWriteDataPoint adds a data point to system.disk.operations.write metric.
func (*MetricsBuilder) RecordSystemDiskPendingOperationsDataPoint ¶ added in v0.42.0
func (mb *MetricsBuilder) RecordSystemDiskPendingOperationsDataPoint(ts pcommon.Timestamp, val int64, deviceAttributeValue string)
RecordSystemDiskPendingOperationsDataPoint adds a data point to system.disk.pending_operations metric.
func (*MetricsBuilder) RecordSystemDiskWeightedIoTimeDataPoint ¶ added in v0.42.0
func (mb *MetricsBuilder) RecordSystemDiskWeightedIoTimeDataPoint(ts pcommon.Timestamp, val float64, deviceAttributeValue string)
RecordSystemDiskWeightedIoTimeDataPoint adds a data point to system.disk.weighted_io_time metric.
func (*MetricsBuilder) Reset ¶ added in v0.42.0
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 ¶ added in v0.42.0
type MetricsSettings struct { SystemDiskIo MetricSettings `mapstructure:"system.disk.io"` SystemDiskIoRead MetricSettings `mapstructure:"system.disk.io.read"` SystemDiskIoWrite MetricSettings `mapstructure:"system.disk.io.write"` SystemDiskIoTime MetricSettings `mapstructure:"system.disk.io_time"` SystemDiskMerged MetricSettings `mapstructure:"system.disk.merged"` SystemDiskMergedRead MetricSettings `mapstructure:"system.disk.merged.read"` SystemDiskMergedWrite MetricSettings `mapstructure:"system.disk.merged.write"` SystemDiskOperationTime MetricSettings `mapstructure:"system.disk.operation_time"` SystemDiskOperationTimeRead MetricSettings `mapstructure:"system.disk.operation_time.read"` SystemDiskOperationTimeWrite MetricSettings `mapstructure:"system.disk.operation_time.write"` SystemDiskOperations MetricSettings `mapstructure:"system.disk.operations"` SystemDiskOperationsRead MetricSettings `mapstructure:"system.disk.operations.read"` SystemDiskOperationsWrite MetricSettings `mapstructure:"system.disk.operations.write"` SystemDiskPendingOperations MetricSettings `mapstructure:"system.disk.pending_operations"` SystemDiskWeightedIoTime MetricSettings `mapstructure:"system.disk.weighted_io_time"` }
MetricsSettings provides settings for hostmetricsreceiver/disk metrics.
func DefaultMetricsSettings ¶ added in v0.42.0
func DefaultMetricsSettings() MetricsSettings
type ResourceMetricsOption ¶ added in v0.52.0
type ResourceMetricsOption func(pmetric.ResourceMetrics)
ResourceMetricsOption applies changes to provided resource metrics.
func WithStartTimeOverride ¶ added in v0.52.0
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.