Documentation
¶
Index ¶
- Constants
- Variables
- type AttributeDatabaseStatus
- type AttributeDirection
- type AttributePageOperations
- type MetricBuilderOption
- type MetricConfig
- type MetricsBuilder
- func (mb *MetricsBuilder) Emit(options ...ResourceMetricsOption) pmetric.Metrics
- func (mb *MetricsBuilder) EmitForResource(options ...ResourceMetricsOption)
- func (mb *MetricsBuilder) NewResourceBuilder() *ResourceBuilder
- func (mb *MetricsBuilder) RecordSqlserverBatchRequestRateDataPoint(ts pcommon.Timestamp, val float64)
- func (mb *MetricsBuilder) RecordSqlserverBatchSQLCompilationRateDataPoint(ts pcommon.Timestamp, val float64)
- func (mb *MetricsBuilder) RecordSqlserverBatchSQLRecompilationRateDataPoint(ts pcommon.Timestamp, val float64)
- func (mb *MetricsBuilder) RecordSqlserverDatabaseCountDataPoint(ts pcommon.Timestamp, inputVal string, ...) error
- func (mb *MetricsBuilder) RecordSqlserverDatabaseIoDataPoint(ts pcommon.Timestamp, inputVal string, physicalFilenameAttributeValue string, ...) error
- func (mb *MetricsBuilder) RecordSqlserverDatabaseLatencyDataPoint(ts pcommon.Timestamp, val float64, physicalFilenameAttributeValue string, ...)
- func (mb *MetricsBuilder) RecordSqlserverDatabaseOperationsDataPoint(ts pcommon.Timestamp, inputVal string, physicalFilenameAttributeValue string, ...) error
- func (mb *MetricsBuilder) RecordSqlserverLockWaitRateDataPoint(ts pcommon.Timestamp, val float64)
- func (mb *MetricsBuilder) RecordSqlserverLockWaitTimeAvgDataPoint(ts pcommon.Timestamp, val float64)
- func (mb *MetricsBuilder) RecordSqlserverPageBufferCacheHitRatioDataPoint(ts pcommon.Timestamp, val float64)
- func (mb *MetricsBuilder) RecordSqlserverPageCheckpointFlushRateDataPoint(ts pcommon.Timestamp, val float64)
- func (mb *MetricsBuilder) RecordSqlserverPageLazyWriteRateDataPoint(ts pcommon.Timestamp, val float64)
- func (mb *MetricsBuilder) RecordSqlserverPageLifeExpectancyDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordSqlserverPageOperationRateDataPoint(ts pcommon.Timestamp, val float64, ...)
- func (mb *MetricsBuilder) RecordSqlserverPageSplitRateDataPoint(ts pcommon.Timestamp, val float64)
- func (mb *MetricsBuilder) RecordSqlserverProcessesBlockedDataPoint(ts pcommon.Timestamp, inputVal string) error
- func (mb *MetricsBuilder) RecordSqlserverResourcePoolDiskThrottledReadRateDataPoint(ts pcommon.Timestamp, inputVal string) error
- func (mb *MetricsBuilder) RecordSqlserverResourcePoolDiskThrottledWriteRateDataPoint(ts pcommon.Timestamp, inputVal string) error
- func (mb *MetricsBuilder) RecordSqlserverTransactionLogFlushDataRateDataPoint(ts pcommon.Timestamp, val float64)
- func (mb *MetricsBuilder) RecordSqlserverTransactionLogFlushRateDataPoint(ts pcommon.Timestamp, val float64)
- func (mb *MetricsBuilder) RecordSqlserverTransactionLogFlushWaitRateDataPoint(ts pcommon.Timestamp, val float64)
- func (mb *MetricsBuilder) RecordSqlserverTransactionLogGrowthCountDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordSqlserverTransactionLogShrinkCountDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordSqlserverTransactionLogUsageDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordSqlserverTransactionRateDataPoint(ts pcommon.Timestamp, val float64)
- func (mb *MetricsBuilder) RecordSqlserverTransactionWriteRateDataPoint(ts pcommon.Timestamp, val float64)
- func (mb *MetricsBuilder) RecordSqlserverUserConnectionCountDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) Reset(options ...MetricBuilderOption)
- type MetricsBuilderConfig
- type MetricsConfig
- type ResourceAttributeConfig
- type ResourceAttributesConfig
- type ResourceBuilder
- type ResourceMetricsOption
Constants ¶
const (
MetricsStability = component.StabilityLevelBeta
)
Variables ¶
var ( Type = component.MustNewType("sqlserver") ScopeName = "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/sqlserverreceiver" )
var MapAttributeDatabaseStatus = map[string]AttributeDatabaseStatus{ "online": AttributeDatabaseStatusOnline, "restoring": AttributeDatabaseStatusRestoring, "recovering": AttributeDatabaseStatusRecovering, "pending_recovery": AttributeDatabaseStatusPendingRecovery, "suspect": AttributeDatabaseStatusSuspect, "offline": AttributeDatabaseStatusOffline, }
MapAttributeDatabaseStatus is a helper map of string to AttributeDatabaseStatus attribute value.
var MapAttributeDirection = map[string]AttributeDirection{ "read": AttributeDirectionRead, "write": AttributeDirectionWrite, }
MapAttributeDirection is a helper map of string to AttributeDirection attribute value.
var MapAttributePageOperations = map[string]AttributePageOperations{ "read": AttributePageOperationsRead, "write": AttributePageOperationsWrite, }
MapAttributePageOperations is a helper map of string to AttributePageOperations attribute value.
Functions ¶
This section is empty.
Types ¶
type AttributeDatabaseStatus ¶ added in v0.101.0
type AttributeDatabaseStatus int
AttributeDatabaseStatus specifies the a value database.status attribute.
const ( AttributeDatabaseStatusOnline AttributeDatabaseStatus AttributeDatabaseStatusRestoring AttributeDatabaseStatusRecovering AttributeDatabaseStatusPendingRecovery AttributeDatabaseStatusSuspect AttributeDatabaseStatusOffline )
func (AttributeDatabaseStatus) String ¶ added in v0.101.0
func (av AttributeDatabaseStatus) String() string
String returns the string representation of the AttributeDatabaseStatus.
type AttributeDirection ¶ added in v0.103.0
type AttributeDirection int
AttributeDirection specifies the a value direction attribute.
const ( AttributeDirectionRead AttributeDirection AttributeDirectionWrite )
func (AttributeDirection) String ¶ added in v0.103.0
func (av AttributeDirection) String() string
String returns the string representation of the AttributeDirection.
type AttributePageOperations ¶
type AttributePageOperations int
AttributePageOperations specifies the a value page.operations attribute.
const ( AttributePageOperationsRead AttributePageOperations AttributePageOperationsWrite )
func (AttributePageOperations) String ¶ added in v0.51.0
func (av AttributePageOperations) String() string
String returns the string representation of the AttributePageOperations.
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) 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) RecordSqlserverBatchRequestRateDataPoint ¶
func (mb *MetricsBuilder) RecordSqlserverBatchRequestRateDataPoint(ts pcommon.Timestamp, val float64)
RecordSqlserverBatchRequestRateDataPoint adds a data point to sqlserver.batch.request.rate metric.
func (*MetricsBuilder) RecordSqlserverBatchSQLCompilationRateDataPoint ¶
func (mb *MetricsBuilder) RecordSqlserverBatchSQLCompilationRateDataPoint(ts pcommon.Timestamp, val float64)
RecordSqlserverBatchSQLCompilationRateDataPoint adds a data point to sqlserver.batch.sql_compilation.rate metric.
func (*MetricsBuilder) RecordSqlserverBatchSQLRecompilationRateDataPoint ¶
func (mb *MetricsBuilder) RecordSqlserverBatchSQLRecompilationRateDataPoint(ts pcommon.Timestamp, val float64)
RecordSqlserverBatchSQLRecompilationRateDataPoint adds a data point to sqlserver.batch.sql_recompilation.rate metric.
func (*MetricsBuilder) RecordSqlserverDatabaseCountDataPoint ¶ added in v0.101.0
func (mb *MetricsBuilder) RecordSqlserverDatabaseCountDataPoint(ts pcommon.Timestamp, inputVal string, databaseStatusAttributeValue AttributeDatabaseStatus) error
RecordSqlserverDatabaseCountDataPoint adds a data point to sqlserver.database.count metric.
func (*MetricsBuilder) RecordSqlserverDatabaseIoDataPoint ¶ added in v0.103.0
func (mb *MetricsBuilder) RecordSqlserverDatabaseIoDataPoint(ts pcommon.Timestamp, inputVal string, physicalFilenameAttributeValue string, logicalFilenameAttributeValue string, fileTypeAttributeValue string, directionAttributeValue AttributeDirection) error
RecordSqlserverDatabaseIoDataPoint adds a data point to sqlserver.database.io metric.
func (*MetricsBuilder) RecordSqlserverDatabaseLatencyDataPoint ¶ added in v0.103.0
func (mb *MetricsBuilder) RecordSqlserverDatabaseLatencyDataPoint(ts pcommon.Timestamp, val float64, physicalFilenameAttributeValue string, logicalFilenameAttributeValue string, fileTypeAttributeValue string, directionAttributeValue AttributeDirection)
RecordSqlserverDatabaseLatencyDataPoint adds a data point to sqlserver.database.latency metric.
func (*MetricsBuilder) RecordSqlserverDatabaseOperationsDataPoint ¶ added in v0.103.0
func (mb *MetricsBuilder) RecordSqlserverDatabaseOperationsDataPoint(ts pcommon.Timestamp, inputVal string, physicalFilenameAttributeValue string, logicalFilenameAttributeValue string, fileTypeAttributeValue string, directionAttributeValue AttributeDirection) error
RecordSqlserverDatabaseOperationsDataPoint adds a data point to sqlserver.database.operations metric.
func (*MetricsBuilder) RecordSqlserverLockWaitRateDataPoint ¶
func (mb *MetricsBuilder) RecordSqlserverLockWaitRateDataPoint(ts pcommon.Timestamp, val float64)
RecordSqlserverLockWaitRateDataPoint adds a data point to sqlserver.lock.wait.rate metric.
func (*MetricsBuilder) RecordSqlserverLockWaitTimeAvgDataPoint ¶
func (mb *MetricsBuilder) RecordSqlserverLockWaitTimeAvgDataPoint(ts pcommon.Timestamp, val float64)
RecordSqlserverLockWaitTimeAvgDataPoint adds a data point to sqlserver.lock.wait_time.avg metric.
func (*MetricsBuilder) RecordSqlserverPageBufferCacheHitRatioDataPoint ¶
func (mb *MetricsBuilder) RecordSqlserverPageBufferCacheHitRatioDataPoint(ts pcommon.Timestamp, val float64)
RecordSqlserverPageBufferCacheHitRatioDataPoint adds a data point to sqlserver.page.buffer_cache.hit_ratio metric.
func (*MetricsBuilder) RecordSqlserverPageCheckpointFlushRateDataPoint ¶
func (mb *MetricsBuilder) RecordSqlserverPageCheckpointFlushRateDataPoint(ts pcommon.Timestamp, val float64)
RecordSqlserverPageCheckpointFlushRateDataPoint adds a data point to sqlserver.page.checkpoint.flush.rate metric.
func (*MetricsBuilder) RecordSqlserverPageLazyWriteRateDataPoint ¶
func (mb *MetricsBuilder) RecordSqlserverPageLazyWriteRateDataPoint(ts pcommon.Timestamp, val float64)
RecordSqlserverPageLazyWriteRateDataPoint adds a data point to sqlserver.page.lazy_write.rate metric.
func (*MetricsBuilder) RecordSqlserverPageLifeExpectancyDataPoint ¶
func (mb *MetricsBuilder) RecordSqlserverPageLifeExpectancyDataPoint(ts pcommon.Timestamp, val int64)
RecordSqlserverPageLifeExpectancyDataPoint adds a data point to sqlserver.page.life_expectancy metric.
func (*MetricsBuilder) RecordSqlserverPageOperationRateDataPoint ¶
func (mb *MetricsBuilder) RecordSqlserverPageOperationRateDataPoint(ts pcommon.Timestamp, val float64, pageOperationsAttributeValue AttributePageOperations)
RecordSqlserverPageOperationRateDataPoint adds a data point to sqlserver.page.operation.rate metric.
func (*MetricsBuilder) RecordSqlserverPageSplitRateDataPoint ¶
func (mb *MetricsBuilder) RecordSqlserverPageSplitRateDataPoint(ts pcommon.Timestamp, val float64)
RecordSqlserverPageSplitRateDataPoint adds a data point to sqlserver.page.split.rate metric.
func (*MetricsBuilder) RecordSqlserverProcessesBlockedDataPoint ¶ added in v0.101.0
func (mb *MetricsBuilder) RecordSqlserverProcessesBlockedDataPoint(ts pcommon.Timestamp, inputVal string) error
RecordSqlserverProcessesBlockedDataPoint adds a data point to sqlserver.processes.blocked metric.
func (*MetricsBuilder) RecordSqlserverResourcePoolDiskThrottledReadRateDataPoint ¶ added in v0.101.0
func (mb *MetricsBuilder) RecordSqlserverResourcePoolDiskThrottledReadRateDataPoint(ts pcommon.Timestamp, inputVal string) error
RecordSqlserverResourcePoolDiskThrottledReadRateDataPoint adds a data point to sqlserver.resource_pool.disk.throttled.read.rate metric.
func (*MetricsBuilder) RecordSqlserverResourcePoolDiskThrottledWriteRateDataPoint ¶ added in v0.101.0
func (mb *MetricsBuilder) RecordSqlserverResourcePoolDiskThrottledWriteRateDataPoint(ts pcommon.Timestamp, inputVal string) error
RecordSqlserverResourcePoolDiskThrottledWriteRateDataPoint adds a data point to sqlserver.resource_pool.disk.throttled.write.rate metric.
func (*MetricsBuilder) RecordSqlserverTransactionLogFlushDataRateDataPoint ¶
func (mb *MetricsBuilder) RecordSqlserverTransactionLogFlushDataRateDataPoint(ts pcommon.Timestamp, val float64)
RecordSqlserverTransactionLogFlushDataRateDataPoint adds a data point to sqlserver.transaction_log.flush.data.rate metric.
func (*MetricsBuilder) RecordSqlserverTransactionLogFlushRateDataPoint ¶
func (mb *MetricsBuilder) RecordSqlserverTransactionLogFlushRateDataPoint(ts pcommon.Timestamp, val float64)
RecordSqlserverTransactionLogFlushRateDataPoint adds a data point to sqlserver.transaction_log.flush.rate metric.
func (*MetricsBuilder) RecordSqlserverTransactionLogFlushWaitRateDataPoint ¶
func (mb *MetricsBuilder) RecordSqlserverTransactionLogFlushWaitRateDataPoint(ts pcommon.Timestamp, val float64)
RecordSqlserverTransactionLogFlushWaitRateDataPoint adds a data point to sqlserver.transaction_log.flush.wait.rate metric.
func (*MetricsBuilder) RecordSqlserverTransactionLogGrowthCountDataPoint ¶
func (mb *MetricsBuilder) RecordSqlserverTransactionLogGrowthCountDataPoint(ts pcommon.Timestamp, val int64)
RecordSqlserverTransactionLogGrowthCountDataPoint adds a data point to sqlserver.transaction_log.growth.count metric.
func (*MetricsBuilder) RecordSqlserverTransactionLogShrinkCountDataPoint ¶
func (mb *MetricsBuilder) RecordSqlserverTransactionLogShrinkCountDataPoint(ts pcommon.Timestamp, val int64)
RecordSqlserverTransactionLogShrinkCountDataPoint adds a data point to sqlserver.transaction_log.shrink.count metric.
func (*MetricsBuilder) RecordSqlserverTransactionLogUsageDataPoint ¶
func (mb *MetricsBuilder) RecordSqlserverTransactionLogUsageDataPoint(ts pcommon.Timestamp, val int64)
RecordSqlserverTransactionLogUsageDataPoint adds a data point to sqlserver.transaction_log.usage metric.
func (*MetricsBuilder) RecordSqlserverTransactionRateDataPoint ¶
func (mb *MetricsBuilder) RecordSqlserverTransactionRateDataPoint(ts pcommon.Timestamp, val float64)
RecordSqlserverTransactionRateDataPoint adds a data point to sqlserver.transaction.rate metric.
func (*MetricsBuilder) RecordSqlserverTransactionWriteRateDataPoint ¶
func (mb *MetricsBuilder) RecordSqlserverTransactionWriteRateDataPoint(ts pcommon.Timestamp, val float64)
RecordSqlserverTransactionWriteRateDataPoint adds a data point to sqlserver.transaction.write.rate metric.
func (*MetricsBuilder) RecordSqlserverUserConnectionCountDataPoint ¶
func (mb *MetricsBuilder) RecordSqlserverUserConnectionCountDataPoint(ts pcommon.Timestamp, val int64)
RecordSqlserverUserConnectionCountDataPoint adds a data point to sqlserver.user.connection.count 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 sqlserver metrics builder.
func DefaultMetricsBuilderConfig ¶ added in v0.73.0
func DefaultMetricsBuilderConfig() MetricsBuilderConfig
type MetricsConfig ¶ added in v0.77.0
type MetricsConfig struct { SqlserverBatchRequestRate MetricConfig `mapstructure:"sqlserver.batch.request.rate"` SqlserverBatchSQLCompilationRate MetricConfig `mapstructure:"sqlserver.batch.sql_compilation.rate"` SqlserverBatchSQLRecompilationRate MetricConfig `mapstructure:"sqlserver.batch.sql_recompilation.rate"` SqlserverDatabaseCount MetricConfig `mapstructure:"sqlserver.database.count"` SqlserverDatabaseIo MetricConfig `mapstructure:"sqlserver.database.io"` SqlserverDatabaseLatency MetricConfig `mapstructure:"sqlserver.database.latency"` SqlserverDatabaseOperations MetricConfig `mapstructure:"sqlserver.database.operations"` SqlserverLockWaitRate MetricConfig `mapstructure:"sqlserver.lock.wait.rate"` SqlserverLockWaitTimeAvg MetricConfig `mapstructure:"sqlserver.lock.wait_time.avg"` SqlserverPageBufferCacheHitRatio MetricConfig `mapstructure:"sqlserver.page.buffer_cache.hit_ratio"` SqlserverPageCheckpointFlushRate MetricConfig `mapstructure:"sqlserver.page.checkpoint.flush.rate"` SqlserverPageLazyWriteRate MetricConfig `mapstructure:"sqlserver.page.lazy_write.rate"` SqlserverPageLifeExpectancy MetricConfig `mapstructure:"sqlserver.page.life_expectancy"` SqlserverPageOperationRate MetricConfig `mapstructure:"sqlserver.page.operation.rate"` SqlserverPageSplitRate MetricConfig `mapstructure:"sqlserver.page.split.rate"` SqlserverProcessesBlocked MetricConfig `mapstructure:"sqlserver.processes.blocked"` SqlserverResourcePoolDiskThrottledReadRate MetricConfig `mapstructure:"sqlserver.resource_pool.disk.throttled.read.rate"` SqlserverResourcePoolDiskThrottledWriteRate MetricConfig `mapstructure:"sqlserver.resource_pool.disk.throttled.write.rate"` SqlserverTransactionRate MetricConfig `mapstructure:"sqlserver.transaction.rate"` SqlserverTransactionWriteRate MetricConfig `mapstructure:"sqlserver.transaction.write.rate"` SqlserverTransactionLogFlushDataRate MetricConfig `mapstructure:"sqlserver.transaction_log.flush.data.rate"` SqlserverTransactionLogFlushRate MetricConfig `mapstructure:"sqlserver.transaction_log.flush.rate"` SqlserverTransactionLogFlushWaitRate MetricConfig `mapstructure:"sqlserver.transaction_log.flush.wait.rate"` SqlserverTransactionLogGrowthCount MetricConfig `mapstructure:"sqlserver.transaction_log.growth.count"` SqlserverTransactionLogShrinkCount MetricConfig `mapstructure:"sqlserver.transaction_log.shrink.count"` SqlserverTransactionLogUsage MetricConfig `mapstructure:"sqlserver.transaction_log.usage"` SqlserverUserConnectionCount MetricConfig `mapstructure:"sqlserver.user.connection.count"` }
MetricsConfig provides config for sqlserver 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"` // Experimental: MetricsInclude defines a list of filters for attribute values. // If the list is not empty, only metrics with matching resource attribute values will be emitted. MetricsInclude []filter.Config `mapstructure:"metrics_include"` // Experimental: MetricsExclude defines a list of filters for attribute values. // If the list is not empty, metrics with matching resource attribute values will not be emitted. // MetricsInclude has higher priority than MetricsExclude. MetricsExclude []filter.Config `mapstructure:"metrics_exclude"` // contains filtered or unexported fields }
ResourceAttributeConfig provides common config for a particular resource attribute.
type ResourceAttributesConfig ¶ added in v0.77.0
type ResourceAttributesConfig struct { SqlserverComputerName ResourceAttributeConfig `mapstructure:"sqlserver.computer.name"` SqlserverDatabaseName ResourceAttributeConfig `mapstructure:"sqlserver.database.name"` SqlserverInstanceName ResourceAttributeConfig `mapstructure:"sqlserver.instance.name"` }
ResourceAttributesConfig provides config for sqlserver 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) SetSqlserverComputerName ¶ added in v0.82.0
func (rb *ResourceBuilder) SetSqlserverComputerName(val string)
SetSqlserverComputerName sets provided value as "sqlserver.computer.name" attribute.
func (*ResourceBuilder) SetSqlserverDatabaseName ¶ added in v0.82.0
func (rb *ResourceBuilder) SetSqlserverDatabaseName(val string)
SetSqlserverDatabaseName sets provided value as "sqlserver.database.name" attribute.
func (*ResourceBuilder) SetSqlserverInstanceName ¶ added in v0.82.0
func (rb *ResourceBuilder) SetSqlserverInstanceName(val string)
SetSqlserverInstanceName sets provided value as "sqlserver.instance.name" attribute.
type ResourceMetricsOption ¶ added in v0.52.0
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 ¶ 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.