Documentation ¶
Index ¶
- func WithStartTime(startTime pcommon.Timestamp) metricBuilderOption
- type MetricSettings
- type MetricsBuilder
- func (mb *MetricsBuilder) Emit(rmo ...ResourceMetricsOption) pmetric.Metrics
- func (mb *MetricsBuilder) EmitForResource(rmo ...ResourceMetricsOption)
- func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsBuckHashSysDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsFreesDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsGcCPUFractionDataPoint(ts pcommon.Timestamp, val float64)
- func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsGcSysDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsHeapAllocDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsHeapIdleDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsHeapInuseDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsHeapObjectsDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsHeapReleasedDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsHeapSysDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsLastPauseDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsLookupsDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsMallocsDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsMcacheInuseDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsMcacheSysDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsMspanInuseDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsMspanSysDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsNextGcDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsNumForcedGcDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsNumGcDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsOtherSysDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsPauseTotalDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsStackInuseDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsStackSysDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsSysDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsTotalAllocDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) Reset(options ...metricBuilderOption)
- type MetricsSettings
- type ResourceMetricsOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithStartTime ¶
WithStartTime sets startTime on the metrics builder.
Types ¶
type MetricSettings ¶
type MetricSettings struct { Enabled bool `mapstructure:"enabled"` // contains filtered or unexported fields }
MetricSettings provides common settings for a particular metric.
func (*MetricSettings) IsEnabledProvidedByUser ¶ added in v0.63.0
func (ms *MetricSettings) IsEnabledProvidedByUser() bool
IsEnabledProvidedByUser returns true if `enabled` option is explicitly set in user settings to any value.
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(ms MetricsSettings, settings receiver.CreateSettings, 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) RecordProcessRuntimeMemstatsBuckHashSysDataPoint ¶
func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsBuckHashSysDataPoint(ts pcommon.Timestamp, val int64)
RecordProcessRuntimeMemstatsBuckHashSysDataPoint adds a data point to process.runtime.memstats.buck_hash_sys metric.
func (*MetricsBuilder) RecordProcessRuntimeMemstatsFreesDataPoint ¶
func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsFreesDataPoint(ts pcommon.Timestamp, val int64)
RecordProcessRuntimeMemstatsFreesDataPoint adds a data point to process.runtime.memstats.frees metric.
func (*MetricsBuilder) RecordProcessRuntimeMemstatsGcCPUFractionDataPoint ¶
func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsGcCPUFractionDataPoint(ts pcommon.Timestamp, val float64)
RecordProcessRuntimeMemstatsGcCPUFractionDataPoint adds a data point to process.runtime.memstats.gc_cpu_fraction metric.
func (*MetricsBuilder) RecordProcessRuntimeMemstatsGcSysDataPoint ¶
func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsGcSysDataPoint(ts pcommon.Timestamp, val int64)
RecordProcessRuntimeMemstatsGcSysDataPoint adds a data point to process.runtime.memstats.gc_sys metric.
func (*MetricsBuilder) RecordProcessRuntimeMemstatsHeapAllocDataPoint ¶
func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsHeapAllocDataPoint(ts pcommon.Timestamp, val int64)
RecordProcessRuntimeMemstatsHeapAllocDataPoint adds a data point to process.runtime.memstats.heap_alloc metric.
func (*MetricsBuilder) RecordProcessRuntimeMemstatsHeapIdleDataPoint ¶
func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsHeapIdleDataPoint(ts pcommon.Timestamp, val int64)
RecordProcessRuntimeMemstatsHeapIdleDataPoint adds a data point to process.runtime.memstats.heap_idle metric.
func (*MetricsBuilder) RecordProcessRuntimeMemstatsHeapInuseDataPoint ¶
func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsHeapInuseDataPoint(ts pcommon.Timestamp, val int64)
RecordProcessRuntimeMemstatsHeapInuseDataPoint adds a data point to process.runtime.memstats.heap_inuse metric.
func (*MetricsBuilder) RecordProcessRuntimeMemstatsHeapObjectsDataPoint ¶
func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsHeapObjectsDataPoint(ts pcommon.Timestamp, val int64)
RecordProcessRuntimeMemstatsHeapObjectsDataPoint adds a data point to process.runtime.memstats.heap_objects metric.
func (*MetricsBuilder) RecordProcessRuntimeMemstatsHeapReleasedDataPoint ¶
func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsHeapReleasedDataPoint(ts pcommon.Timestamp, val int64)
RecordProcessRuntimeMemstatsHeapReleasedDataPoint adds a data point to process.runtime.memstats.heap_released metric.
func (*MetricsBuilder) RecordProcessRuntimeMemstatsHeapSysDataPoint ¶
func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsHeapSysDataPoint(ts pcommon.Timestamp, val int64)
RecordProcessRuntimeMemstatsHeapSysDataPoint adds a data point to process.runtime.memstats.heap_sys metric.
func (*MetricsBuilder) RecordProcessRuntimeMemstatsLastPauseDataPoint ¶
func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsLastPauseDataPoint(ts pcommon.Timestamp, val int64)
RecordProcessRuntimeMemstatsLastPauseDataPoint adds a data point to process.runtime.memstats.last_pause metric.
func (*MetricsBuilder) RecordProcessRuntimeMemstatsLookupsDataPoint ¶
func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsLookupsDataPoint(ts pcommon.Timestamp, val int64)
RecordProcessRuntimeMemstatsLookupsDataPoint adds a data point to process.runtime.memstats.lookups metric.
func (*MetricsBuilder) RecordProcessRuntimeMemstatsMallocsDataPoint ¶
func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsMallocsDataPoint(ts pcommon.Timestamp, val int64)
RecordProcessRuntimeMemstatsMallocsDataPoint adds a data point to process.runtime.memstats.mallocs metric.
func (*MetricsBuilder) RecordProcessRuntimeMemstatsMcacheInuseDataPoint ¶
func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsMcacheInuseDataPoint(ts pcommon.Timestamp, val int64)
RecordProcessRuntimeMemstatsMcacheInuseDataPoint adds a data point to process.runtime.memstats.mcache_inuse metric.
func (*MetricsBuilder) RecordProcessRuntimeMemstatsMcacheSysDataPoint ¶
func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsMcacheSysDataPoint(ts pcommon.Timestamp, val int64)
RecordProcessRuntimeMemstatsMcacheSysDataPoint adds a data point to process.runtime.memstats.mcache_sys metric.
func (*MetricsBuilder) RecordProcessRuntimeMemstatsMspanInuseDataPoint ¶
func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsMspanInuseDataPoint(ts pcommon.Timestamp, val int64)
RecordProcessRuntimeMemstatsMspanInuseDataPoint adds a data point to process.runtime.memstats.mspan_inuse metric.
func (*MetricsBuilder) RecordProcessRuntimeMemstatsMspanSysDataPoint ¶
func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsMspanSysDataPoint(ts pcommon.Timestamp, val int64)
RecordProcessRuntimeMemstatsMspanSysDataPoint adds a data point to process.runtime.memstats.mspan_sys metric.
func (*MetricsBuilder) RecordProcessRuntimeMemstatsNextGcDataPoint ¶
func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsNextGcDataPoint(ts pcommon.Timestamp, val int64)
RecordProcessRuntimeMemstatsNextGcDataPoint adds a data point to process.runtime.memstats.next_gc metric.
func (*MetricsBuilder) RecordProcessRuntimeMemstatsNumForcedGcDataPoint ¶
func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsNumForcedGcDataPoint(ts pcommon.Timestamp, val int64)
RecordProcessRuntimeMemstatsNumForcedGcDataPoint adds a data point to process.runtime.memstats.num_forced_gc metric.
func (*MetricsBuilder) RecordProcessRuntimeMemstatsNumGcDataPoint ¶
func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsNumGcDataPoint(ts pcommon.Timestamp, val int64)
RecordProcessRuntimeMemstatsNumGcDataPoint adds a data point to process.runtime.memstats.num_gc metric.
func (*MetricsBuilder) RecordProcessRuntimeMemstatsOtherSysDataPoint ¶
func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsOtherSysDataPoint(ts pcommon.Timestamp, val int64)
RecordProcessRuntimeMemstatsOtherSysDataPoint adds a data point to process.runtime.memstats.other_sys metric.
func (*MetricsBuilder) RecordProcessRuntimeMemstatsPauseTotalDataPoint ¶
func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsPauseTotalDataPoint(ts pcommon.Timestamp, val int64)
RecordProcessRuntimeMemstatsPauseTotalDataPoint adds a data point to process.runtime.memstats.pause_total metric.
func (*MetricsBuilder) RecordProcessRuntimeMemstatsStackInuseDataPoint ¶
func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsStackInuseDataPoint(ts pcommon.Timestamp, val int64)
RecordProcessRuntimeMemstatsStackInuseDataPoint adds a data point to process.runtime.memstats.stack_inuse metric.
func (*MetricsBuilder) RecordProcessRuntimeMemstatsStackSysDataPoint ¶
func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsStackSysDataPoint(ts pcommon.Timestamp, val int64)
RecordProcessRuntimeMemstatsStackSysDataPoint adds a data point to process.runtime.memstats.stack_sys metric.
func (*MetricsBuilder) RecordProcessRuntimeMemstatsSysDataPoint ¶
func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsSysDataPoint(ts pcommon.Timestamp, val int64)
RecordProcessRuntimeMemstatsSysDataPoint adds a data point to process.runtime.memstats.sys metric.
func (*MetricsBuilder) RecordProcessRuntimeMemstatsTotalAllocDataPoint ¶
func (mb *MetricsBuilder) RecordProcessRuntimeMemstatsTotalAllocDataPoint(ts pcommon.Timestamp, val int64)
RecordProcessRuntimeMemstatsTotalAllocDataPoint adds a data point to process.runtime.memstats.total_alloc 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 { ProcessRuntimeMemstatsBuckHashSys MetricSettings `mapstructure:"process.runtime.memstats.buck_hash_sys"` ProcessRuntimeMemstatsFrees MetricSettings `mapstructure:"process.runtime.memstats.frees"` ProcessRuntimeMemstatsGcCPUFraction MetricSettings `mapstructure:"process.runtime.memstats.gc_cpu_fraction"` ProcessRuntimeMemstatsGcSys MetricSettings `mapstructure:"process.runtime.memstats.gc_sys"` ProcessRuntimeMemstatsHeapAlloc MetricSettings `mapstructure:"process.runtime.memstats.heap_alloc"` ProcessRuntimeMemstatsHeapIdle MetricSettings `mapstructure:"process.runtime.memstats.heap_idle"` ProcessRuntimeMemstatsHeapInuse MetricSettings `mapstructure:"process.runtime.memstats.heap_inuse"` ProcessRuntimeMemstatsHeapObjects MetricSettings `mapstructure:"process.runtime.memstats.heap_objects"` ProcessRuntimeMemstatsHeapReleased MetricSettings `mapstructure:"process.runtime.memstats.heap_released"` ProcessRuntimeMemstatsHeapSys MetricSettings `mapstructure:"process.runtime.memstats.heap_sys"` ProcessRuntimeMemstatsLastPause MetricSettings `mapstructure:"process.runtime.memstats.last_pause"` ProcessRuntimeMemstatsLookups MetricSettings `mapstructure:"process.runtime.memstats.lookups"` ProcessRuntimeMemstatsMallocs MetricSettings `mapstructure:"process.runtime.memstats.mallocs"` ProcessRuntimeMemstatsMcacheInuse MetricSettings `mapstructure:"process.runtime.memstats.mcache_inuse"` ProcessRuntimeMemstatsMcacheSys MetricSettings `mapstructure:"process.runtime.memstats.mcache_sys"` ProcessRuntimeMemstatsMspanInuse MetricSettings `mapstructure:"process.runtime.memstats.mspan_inuse"` ProcessRuntimeMemstatsMspanSys MetricSettings `mapstructure:"process.runtime.memstats.mspan_sys"` ProcessRuntimeMemstatsNextGc MetricSettings `mapstructure:"process.runtime.memstats.next_gc"` ProcessRuntimeMemstatsNumForcedGc MetricSettings `mapstructure:"process.runtime.memstats.num_forced_gc"` ProcessRuntimeMemstatsNumGc MetricSettings `mapstructure:"process.runtime.memstats.num_gc"` ProcessRuntimeMemstatsOtherSys MetricSettings `mapstructure:"process.runtime.memstats.other_sys"` ProcessRuntimeMemstatsPauseTotal MetricSettings `mapstructure:"process.runtime.memstats.pause_total"` ProcessRuntimeMemstatsStackInuse MetricSettings `mapstructure:"process.runtime.memstats.stack_inuse"` ProcessRuntimeMemstatsStackSys MetricSettings `mapstructure:"process.runtime.memstats.stack_sys"` ProcessRuntimeMemstatsSys MetricSettings `mapstructure:"process.runtime.memstats.sys"` ProcessRuntimeMemstatsTotalAlloc MetricSettings `mapstructure:"process.runtime.memstats.total_alloc"` }
MetricsSettings provides settings for expvarreceiver metrics.
func DefaultMetricsSettings ¶
func DefaultMetricsSettings() MetricsSettings
type ResourceMetricsOption ¶
type ResourceMetricsOption func(pmetric.ResourceMetrics)
ResourceMetricsOption applies changes to provided resource metrics.
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.