Documentation ¶
Index ¶
- Constants
- Variables
- type MetricBuilderOption
- type MetricConfig
- type MetricsBuilder
- func (mb *MetricsBuilder) Emit(options ...ResourceMetricsOption) pmetric.Metrics
- func (mb *MetricsBuilder) EmitForResource(options ...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 MetricsBuilderConfig
- type MetricsConfig
- type ResourceMetricsOption
Constants ¶
const (
MetricsStability = component.StabilityLevelAlpha
)
Variables ¶
var ( Type = component.MustNewType("expvar") ScopeName = "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/expvarreceiver" )
Functions ¶
This section is empty.
Types ¶
type MetricBuilderOption ¶ added in v0.110.0
type MetricBuilderOption interface {
// contains filtered or unexported methods
}
MetricBuilderOption applies changes to default metrics builder.
func WithStartTime ¶
func WithStartTime(startTime pcommon.Timestamp) MetricBuilderOption
WithStartTime sets startTime on the metrics builder.
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.
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.Settings, options ...MetricBuilderOption) *MetricsBuilder
func (*MetricsBuilder) Emit ¶
func (mb *MetricsBuilder) Emit(options ...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 config, e.g. delta or cumulative.
func (*MetricsBuilder) EmitForResource ¶
func (mb *MetricsBuilder) EmitForResource(options ...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 MetricsBuilderConfig ¶ added in v0.73.0
type MetricsBuilderConfig struct {
Metrics MetricsConfig `mapstructure:"metrics"`
}
MetricsBuilderConfig is a configuration for expvar metrics builder.
func DefaultMetricsBuilderConfig ¶ added in v0.73.0
func DefaultMetricsBuilderConfig() MetricsBuilderConfig
type MetricsConfig ¶ added in v0.77.0
type MetricsConfig struct { ProcessRuntimeMemstatsBuckHashSys MetricConfig `mapstructure:"process.runtime.memstats.buck_hash_sys"` ProcessRuntimeMemstatsFrees MetricConfig `mapstructure:"process.runtime.memstats.frees"` ProcessRuntimeMemstatsGcCPUFraction MetricConfig `mapstructure:"process.runtime.memstats.gc_cpu_fraction"` ProcessRuntimeMemstatsGcSys MetricConfig `mapstructure:"process.runtime.memstats.gc_sys"` ProcessRuntimeMemstatsHeapAlloc MetricConfig `mapstructure:"process.runtime.memstats.heap_alloc"` ProcessRuntimeMemstatsHeapIdle MetricConfig `mapstructure:"process.runtime.memstats.heap_idle"` ProcessRuntimeMemstatsHeapInuse MetricConfig `mapstructure:"process.runtime.memstats.heap_inuse"` ProcessRuntimeMemstatsHeapObjects MetricConfig `mapstructure:"process.runtime.memstats.heap_objects"` ProcessRuntimeMemstatsHeapReleased MetricConfig `mapstructure:"process.runtime.memstats.heap_released"` ProcessRuntimeMemstatsHeapSys MetricConfig `mapstructure:"process.runtime.memstats.heap_sys"` ProcessRuntimeMemstatsLastPause MetricConfig `mapstructure:"process.runtime.memstats.last_pause"` ProcessRuntimeMemstatsLookups MetricConfig `mapstructure:"process.runtime.memstats.lookups"` ProcessRuntimeMemstatsMallocs MetricConfig `mapstructure:"process.runtime.memstats.mallocs"` ProcessRuntimeMemstatsMcacheInuse MetricConfig `mapstructure:"process.runtime.memstats.mcache_inuse"` ProcessRuntimeMemstatsMcacheSys MetricConfig `mapstructure:"process.runtime.memstats.mcache_sys"` ProcessRuntimeMemstatsMspanInuse MetricConfig `mapstructure:"process.runtime.memstats.mspan_inuse"` ProcessRuntimeMemstatsMspanSys MetricConfig `mapstructure:"process.runtime.memstats.mspan_sys"` ProcessRuntimeMemstatsNextGc MetricConfig `mapstructure:"process.runtime.memstats.next_gc"` ProcessRuntimeMemstatsNumForcedGc MetricConfig `mapstructure:"process.runtime.memstats.num_forced_gc"` ProcessRuntimeMemstatsNumGc MetricConfig `mapstructure:"process.runtime.memstats.num_gc"` ProcessRuntimeMemstatsOtherSys MetricConfig `mapstructure:"process.runtime.memstats.other_sys"` ProcessRuntimeMemstatsPauseTotal MetricConfig `mapstructure:"process.runtime.memstats.pause_total"` ProcessRuntimeMemstatsStackInuse MetricConfig `mapstructure:"process.runtime.memstats.stack_inuse"` ProcessRuntimeMemstatsStackSys MetricConfig `mapstructure:"process.runtime.memstats.stack_sys"` ProcessRuntimeMemstatsSys MetricConfig `mapstructure:"process.runtime.memstats.sys"` ProcessRuntimeMemstatsTotalAlloc MetricConfig `mapstructure:"process.runtime.memstats.total_alloc"` }
MetricsConfig provides config for expvar metrics.
func DefaultMetricsConfig ¶ added in v0.77.0
func DefaultMetricsConfig() MetricsConfig
type ResourceMetricsOption ¶
type ResourceMetricsOption interface {
// contains filtered or unexported methods
}
ResourceMetricsOption applies changes to provided resource metrics.
func WithResource ¶ added in v0.82.0
func WithResource(res pcommon.Resource) ResourceMetricsOption
WithResource sets the provided resource on the emitted ResourceMetrics. It's recommended to use ResourceBuilder to create the 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.