metadata

package
v0.97.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetricsStability = component.StabilityLevelAlpha
)

Variables

View Source
var (
	Type = component.MustNewType("oracledb")
)

Functions

func Meter added in v0.92.0

func Meter(settings component.TelemetrySettings) metric.Meter

func Tracer added in v0.92.0

func Tracer(settings component.TelemetrySettings) trace.Tracer

func WithStartTime

func WithStartTime(startTime pcommon.Timestamp) metricBuilderOption

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.

func (*MetricConfig) Unmarshal added in v0.77.0

func (ms *MetricConfig) Unmarshal(parser *confmap.Conf) error

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

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.

func (*ResourceAttributeConfig) Unmarshal added in v0.87.0

func (rac *ResourceAttributeConfig) Unmarshal(parser *confmap.Conf) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL