Documentation ¶
Index ¶
- Constants
- Variables
- func Meter(settings component.TelemetrySettings) metric.Meter
- func Tracer(settings component.TelemetrySettings) trace.Tracer
- func WithStartTime(startTime pcommon.Timestamp) metricBuilderOption
- type MetricConfig
- type MetricsBuilder
- func (mb *MetricsBuilder) Emit(rmo ...ResourceMetricsOption) pmetric.Metrics
- func (mb *MetricsBuilder) EmitForResource(rmo ...ResourceMetricsOption)
- func (mb *MetricsBuilder) NewResourceBuilder() *ResourceBuilder
- func (mb *MetricsBuilder) RecordOracledbCPUTimeDataPoint(ts pcommon.Timestamp, val float64)
- func (mb *MetricsBuilder) RecordOracledbConsistentGetsDataPoint(ts pcommon.Timestamp, inputVal string) error
- func (mb *MetricsBuilder) RecordOracledbDbBlockGetsDataPoint(ts pcommon.Timestamp, inputVal string) error
- func (mb *MetricsBuilder) RecordOracledbDmlLocksLimitDataPoint(ts pcommon.Timestamp, inputVal string) error
- func (mb *MetricsBuilder) RecordOracledbDmlLocksUsageDataPoint(ts pcommon.Timestamp, inputVal string) error
- func (mb *MetricsBuilder) RecordOracledbEnqueueDeadlocksDataPoint(ts pcommon.Timestamp, inputVal string) error
- func (mb *MetricsBuilder) RecordOracledbEnqueueLocksLimitDataPoint(ts pcommon.Timestamp, inputVal string) error
- func (mb *MetricsBuilder) RecordOracledbEnqueueLocksUsageDataPoint(ts pcommon.Timestamp, inputVal string) error
- func (mb *MetricsBuilder) RecordOracledbEnqueueResourcesLimitDataPoint(ts pcommon.Timestamp, inputVal string) error
- func (mb *MetricsBuilder) RecordOracledbEnqueueResourcesUsageDataPoint(ts pcommon.Timestamp, inputVal string) error
- func (mb *MetricsBuilder) RecordOracledbExchangeDeadlocksDataPoint(ts pcommon.Timestamp, inputVal string) error
- func (mb *MetricsBuilder) RecordOracledbExecutionsDataPoint(ts pcommon.Timestamp, inputVal string) error
- func (mb *MetricsBuilder) RecordOracledbHardParsesDataPoint(ts pcommon.Timestamp, inputVal string) error
- func (mb *MetricsBuilder) RecordOracledbLogicalReadsDataPoint(ts pcommon.Timestamp, inputVal string) error
- func (mb *MetricsBuilder) RecordOracledbParseCallsDataPoint(ts pcommon.Timestamp, inputVal string) error
- func (mb *MetricsBuilder) RecordOracledbPgaMemoryDataPoint(ts pcommon.Timestamp, inputVal string) error
- func (mb *MetricsBuilder) RecordOracledbPhysicalReadsDataPoint(ts pcommon.Timestamp, inputVal string) error
- func (mb *MetricsBuilder) RecordOracledbProcessesLimitDataPoint(ts pcommon.Timestamp, inputVal string) error
- func (mb *MetricsBuilder) RecordOracledbProcessesUsageDataPoint(ts pcommon.Timestamp, inputVal string) error
- func (mb *MetricsBuilder) RecordOracledbSessionsLimitDataPoint(ts pcommon.Timestamp, inputVal string) error
- func (mb *MetricsBuilder) RecordOracledbSessionsUsageDataPoint(ts pcommon.Timestamp, inputVal string, sessionTypeAttributeValue string, ...) error
- func (mb *MetricsBuilder) RecordOracledbTablespaceSizeLimitDataPoint(ts pcommon.Timestamp, val int64, tablespaceNameAttributeValue string)
- func (mb *MetricsBuilder) RecordOracledbTablespaceSizeUsageDataPoint(ts pcommon.Timestamp, inputVal string, tablespaceNameAttributeValue string) error
- func (mb *MetricsBuilder) RecordOracledbTransactionsLimitDataPoint(ts pcommon.Timestamp, inputVal string) error
- func (mb *MetricsBuilder) RecordOracledbTransactionsUsageDataPoint(ts pcommon.Timestamp, inputVal string) error
- func (mb *MetricsBuilder) RecordOracledbUserCommitsDataPoint(ts pcommon.Timestamp, inputVal string) error
- func (mb *MetricsBuilder) RecordOracledbUserRollbacksDataPoint(ts pcommon.Timestamp, inputVal string) error
- func (mb *MetricsBuilder) Reset(options ...metricBuilderOption)
- type MetricsBuilderConfig
- type MetricsConfig
- type ResourceAttributeConfig
- type ResourceAttributesConfig
- type ResourceBuilder
- type ResourceMetricsOption
Constants ¶
const (
MetricsStability = component.StabilityLevelAlpha
)
Variables ¶
var (
Type = component.MustNewType("oracledb")
)
Functions ¶
func WithStartTime ¶
WithStartTime sets startTime on the metrics builder.
Types ¶
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.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 config, 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) NewResourceBuilder ¶ added in v0.83.0
func (mb *MetricsBuilder) NewResourceBuilder() *ResourceBuilder
NewResourceBuilder returns a new resource builder that should be used to build a resource associated with for the emitted metrics.
func (*MetricsBuilder) RecordOracledbCPUTimeDataPoint ¶
func (mb *MetricsBuilder) RecordOracledbCPUTimeDataPoint(ts pcommon.Timestamp, val float64)
RecordOracledbCPUTimeDataPoint adds a data point to oracledb.cpu_time metric.
func (*MetricsBuilder) RecordOracledbConsistentGetsDataPoint ¶ added in v0.78.0
func (mb *MetricsBuilder) RecordOracledbConsistentGetsDataPoint(ts pcommon.Timestamp, inputVal string) error
RecordOracledbConsistentGetsDataPoint adds a data point to oracledb.consistent_gets metric.
func (*MetricsBuilder) RecordOracledbDbBlockGetsDataPoint ¶ added in v0.78.0
func (mb *MetricsBuilder) RecordOracledbDbBlockGetsDataPoint(ts pcommon.Timestamp, inputVal string) error
RecordOracledbDbBlockGetsDataPoint adds a data point to oracledb.db_block_gets metric.
func (*MetricsBuilder) RecordOracledbDmlLocksLimitDataPoint ¶
func (mb *MetricsBuilder) RecordOracledbDmlLocksLimitDataPoint(ts pcommon.Timestamp, inputVal string) error
RecordOracledbDmlLocksLimitDataPoint adds a data point to oracledb.dml_locks.limit metric.
func (*MetricsBuilder) RecordOracledbDmlLocksUsageDataPoint ¶
func (mb *MetricsBuilder) RecordOracledbDmlLocksUsageDataPoint(ts pcommon.Timestamp, inputVal string) error
RecordOracledbDmlLocksUsageDataPoint adds a data point to oracledb.dml_locks.usage metric.
func (*MetricsBuilder) RecordOracledbEnqueueDeadlocksDataPoint ¶
func (mb *MetricsBuilder) RecordOracledbEnqueueDeadlocksDataPoint(ts pcommon.Timestamp, inputVal string) error
RecordOracledbEnqueueDeadlocksDataPoint adds a data point to oracledb.enqueue_deadlocks metric.
func (*MetricsBuilder) RecordOracledbEnqueueLocksLimitDataPoint ¶
func (mb *MetricsBuilder) RecordOracledbEnqueueLocksLimitDataPoint(ts pcommon.Timestamp, inputVal string) error
RecordOracledbEnqueueLocksLimitDataPoint adds a data point to oracledb.enqueue_locks.limit metric.
func (*MetricsBuilder) RecordOracledbEnqueueLocksUsageDataPoint ¶
func (mb *MetricsBuilder) RecordOracledbEnqueueLocksUsageDataPoint(ts pcommon.Timestamp, inputVal string) error
RecordOracledbEnqueueLocksUsageDataPoint adds a data point to oracledb.enqueue_locks.usage metric.
func (*MetricsBuilder) RecordOracledbEnqueueResourcesLimitDataPoint ¶
func (mb *MetricsBuilder) RecordOracledbEnqueueResourcesLimitDataPoint(ts pcommon.Timestamp, inputVal string) error
RecordOracledbEnqueueResourcesLimitDataPoint adds a data point to oracledb.enqueue_resources.limit metric.
func (*MetricsBuilder) RecordOracledbEnqueueResourcesUsageDataPoint ¶
func (mb *MetricsBuilder) RecordOracledbEnqueueResourcesUsageDataPoint(ts pcommon.Timestamp, inputVal string) error
RecordOracledbEnqueueResourcesUsageDataPoint adds a data point to oracledb.enqueue_resources.usage metric.
func (*MetricsBuilder) RecordOracledbExchangeDeadlocksDataPoint ¶
func (mb *MetricsBuilder) RecordOracledbExchangeDeadlocksDataPoint(ts pcommon.Timestamp, inputVal string) error
RecordOracledbExchangeDeadlocksDataPoint adds a data point to oracledb.exchange_deadlocks metric.
func (*MetricsBuilder) RecordOracledbExecutionsDataPoint ¶
func (mb *MetricsBuilder) RecordOracledbExecutionsDataPoint(ts pcommon.Timestamp, inputVal string) error
RecordOracledbExecutionsDataPoint adds a data point to oracledb.executions metric.
func (*MetricsBuilder) RecordOracledbHardParsesDataPoint ¶
func (mb *MetricsBuilder) RecordOracledbHardParsesDataPoint(ts pcommon.Timestamp, inputVal string) error
RecordOracledbHardParsesDataPoint adds a data point to oracledb.hard_parses metric.
func (*MetricsBuilder) RecordOracledbLogicalReadsDataPoint ¶
func (mb *MetricsBuilder) RecordOracledbLogicalReadsDataPoint(ts pcommon.Timestamp, inputVal string) error
RecordOracledbLogicalReadsDataPoint adds a data point to oracledb.logical_reads metric.
func (*MetricsBuilder) RecordOracledbParseCallsDataPoint ¶
func (mb *MetricsBuilder) RecordOracledbParseCallsDataPoint(ts pcommon.Timestamp, inputVal string) error
RecordOracledbParseCallsDataPoint adds a data point to oracledb.parse_calls metric.
func (*MetricsBuilder) RecordOracledbPgaMemoryDataPoint ¶
func (mb *MetricsBuilder) RecordOracledbPgaMemoryDataPoint(ts pcommon.Timestamp, inputVal string) error
RecordOracledbPgaMemoryDataPoint adds a data point to oracledb.pga_memory metric.
func (*MetricsBuilder) RecordOracledbPhysicalReadsDataPoint ¶
func (mb *MetricsBuilder) RecordOracledbPhysicalReadsDataPoint(ts pcommon.Timestamp, inputVal string) error
RecordOracledbPhysicalReadsDataPoint adds a data point to oracledb.physical_reads metric.
func (*MetricsBuilder) RecordOracledbProcessesLimitDataPoint ¶
func (mb *MetricsBuilder) RecordOracledbProcessesLimitDataPoint(ts pcommon.Timestamp, inputVal string) error
RecordOracledbProcessesLimitDataPoint adds a data point to oracledb.processes.limit metric.
func (*MetricsBuilder) RecordOracledbProcessesUsageDataPoint ¶
func (mb *MetricsBuilder) RecordOracledbProcessesUsageDataPoint(ts pcommon.Timestamp, inputVal string) error
RecordOracledbProcessesUsageDataPoint adds a data point to oracledb.processes.usage metric.
func (*MetricsBuilder) RecordOracledbSessionsLimitDataPoint ¶
func (mb *MetricsBuilder) RecordOracledbSessionsLimitDataPoint(ts pcommon.Timestamp, inputVal string) error
RecordOracledbSessionsLimitDataPoint adds a data point to oracledb.sessions.limit metric.
func (*MetricsBuilder) RecordOracledbSessionsUsageDataPoint ¶
func (mb *MetricsBuilder) RecordOracledbSessionsUsageDataPoint(ts pcommon.Timestamp, inputVal string, sessionTypeAttributeValue string, sessionStatusAttributeValue string) error
RecordOracledbSessionsUsageDataPoint adds a data point to oracledb.sessions.usage metric.
func (*MetricsBuilder) RecordOracledbTablespaceSizeLimitDataPoint ¶
func (mb *MetricsBuilder) RecordOracledbTablespaceSizeLimitDataPoint(ts pcommon.Timestamp, val int64, tablespaceNameAttributeValue string)
RecordOracledbTablespaceSizeLimitDataPoint adds a data point to oracledb.tablespace_size.limit metric.
func (*MetricsBuilder) RecordOracledbTablespaceSizeUsageDataPoint ¶
func (mb *MetricsBuilder) RecordOracledbTablespaceSizeUsageDataPoint(ts pcommon.Timestamp, inputVal string, tablespaceNameAttributeValue string) error
RecordOracledbTablespaceSizeUsageDataPoint adds a data point to oracledb.tablespace_size.usage metric.
func (*MetricsBuilder) RecordOracledbTransactionsLimitDataPoint ¶
func (mb *MetricsBuilder) RecordOracledbTransactionsLimitDataPoint(ts pcommon.Timestamp, inputVal string) error
RecordOracledbTransactionsLimitDataPoint adds a data point to oracledb.transactions.limit metric.
func (*MetricsBuilder) RecordOracledbTransactionsUsageDataPoint ¶
func (mb *MetricsBuilder) RecordOracledbTransactionsUsageDataPoint(ts pcommon.Timestamp, inputVal string) error
RecordOracledbTransactionsUsageDataPoint adds a data point to oracledb.transactions.usage metric.
func (*MetricsBuilder) RecordOracledbUserCommitsDataPoint ¶
func (mb *MetricsBuilder) RecordOracledbUserCommitsDataPoint(ts pcommon.Timestamp, inputVal string) error
RecordOracledbUserCommitsDataPoint adds a data point to oracledb.user_commits metric.
func (*MetricsBuilder) RecordOracledbUserRollbacksDataPoint ¶
func (mb *MetricsBuilder) RecordOracledbUserRollbacksDataPoint(ts pcommon.Timestamp, inputVal string) error
RecordOracledbUserRollbacksDataPoint adds a data point to oracledb.user_rollbacks 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"` ResourceAttributes ResourceAttributesConfig `mapstructure:"resource_attributes"` }
MetricsBuilderConfig is a configuration for oracledb metrics builder.
func DefaultMetricsBuilderConfig ¶ added in v0.73.0
func DefaultMetricsBuilderConfig() MetricsBuilderConfig
type MetricsConfig ¶ added in v0.77.0
type MetricsConfig struct { OracledbConsistentGets MetricConfig `mapstructure:"oracledb.consistent_gets"` OracledbCPUTime MetricConfig `mapstructure:"oracledb.cpu_time"` OracledbDbBlockGets MetricConfig `mapstructure:"oracledb.db_block_gets"` OracledbDmlLocksLimit MetricConfig `mapstructure:"oracledb.dml_locks.limit"` OracledbDmlLocksUsage MetricConfig `mapstructure:"oracledb.dml_locks.usage"` OracledbEnqueueDeadlocks MetricConfig `mapstructure:"oracledb.enqueue_deadlocks"` OracledbEnqueueLocksLimit MetricConfig `mapstructure:"oracledb.enqueue_locks.limit"` OracledbEnqueueLocksUsage MetricConfig `mapstructure:"oracledb.enqueue_locks.usage"` OracledbEnqueueResourcesLimit MetricConfig `mapstructure:"oracledb.enqueue_resources.limit"` OracledbEnqueueResourcesUsage MetricConfig `mapstructure:"oracledb.enqueue_resources.usage"` OracledbExchangeDeadlocks MetricConfig `mapstructure:"oracledb.exchange_deadlocks"` OracledbExecutions MetricConfig `mapstructure:"oracledb.executions"` OracledbHardParses MetricConfig `mapstructure:"oracledb.hard_parses"` OracledbLogicalReads MetricConfig `mapstructure:"oracledb.logical_reads"` OracledbParseCalls MetricConfig `mapstructure:"oracledb.parse_calls"` OracledbPgaMemory MetricConfig `mapstructure:"oracledb.pga_memory"` OracledbPhysicalReads MetricConfig `mapstructure:"oracledb.physical_reads"` OracledbProcessesLimit MetricConfig `mapstructure:"oracledb.processes.limit"` OracledbProcessesUsage MetricConfig `mapstructure:"oracledb.processes.usage"` OracledbSessionsLimit MetricConfig `mapstructure:"oracledb.sessions.limit"` OracledbSessionsUsage MetricConfig `mapstructure:"oracledb.sessions.usage"` OracledbTablespaceSizeLimit MetricConfig `mapstructure:"oracledb.tablespace_size.limit"` OracledbTablespaceSizeUsage MetricConfig `mapstructure:"oracledb.tablespace_size.usage"` OracledbTransactionsLimit MetricConfig `mapstructure:"oracledb.transactions.limit"` OracledbTransactionsUsage MetricConfig `mapstructure:"oracledb.transactions.usage"` OracledbUserCommits MetricConfig `mapstructure:"oracledb.user_commits"` OracledbUserRollbacks MetricConfig `mapstructure:"oracledb.user_rollbacks"` }
MetricsConfig provides config for oracledb metrics.
func DefaultMetricsConfig ¶ added in v0.77.0
func DefaultMetricsConfig() MetricsConfig
type ResourceAttributeConfig ¶ added in v0.77.0
type ResourceAttributeConfig struct { Enabled bool `mapstructure:"enabled"` // contains filtered or unexported fields }
ResourceAttributeConfig provides common config for a particular resource attribute.
type ResourceAttributesConfig ¶ added in v0.77.0
type ResourceAttributesConfig struct {
OracledbInstanceName ResourceAttributeConfig `mapstructure:"oracledb.instance.name"`
}
ResourceAttributesConfig provides config for oracledb resource attributes.
func DefaultResourceAttributesConfig ¶ added in v0.77.0
func DefaultResourceAttributesConfig() ResourceAttributesConfig
type ResourceBuilder ¶ added in v0.82.0
type ResourceBuilder struct {
// contains filtered or unexported fields
}
ResourceBuilder is a helper struct to build resources predefined in metadata.yaml. The ResourceBuilder is not thread-safe and must not to be used in multiple goroutines.
func NewResourceBuilder ¶ added in v0.82.0
func NewResourceBuilder(rac ResourceAttributesConfig) *ResourceBuilder
NewResourceBuilder creates a new ResourceBuilder. This method should be called on the start of the application.
func (*ResourceBuilder) Emit ¶ added in v0.82.0
func (rb *ResourceBuilder) Emit() pcommon.Resource
Emit returns the built resource and resets the internal builder state.
func (*ResourceBuilder) SetOracledbInstanceName ¶ added in v0.82.0
func (rb *ResourceBuilder) SetOracledbInstanceName(val string)
SetOracledbInstanceName sets provided value as "oracledb.instance.name" attribute.
type ResourceMetricsOption ¶
type ResourceMetricsOption func(pmetric.ResourceMetrics)
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.