metadata

package
v0.99.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetricsStability = component.StabilityLevelBeta
)

Variables

View Source
var MapAttributeBufferPoolData = map[string]AttributeBufferPoolData{
	"dirty": AttributeBufferPoolDataDirty,
	"clean": AttributeBufferPoolDataClean,
}

MapAttributeBufferPoolData is a helper map of string to AttributeBufferPoolData attribute value.

MapAttributeBufferPoolOperations is a helper map of string to AttributeBufferPoolOperations attribute value.

MapAttributeBufferPoolPages is a helper map of string to AttributeBufferPoolPages attribute value.

MapAttributeCacheStatus is a helper map of string to AttributeCacheStatus attribute value.

View Source
var MapAttributeCommand = map[string]AttributeCommand{
	"delete": AttributeCommandDelete,
	"insert": AttributeCommandInsert,
	"select": AttributeCommandSelect,
	"update": AttributeCommandUpdate,
}

MapAttributeCommand is a helper map of string to AttributeCommand attribute value.

MapAttributeConnectionError is a helper map of string to AttributeConnectionError attribute value.

MapAttributeConnectionStatus is a helper map of string to AttributeConnectionStatus attribute value.

View Source
var MapAttributeDirection = map[string]AttributeDirection{
	"received": AttributeDirectionReceived,
	"sent":     AttributeDirectionSent,
}

MapAttributeDirection is a helper map of string to AttributeDirection attribute value.

View Source
var MapAttributeDoubleWrites = map[string]AttributeDoubleWrites{
	"pages_written": AttributeDoubleWritesPagesWritten,
	"writes":        AttributeDoubleWritesWrites,
}

MapAttributeDoubleWrites is a helper map of string to AttributeDoubleWrites attribute value.

View Source
var MapAttributeEventState = map[string]AttributeEventState{
	"errors":                  AttributeEventStateErrors,
	"warnings":                AttributeEventStateWarnings,
	"rows_affected":           AttributeEventStateRowsAffected,
	"rows_sent":               AttributeEventStateRowsSent,
	"rows_examined":           AttributeEventStateRowsExamined,
	"created_tmp_disk_tables": AttributeEventStateCreatedTmpDiskTables,
	"created_tmp_tables":      AttributeEventStateCreatedTmpTables,
	"sort_merge_passes":       AttributeEventStateSortMergePasses,
	"sort_rows":               AttributeEventStateSortRows,
	"no_index_used":           AttributeEventStateNoIndexUsed,
}

MapAttributeEventState is a helper map of string to AttributeEventState attribute value.

MapAttributeHandler is a helper map of string to AttributeHandler attribute value.

MapAttributeIoWaitsOperations is a helper map of string to AttributeIoWaitsOperations attribute value.

View Source
var MapAttributeJoinKind = map[string]AttributeJoinKind{
	"full":        AttributeJoinKindFull,
	"full_range":  AttributeJoinKindFullRange,
	"range":       AttributeJoinKindRange,
	"range_check": AttributeJoinKindRangeCheck,
	"scan":        AttributeJoinKindScan,
}

MapAttributeJoinKind is a helper map of string to AttributeJoinKind attribute value.

View Source
var MapAttributeLocks = map[string]AttributeLocks{
	"immediate": AttributeLocksImmediate,
	"waited":    AttributeLocksWaited,
}

MapAttributeLocks is a helper map of string to AttributeLocks attribute value.

View Source
var MapAttributeLogOperations = map[string]AttributeLogOperations{
	"waits":          AttributeLogOperationsWaits,
	"write_requests": AttributeLogOperationsWriteRequests,
	"writes":         AttributeLogOperationsWrites,
}

MapAttributeLogOperations is a helper map of string to AttributeLogOperations attribute value.

View Source
var MapAttributeMysqlxThreads = map[string]AttributeMysqlxThreads{
	"available": AttributeMysqlxThreadsAvailable,
	"active":    AttributeMysqlxThreadsActive,
}

MapAttributeMysqlxThreads is a helper map of string to AttributeMysqlxThreads attribute value.

MapAttributeOpenedResources is a helper map of string to AttributeOpenedResources attribute value.

View Source
var MapAttributeOperations = map[string]AttributeOperations{
	"fsyncs": AttributeOperationsFsyncs,
	"reads":  AttributeOperationsReads,
	"writes": AttributeOperationsWrites,
}

MapAttributeOperations is a helper map of string to AttributeOperations attribute value.

MapAttributePageOperations is a helper map of string to AttributePageOperations attribute value.

MapAttributePreparedStatementsCommand is a helper map of string to AttributePreparedStatementsCommand attribute value.

MapAttributeReadLockType is a helper map of string to AttributeReadLockType attribute value.

View Source
var MapAttributeRowLocks = map[string]AttributeRowLocks{
	"waits": AttributeRowLocksWaits,
	"time":  AttributeRowLocksTime,
}

MapAttributeRowLocks is a helper map of string to AttributeRowLocks attribute value.

MapAttributeRowOperations is a helper map of string to AttributeRowOperations attribute value.

View Source
var MapAttributeSorts = map[string]AttributeSorts{
	"merge_passes": AttributeSortsMergePasses,
	"range":        AttributeSortsRange,
	"rows":         AttributeSortsRows,
	"scan":         AttributeSortsScan,
}

MapAttributeSorts is a helper map of string to AttributeSorts attribute value.

View Source
var MapAttributeThreads = map[string]AttributeThreads{
	"cached":    AttributeThreadsCached,
	"connected": AttributeThreadsConnected,
	"created":   AttributeThreadsCreated,
	"running":   AttributeThreadsRunning,
}

MapAttributeThreads is a helper map of string to AttributeThreads attribute value.

View Source
var MapAttributeTmpResource = map[string]AttributeTmpResource{
	"disk_tables": AttributeTmpResourceDiskTables,
	"files":       AttributeTmpResourceFiles,
	"tables":      AttributeTmpResourceTables,
}

MapAttributeTmpResource is a helper map of string to AttributeTmpResource attribute value.

MapAttributeWriteLockType is a helper map of string to AttributeWriteLockType attribute value.

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

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 added in v0.44.0

func WithStartTime(startTime pcommon.Timestamp) metricBuilderOption

WithStartTime sets startTime on the metrics builder.

Types

type AttributeBufferPoolData added in v0.46.0

type AttributeBufferPoolData int

AttributeBufferPoolData specifies the a value buffer_pool_data attribute.

const (
	AttributeBufferPoolDataDirty AttributeBufferPoolData
	AttributeBufferPoolDataClean
)

func (AttributeBufferPoolData) String added in v0.51.0

func (av AttributeBufferPoolData) String() string

String returns the string representation of the AttributeBufferPoolData.

type AttributeBufferPoolOperations added in v0.39.0

type AttributeBufferPoolOperations int

AttributeBufferPoolOperations specifies the a value buffer_pool_operations attribute.

const (
	AttributeBufferPoolOperationsReadAheadRnd AttributeBufferPoolOperations
	AttributeBufferPoolOperationsReadAhead
	AttributeBufferPoolOperationsReadAheadEvicted
	AttributeBufferPoolOperationsReadRequests
	AttributeBufferPoolOperationsReads
	AttributeBufferPoolOperationsWaitFree
	AttributeBufferPoolOperationsWriteRequests
)

func (AttributeBufferPoolOperations) String added in v0.51.0

String returns the string representation of the AttributeBufferPoolOperations.

type AttributeBufferPoolPages added in v0.39.0

type AttributeBufferPoolPages int

AttributeBufferPoolPages specifies the a value buffer_pool_pages attribute.

const (
	AttributeBufferPoolPagesData AttributeBufferPoolPages
	AttributeBufferPoolPagesFree
	AttributeBufferPoolPagesMisc
)

func (AttributeBufferPoolPages) String added in v0.51.0

func (av AttributeBufferPoolPages) String() string

String returns the string representation of the AttributeBufferPoolPages.

type AttributeCacheStatus added in v0.64.0

type AttributeCacheStatus int

AttributeCacheStatus specifies the a value cache_status attribute.

const (
	AttributeCacheStatusHit AttributeCacheStatus
	AttributeCacheStatusMiss
	AttributeCacheStatusOverflow
)

func (AttributeCacheStatus) String added in v0.64.0

func (av AttributeCacheStatus) String() string

String returns the string representation of the AttributeCacheStatus.

type AttributeCommand added in v0.39.0

type AttributeCommand int

AttributeCommand specifies the a value command attribute.

const (
	AttributeCommandDelete AttributeCommand
	AttributeCommandInsert
	AttributeCommandSelect
	AttributeCommandUpdate
)

func (AttributeCommand) String added in v0.51.0

func (av AttributeCommand) String() string

String returns the string representation of the AttributeCommand.

type AttributeConnectionError added in v0.64.0

type AttributeConnectionError int

AttributeConnectionError specifies the a value connection_error attribute.

const (
	AttributeConnectionErrorAccept AttributeConnectionError
	AttributeConnectionErrorInternal
	AttributeConnectionErrorMaxConnections
	AttributeConnectionErrorPeerAddress
	AttributeConnectionErrorSelect
	AttributeConnectionErrorTcpwrap
	AttributeConnectionErrorAborted
	AttributeConnectionErrorAbortedClients
	AttributeConnectionErrorLocked
)

func (AttributeConnectionError) String added in v0.64.0

func (av AttributeConnectionError) String() string

String returns the string representation of the AttributeConnectionError.

type AttributeConnectionStatus added in v0.64.0

type AttributeConnectionStatus int

AttributeConnectionStatus specifies the a value connection_status attribute.

const (
	AttributeConnectionStatusAccepted AttributeConnectionStatus
	AttributeConnectionStatusClosed
	AttributeConnectionStatusRejected
)

func (AttributeConnectionStatus) String added in v0.64.0

func (av AttributeConnectionStatus) String() string

String returns the string representation of the AttributeConnectionStatus.

type AttributeDirection added in v0.64.0

type AttributeDirection int

AttributeDirection specifies the a value direction attribute.

const (
	AttributeDirectionReceived AttributeDirection
	AttributeDirectionSent
)

func (AttributeDirection) String added in v0.64.0

func (av AttributeDirection) String() string

String returns the string representation of the AttributeDirection.

type AttributeDoubleWrites added in v0.39.0

type AttributeDoubleWrites int

AttributeDoubleWrites specifies the a value double_writes attribute.

const (
	AttributeDoubleWritesPagesWritten AttributeDoubleWrites
	AttributeDoubleWritesWrites
)

func (AttributeDoubleWrites) String added in v0.51.0

func (av AttributeDoubleWrites) String() string

String returns the string representation of the AttributeDoubleWrites.

type AttributeEventState added in v0.63.0

type AttributeEventState int

AttributeEventState specifies the a value event_state attribute.

const (
	AttributeEventStateErrors AttributeEventState
	AttributeEventStateWarnings
	AttributeEventStateRowsAffected
	AttributeEventStateRowsSent
	AttributeEventStateRowsExamined
	AttributeEventStateCreatedTmpDiskTables
	AttributeEventStateCreatedTmpTables
	AttributeEventStateSortMergePasses
	AttributeEventStateSortRows
	AttributeEventStateNoIndexUsed
)

func (AttributeEventState) String added in v0.63.0

func (av AttributeEventState) String() string

String returns the string representation of the AttributeEventState.

type AttributeHandler added in v0.39.0

type AttributeHandler int

AttributeHandler specifies the a value handler attribute.

const (
	AttributeHandlerCommit AttributeHandler
	AttributeHandlerDelete
	AttributeHandlerDiscover
	AttributeHandlerExternalLock
	AttributeHandlerMrrInit
	AttributeHandlerPrepare
	AttributeHandlerReadFirst
	AttributeHandlerReadKey
	AttributeHandlerReadLast
	AttributeHandlerReadNext
	AttributeHandlerReadPrev
	AttributeHandlerReadRnd
	AttributeHandlerReadRndNext
	AttributeHandlerRollback
	AttributeHandlerSavepoint
	AttributeHandlerSavepointRollback
	AttributeHandlerUpdate
	AttributeHandlerWrite
)

func (AttributeHandler) String added in v0.51.0

func (av AttributeHandler) String() string

String returns the string representation of the AttributeHandler.

type AttributeIoWaitsOperations added in v0.61.0

type AttributeIoWaitsOperations int

AttributeIoWaitsOperations specifies the a value io_waits_operations attribute.

const (
	AttributeIoWaitsOperationsDelete AttributeIoWaitsOperations
	AttributeIoWaitsOperationsFetch
	AttributeIoWaitsOperationsInsert
	AttributeIoWaitsOperationsUpdate
)

func (AttributeIoWaitsOperations) String added in v0.61.0

func (av AttributeIoWaitsOperations) String() string

String returns the string representation of the AttributeIoWaitsOperations.

type AttributeJoinKind added in v0.64.0

type AttributeJoinKind int

AttributeJoinKind specifies the a value join_kind attribute.

const (
	AttributeJoinKindFull AttributeJoinKind
	AttributeJoinKindFullRange
	AttributeJoinKindRange
	AttributeJoinKindRangeCheck
	AttributeJoinKindScan
)

func (AttributeJoinKind) String added in v0.64.0

func (av AttributeJoinKind) String() string

String returns the string representation of the AttributeJoinKind.

type AttributeLocks added in v0.39.0

type AttributeLocks int

AttributeLocks specifies the a value locks attribute.

const (
	AttributeLocksImmediate AttributeLocks
	AttributeLocksWaited
)

func (AttributeLocks) String added in v0.51.0

func (av AttributeLocks) String() string

String returns the string representation of the AttributeLocks.

type AttributeLogOperations added in v0.39.0

type AttributeLogOperations int

AttributeLogOperations specifies the a value log_operations attribute.

const (
	AttributeLogOperationsWaits AttributeLogOperations
	AttributeLogOperationsWriteRequests
	AttributeLogOperationsWrites
)

func (AttributeLogOperations) String added in v0.51.0

func (av AttributeLogOperations) String() string

String returns the string representation of the AttributeLogOperations.

type AttributeMysqlxThreads added in v0.63.0

type AttributeMysqlxThreads int

AttributeMysqlxThreads specifies the a value mysqlx_threads attribute.

const (
	AttributeMysqlxThreadsAvailable AttributeMysqlxThreads
	AttributeMysqlxThreadsActive
)

func (AttributeMysqlxThreads) String added in v0.63.0

func (av AttributeMysqlxThreads) String() string

String returns the string representation of the AttributeMysqlxThreads.

type AttributeOpenedResources added in v0.63.0

type AttributeOpenedResources int

AttributeOpenedResources specifies the a value opened_resources attribute.

const (
	AttributeOpenedResourcesFile AttributeOpenedResources
	AttributeOpenedResourcesTableDefinition
	AttributeOpenedResourcesTable
)

func (AttributeOpenedResources) String added in v0.63.0

func (av AttributeOpenedResources) String() string

String returns the string representation of the AttributeOpenedResources.

type AttributeOperations added in v0.39.0

type AttributeOperations int

AttributeOperations specifies the a value operations attribute.

const (
	AttributeOperationsFsyncs AttributeOperations
	AttributeOperationsReads
	AttributeOperationsWrites
)

func (AttributeOperations) String added in v0.51.0

func (av AttributeOperations) String() string

String returns the string representation of the AttributeOperations.

type AttributePageOperations added in v0.39.0

type AttributePageOperations int

AttributePageOperations specifies the a value page_operations attribute.

const (
	AttributePageOperationsCreated AttributePageOperations
	AttributePageOperationsRead
	AttributePageOperationsWritten
)

func (AttributePageOperations) String added in v0.51.0

func (av AttributePageOperations) String() string

String returns the string representation of the AttributePageOperations.

type AttributePreparedStatementsCommand added in v0.67.0

type AttributePreparedStatementsCommand int

AttributePreparedStatementsCommand specifies the a value prepared_statements_command attribute.

const (
	AttributePreparedStatementsCommandExecute AttributePreparedStatementsCommand
	AttributePreparedStatementsCommandClose
	AttributePreparedStatementsCommandFetch
	AttributePreparedStatementsCommandPrepare
	AttributePreparedStatementsCommandReset
	AttributePreparedStatementsCommandSendLongData
)

func (AttributePreparedStatementsCommand) String added in v0.67.0

String returns the string representation of the AttributePreparedStatementsCommand.

type AttributeReadLockType added in v0.64.0

type AttributeReadLockType int

AttributeReadLockType specifies the a value read_lock_type attribute.

const (
	AttributeReadLockTypeNormal AttributeReadLockType
	AttributeReadLockTypeWithSharedLocks
	AttributeReadLockTypeHighPriority
	AttributeReadLockTypeNoInsert
	AttributeReadLockTypeExternal
)

func (AttributeReadLockType) String added in v0.64.0

func (av AttributeReadLockType) String() string

String returns the string representation of the AttributeReadLockType.

type AttributeRowLocks added in v0.39.0

type AttributeRowLocks int

AttributeRowLocks specifies the a value row_locks attribute.

const (
	AttributeRowLocksWaits AttributeRowLocks
	AttributeRowLocksTime
)

func (AttributeRowLocks) String added in v0.51.0

func (av AttributeRowLocks) String() string

String returns the string representation of the AttributeRowLocks.

type AttributeRowOperations added in v0.39.0

type AttributeRowOperations int

AttributeRowOperations specifies the a value row_operations attribute.

const (
	AttributeRowOperationsDeleted AttributeRowOperations
	AttributeRowOperationsInserted
	AttributeRowOperationsRead
	AttributeRowOperationsUpdated
)

func (AttributeRowOperations) String added in v0.51.0

func (av AttributeRowOperations) String() string

String returns the string representation of the AttributeRowOperations.

type AttributeSorts added in v0.39.0

type AttributeSorts int

AttributeSorts specifies the a value sorts attribute.

const (
	AttributeSortsMergePasses AttributeSorts
	AttributeSortsRange
	AttributeSortsRows
	AttributeSortsScan
)

func (AttributeSorts) String added in v0.51.0

func (av AttributeSorts) String() string

String returns the string representation of the AttributeSorts.

type AttributeThreads added in v0.39.0

type AttributeThreads int

AttributeThreads specifies the a value threads attribute.

const (
	AttributeThreadsCached AttributeThreads
	AttributeThreadsConnected
	AttributeThreadsCreated
	AttributeThreadsRunning
)

func (AttributeThreads) String added in v0.51.0

func (av AttributeThreads) String() string

String returns the string representation of the AttributeThreads.

type AttributeTmpResource added in v0.62.0

type AttributeTmpResource int

AttributeTmpResource specifies the a value tmp_resource attribute.

const (
	AttributeTmpResourceDiskTables AttributeTmpResource
	AttributeTmpResourceFiles
	AttributeTmpResourceTables
)

func (AttributeTmpResource) String added in v0.62.0

func (av AttributeTmpResource) String() string

String returns the string representation of the AttributeTmpResource.

type AttributeWriteLockType added in v0.64.0

type AttributeWriteLockType int

AttributeWriteLockType specifies the a value write_lock_type attribute.

const (
	AttributeWriteLockTypeAllowWrite AttributeWriteLockType
	AttributeWriteLockTypeConcurrentInsert
	AttributeWriteLockTypeLowPriority
	AttributeWriteLockTypeNormal
	AttributeWriteLockTypeExternal
)

func (AttributeWriteLockType) String added in v0.64.0

func (av AttributeWriteLockType) String() string

String returns the string representation of the AttributeWriteLockType.

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 added in v0.44.0

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 added in v0.44.0

func NewMetricsBuilder(mbc MetricsBuilderConfig, settings receiver.CreateSettings, options ...metricBuilderOption) *MetricsBuilder

func (*MetricsBuilder) Emit added in v0.44.0

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 added in v0.48.0

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) RecordMysqlBufferPoolDataPagesDataPoint added in v0.46.0

func (mb *MetricsBuilder) RecordMysqlBufferPoolDataPagesDataPoint(ts pcommon.Timestamp, val int64, bufferPoolDataAttributeValue AttributeBufferPoolData)

RecordMysqlBufferPoolDataPagesDataPoint adds a data point to mysql.buffer_pool.data_pages metric.

func (*MetricsBuilder) RecordMysqlBufferPoolLimitDataPoint added in v0.46.0

func (mb *MetricsBuilder) RecordMysqlBufferPoolLimitDataPoint(ts pcommon.Timestamp, inputVal string) error

RecordMysqlBufferPoolLimitDataPoint adds a data point to mysql.buffer_pool.limit metric.

func (*MetricsBuilder) RecordMysqlBufferPoolOperationsDataPoint added in v0.44.0

func (mb *MetricsBuilder) RecordMysqlBufferPoolOperationsDataPoint(ts pcommon.Timestamp, inputVal string, bufferPoolOperationsAttributeValue AttributeBufferPoolOperations) error

RecordMysqlBufferPoolOperationsDataPoint adds a data point to mysql.buffer_pool.operations metric.

func (*MetricsBuilder) RecordMysqlBufferPoolPageFlushesDataPoint added in v0.46.0

func (mb *MetricsBuilder) RecordMysqlBufferPoolPageFlushesDataPoint(ts pcommon.Timestamp, inputVal string) error

RecordMysqlBufferPoolPageFlushesDataPoint adds a data point to mysql.buffer_pool.page_flushes metric.

func (*MetricsBuilder) RecordMysqlBufferPoolPagesDataPoint added in v0.44.0

func (mb *MetricsBuilder) RecordMysqlBufferPoolPagesDataPoint(ts pcommon.Timestamp, inputVal string, bufferPoolPagesAttributeValue AttributeBufferPoolPages) error

RecordMysqlBufferPoolPagesDataPoint adds a data point to mysql.buffer_pool.pages metric.

func (*MetricsBuilder) RecordMysqlBufferPoolUsageDataPoint added in v0.46.0

func (mb *MetricsBuilder) RecordMysqlBufferPoolUsageDataPoint(ts pcommon.Timestamp, val int64, bufferPoolDataAttributeValue AttributeBufferPoolData)

RecordMysqlBufferPoolUsageDataPoint adds a data point to mysql.buffer_pool.usage metric.

func (*MetricsBuilder) RecordMysqlClientNetworkIoDataPoint added in v0.64.0

func (mb *MetricsBuilder) RecordMysqlClientNetworkIoDataPoint(ts pcommon.Timestamp, inputVal string, directionAttributeValue AttributeDirection) error

RecordMysqlClientNetworkIoDataPoint adds a data point to mysql.client.network.io metric.

func (*MetricsBuilder) RecordMysqlCommandsDataPoint added in v0.44.0

func (mb *MetricsBuilder) RecordMysqlCommandsDataPoint(ts pcommon.Timestamp, inputVal string, commandAttributeValue AttributeCommand) error

RecordMysqlCommandsDataPoint adds a data point to mysql.commands metric.

func (*MetricsBuilder) RecordMysqlConnectionCountDataPoint added in v0.67.0

func (mb *MetricsBuilder) RecordMysqlConnectionCountDataPoint(ts pcommon.Timestamp, inputVal string) error

RecordMysqlConnectionCountDataPoint adds a data point to mysql.connection.count metric.

func (*MetricsBuilder) RecordMysqlConnectionErrorsDataPoint added in v0.64.0

func (mb *MetricsBuilder) RecordMysqlConnectionErrorsDataPoint(ts pcommon.Timestamp, inputVal string, connectionErrorAttributeValue AttributeConnectionError) error

RecordMysqlConnectionErrorsDataPoint adds a data point to mysql.connection.errors metric.

func (*MetricsBuilder) RecordMysqlDoubleWritesDataPoint added in v0.44.0

func (mb *MetricsBuilder) RecordMysqlDoubleWritesDataPoint(ts pcommon.Timestamp, inputVal string, doubleWritesAttributeValue AttributeDoubleWrites) error

RecordMysqlDoubleWritesDataPoint adds a data point to mysql.double_writes metric.

func (*MetricsBuilder) RecordMysqlHandlersDataPoint added in v0.44.0

func (mb *MetricsBuilder) RecordMysqlHandlersDataPoint(ts pcommon.Timestamp, inputVal string, handlerAttributeValue AttributeHandler) error

RecordMysqlHandlersDataPoint adds a data point to mysql.handlers metric.

func (*MetricsBuilder) RecordMysqlIndexIoWaitCountDataPoint added in v0.61.0

func (mb *MetricsBuilder) RecordMysqlIndexIoWaitCountDataPoint(ts pcommon.Timestamp, val int64, ioWaitsOperationsAttributeValue AttributeIoWaitsOperations, tableNameAttributeValue string, schemaAttributeValue string, indexNameAttributeValue string)

RecordMysqlIndexIoWaitCountDataPoint adds a data point to mysql.index.io.wait.count metric.

func (*MetricsBuilder) RecordMysqlIndexIoWaitTimeDataPoint added in v0.61.0

func (mb *MetricsBuilder) RecordMysqlIndexIoWaitTimeDataPoint(ts pcommon.Timestamp, val int64, ioWaitsOperationsAttributeValue AttributeIoWaitsOperations, tableNameAttributeValue string, schemaAttributeValue string, indexNameAttributeValue string)

RecordMysqlIndexIoWaitTimeDataPoint adds a data point to mysql.index.io.wait.time metric.

func (*MetricsBuilder) RecordMysqlJoinsDataPoint added in v0.64.0

func (mb *MetricsBuilder) RecordMysqlJoinsDataPoint(ts pcommon.Timestamp, inputVal string, joinKindAttributeValue AttributeJoinKind) error

RecordMysqlJoinsDataPoint adds a data point to mysql.joins metric.

func (*MetricsBuilder) RecordMysqlLocksDataPoint added in v0.44.0

func (mb *MetricsBuilder) RecordMysqlLocksDataPoint(ts pcommon.Timestamp, inputVal string, locksAttributeValue AttributeLocks) error

RecordMysqlLocksDataPoint adds a data point to mysql.locks metric.

func (*MetricsBuilder) RecordMysqlLogOperationsDataPoint added in v0.44.0

func (mb *MetricsBuilder) RecordMysqlLogOperationsDataPoint(ts pcommon.Timestamp, inputVal string, logOperationsAttributeValue AttributeLogOperations) error

RecordMysqlLogOperationsDataPoint adds a data point to mysql.log_operations metric.

func (*MetricsBuilder) RecordMysqlMysqlxConnectionsDataPoint added in v0.64.0

func (mb *MetricsBuilder) RecordMysqlMysqlxConnectionsDataPoint(ts pcommon.Timestamp, inputVal string, connectionStatusAttributeValue AttributeConnectionStatus) error

RecordMysqlMysqlxConnectionsDataPoint adds a data point to mysql.mysqlx_connections metric.

func (*MetricsBuilder) RecordMysqlMysqlxWorkerThreadsDataPoint added in v0.63.0

func (mb *MetricsBuilder) RecordMysqlMysqlxWorkerThreadsDataPoint(ts pcommon.Timestamp, inputVal string, mysqlxThreadsAttributeValue AttributeMysqlxThreads) error

RecordMysqlMysqlxWorkerThreadsDataPoint adds a data point to mysql.mysqlx_worker_threads metric.

func (*MetricsBuilder) RecordMysqlOpenedResourcesDataPoint added in v0.63.0

func (mb *MetricsBuilder) RecordMysqlOpenedResourcesDataPoint(ts pcommon.Timestamp, inputVal string, openedResourcesAttributeValue AttributeOpenedResources) error

RecordMysqlOpenedResourcesDataPoint adds a data point to mysql.opened_resources metric.

func (*MetricsBuilder) RecordMysqlOperationsDataPoint added in v0.44.0

func (mb *MetricsBuilder) RecordMysqlOperationsDataPoint(ts pcommon.Timestamp, inputVal string, operationsAttributeValue AttributeOperations) error

RecordMysqlOperationsDataPoint adds a data point to mysql.operations metric.

func (*MetricsBuilder) RecordMysqlPageOperationsDataPoint added in v0.44.0

func (mb *MetricsBuilder) RecordMysqlPageOperationsDataPoint(ts pcommon.Timestamp, inputVal string, pageOperationsAttributeValue AttributePageOperations) error

RecordMysqlPageOperationsDataPoint adds a data point to mysql.page_operations metric.

func (*MetricsBuilder) RecordMysqlPreparedStatementsDataPoint added in v0.67.0

func (mb *MetricsBuilder) RecordMysqlPreparedStatementsDataPoint(ts pcommon.Timestamp, inputVal string, preparedStatementsCommandAttributeValue AttributePreparedStatementsCommand) error

RecordMysqlPreparedStatementsDataPoint adds a data point to mysql.prepared_statements metric.

func (*MetricsBuilder) RecordMysqlQueryClientCountDataPoint added in v0.64.0

func (mb *MetricsBuilder) RecordMysqlQueryClientCountDataPoint(ts pcommon.Timestamp, inputVal string) error

RecordMysqlQueryClientCountDataPoint adds a data point to mysql.query.client.count metric.

func (*MetricsBuilder) RecordMysqlQueryCountDataPoint added in v0.64.0

func (mb *MetricsBuilder) RecordMysqlQueryCountDataPoint(ts pcommon.Timestamp, inputVal string) error

RecordMysqlQueryCountDataPoint adds a data point to mysql.query.count metric.

func (*MetricsBuilder) RecordMysqlQuerySlowCountDataPoint added in v0.64.0

func (mb *MetricsBuilder) RecordMysqlQuerySlowCountDataPoint(ts pcommon.Timestamp, inputVal string) error

RecordMysqlQuerySlowCountDataPoint adds a data point to mysql.query.slow.count metric.

func (*MetricsBuilder) RecordMysqlReplicaSQLDelayDataPoint added in v0.68.0

func (mb *MetricsBuilder) RecordMysqlReplicaSQLDelayDataPoint(ts pcommon.Timestamp, val int64)

RecordMysqlReplicaSQLDelayDataPoint adds a data point to mysql.replica.sql_delay metric.

func (*MetricsBuilder) RecordMysqlReplicaTimeBehindSourceDataPoint added in v0.68.0

func (mb *MetricsBuilder) RecordMysqlReplicaTimeBehindSourceDataPoint(ts pcommon.Timestamp, val int64)

RecordMysqlReplicaTimeBehindSourceDataPoint adds a data point to mysql.replica.time_behind_source metric.

func (*MetricsBuilder) RecordMysqlRowLocksDataPoint added in v0.44.0

func (mb *MetricsBuilder) RecordMysqlRowLocksDataPoint(ts pcommon.Timestamp, inputVal string, rowLocksAttributeValue AttributeRowLocks) error

RecordMysqlRowLocksDataPoint adds a data point to mysql.row_locks metric.

func (*MetricsBuilder) RecordMysqlRowOperationsDataPoint added in v0.44.0

func (mb *MetricsBuilder) RecordMysqlRowOperationsDataPoint(ts pcommon.Timestamp, inputVal string, rowOperationsAttributeValue AttributeRowOperations) error

RecordMysqlRowOperationsDataPoint adds a data point to mysql.row_operations metric.

func (*MetricsBuilder) RecordMysqlSortsDataPoint added in v0.44.0

func (mb *MetricsBuilder) RecordMysqlSortsDataPoint(ts pcommon.Timestamp, inputVal string, sortsAttributeValue AttributeSorts) error

RecordMysqlSortsDataPoint adds a data point to mysql.sorts metric.

func (*MetricsBuilder) RecordMysqlStatementEventCountDataPoint added in v0.63.0

func (mb *MetricsBuilder) RecordMysqlStatementEventCountDataPoint(ts pcommon.Timestamp, val int64, schemaAttributeValue string, digestAttributeValue string, digestTextAttributeValue string, eventStateAttributeValue AttributeEventState)

RecordMysqlStatementEventCountDataPoint adds a data point to mysql.statement_event.count metric.

func (*MetricsBuilder) RecordMysqlStatementEventWaitTimeDataPoint added in v0.63.0

func (mb *MetricsBuilder) RecordMysqlStatementEventWaitTimeDataPoint(ts pcommon.Timestamp, val int64, schemaAttributeValue string, digestAttributeValue string, digestTextAttributeValue string)

RecordMysqlStatementEventWaitTimeDataPoint adds a data point to mysql.statement_event.wait.time metric.

func (*MetricsBuilder) RecordMysqlTableIoWaitCountDataPoint added in v0.61.0

func (mb *MetricsBuilder) RecordMysqlTableIoWaitCountDataPoint(ts pcommon.Timestamp, val int64, ioWaitsOperationsAttributeValue AttributeIoWaitsOperations, tableNameAttributeValue string, schemaAttributeValue string)

RecordMysqlTableIoWaitCountDataPoint adds a data point to mysql.table.io.wait.count metric.

func (*MetricsBuilder) RecordMysqlTableIoWaitTimeDataPoint added in v0.61.0

func (mb *MetricsBuilder) RecordMysqlTableIoWaitTimeDataPoint(ts pcommon.Timestamp, val int64, ioWaitsOperationsAttributeValue AttributeIoWaitsOperations, tableNameAttributeValue string, schemaAttributeValue string)

RecordMysqlTableIoWaitTimeDataPoint adds a data point to mysql.table.io.wait.time metric.

func (*MetricsBuilder) RecordMysqlTableLockWaitReadCountDataPoint added in v0.64.0

func (mb *MetricsBuilder) RecordMysqlTableLockWaitReadCountDataPoint(ts pcommon.Timestamp, val int64, schemaAttributeValue string, tableNameAttributeValue string, readLockTypeAttributeValue AttributeReadLockType)

RecordMysqlTableLockWaitReadCountDataPoint adds a data point to mysql.table.lock_wait.read.count metric.

func (*MetricsBuilder) RecordMysqlTableLockWaitReadTimeDataPoint added in v0.64.0

func (mb *MetricsBuilder) RecordMysqlTableLockWaitReadTimeDataPoint(ts pcommon.Timestamp, val int64, schemaAttributeValue string, tableNameAttributeValue string, readLockTypeAttributeValue AttributeReadLockType)

RecordMysqlTableLockWaitReadTimeDataPoint adds a data point to mysql.table.lock_wait.read.time metric.

func (*MetricsBuilder) RecordMysqlTableLockWaitWriteCountDataPoint added in v0.64.0

func (mb *MetricsBuilder) RecordMysqlTableLockWaitWriteCountDataPoint(ts pcommon.Timestamp, val int64, schemaAttributeValue string, tableNameAttributeValue string, writeLockTypeAttributeValue AttributeWriteLockType)

RecordMysqlTableLockWaitWriteCountDataPoint adds a data point to mysql.table.lock_wait.write.count metric.

func (*MetricsBuilder) RecordMysqlTableLockWaitWriteTimeDataPoint added in v0.64.0

func (mb *MetricsBuilder) RecordMysqlTableLockWaitWriteTimeDataPoint(ts pcommon.Timestamp, val int64, schemaAttributeValue string, tableNameAttributeValue string, writeLockTypeAttributeValue AttributeWriteLockType)

RecordMysqlTableLockWaitWriteTimeDataPoint adds a data point to mysql.table.lock_wait.write.time metric.

func (*MetricsBuilder) RecordMysqlTableOpenCacheDataPoint added in v0.64.0

func (mb *MetricsBuilder) RecordMysqlTableOpenCacheDataPoint(ts pcommon.Timestamp, inputVal string, cacheStatusAttributeValue AttributeCacheStatus) error

RecordMysqlTableOpenCacheDataPoint adds a data point to mysql.table_open_cache metric.

func (*MetricsBuilder) RecordMysqlThreadsDataPoint added in v0.44.0

func (mb *MetricsBuilder) RecordMysqlThreadsDataPoint(ts pcommon.Timestamp, inputVal string, threadsAttributeValue AttributeThreads) error

RecordMysqlThreadsDataPoint adds a data point to mysql.threads metric.

func (*MetricsBuilder) RecordMysqlTmpResourcesDataPoint added in v0.62.0

func (mb *MetricsBuilder) RecordMysqlTmpResourcesDataPoint(ts pcommon.Timestamp, inputVal string, tmpResourceAttributeValue AttributeTmpResource) error

RecordMysqlTmpResourcesDataPoint adds a data point to mysql.tmp_resources metric.

func (*MetricsBuilder) RecordMysqlUptimeDataPoint added in v0.79.0

func (mb *MetricsBuilder) RecordMysqlUptimeDataPoint(ts pcommon.Timestamp, inputVal string) error

RecordMysqlUptimeDataPoint adds a data point to mysql.uptime metric.

func (*MetricsBuilder) Reset added in v0.44.0

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 mysql metrics builder.

func DefaultMetricsBuilderConfig added in v0.73.0

func DefaultMetricsBuilderConfig() MetricsBuilderConfig

type MetricsConfig added in v0.77.0

type MetricsConfig struct {
	MysqlBufferPoolDataPages     MetricConfig `mapstructure:"mysql.buffer_pool.data_pages"`
	MysqlBufferPoolLimit         MetricConfig `mapstructure:"mysql.buffer_pool.limit"`
	MysqlBufferPoolOperations    MetricConfig `mapstructure:"mysql.buffer_pool.operations"`
	MysqlBufferPoolPageFlushes   MetricConfig `mapstructure:"mysql.buffer_pool.page_flushes"`
	MysqlBufferPoolPages         MetricConfig `mapstructure:"mysql.buffer_pool.pages"`
	MysqlBufferPoolUsage         MetricConfig `mapstructure:"mysql.buffer_pool.usage"`
	MysqlClientNetworkIo         MetricConfig `mapstructure:"mysql.client.network.io"`
	MysqlCommands                MetricConfig `mapstructure:"mysql.commands"`
	MysqlConnectionCount         MetricConfig `mapstructure:"mysql.connection.count"`
	MysqlConnectionErrors        MetricConfig `mapstructure:"mysql.connection.errors"`
	MysqlDoubleWrites            MetricConfig `mapstructure:"mysql.double_writes"`
	MysqlHandlers                MetricConfig `mapstructure:"mysql.handlers"`
	MysqlIndexIoWaitCount        MetricConfig `mapstructure:"mysql.index.io.wait.count"`
	MysqlIndexIoWaitTime         MetricConfig `mapstructure:"mysql.index.io.wait.time"`
	MysqlJoins                   MetricConfig `mapstructure:"mysql.joins"`
	MysqlLocks                   MetricConfig `mapstructure:"mysql.locks"`
	MysqlLogOperations           MetricConfig `mapstructure:"mysql.log_operations"`
	MysqlMysqlxConnections       MetricConfig `mapstructure:"mysql.mysqlx_connections"`
	MysqlMysqlxWorkerThreads     MetricConfig `mapstructure:"mysql.mysqlx_worker_threads"`
	MysqlOpenedResources         MetricConfig `mapstructure:"mysql.opened_resources"`
	MysqlOperations              MetricConfig `mapstructure:"mysql.operations"`
	MysqlPageOperations          MetricConfig `mapstructure:"mysql.page_operations"`
	MysqlPreparedStatements      MetricConfig `mapstructure:"mysql.prepared_statements"`
	MysqlQueryClientCount        MetricConfig `mapstructure:"mysql.query.client.count"`
	MysqlQueryCount              MetricConfig `mapstructure:"mysql.query.count"`
	MysqlQuerySlowCount          MetricConfig `mapstructure:"mysql.query.slow.count"`
	MysqlReplicaSQLDelay         MetricConfig `mapstructure:"mysql.replica.sql_delay"`
	MysqlReplicaTimeBehindSource MetricConfig `mapstructure:"mysql.replica.time_behind_source"`
	MysqlRowLocks                MetricConfig `mapstructure:"mysql.row_locks"`
	MysqlRowOperations           MetricConfig `mapstructure:"mysql.row_operations"`
	MysqlSorts                   MetricConfig `mapstructure:"mysql.sorts"`
	MysqlStatementEventCount     MetricConfig `mapstructure:"mysql.statement_event.count"`
	MysqlStatementEventWaitTime  MetricConfig `mapstructure:"mysql.statement_event.wait.time"`
	MysqlTableIoWaitCount        MetricConfig `mapstructure:"mysql.table.io.wait.count"`
	MysqlTableIoWaitTime         MetricConfig `mapstructure:"mysql.table.io.wait.time"`
	MysqlTableLockWaitReadCount  MetricConfig `mapstructure:"mysql.table.lock_wait.read.count"`
	MysqlTableLockWaitReadTime   MetricConfig `mapstructure:"mysql.table.lock_wait.read.time"`
	MysqlTableLockWaitWriteCount MetricConfig `mapstructure:"mysql.table.lock_wait.write.count"`
	MysqlTableLockWaitWriteTime  MetricConfig `mapstructure:"mysql.table.lock_wait.write.time"`
	MysqlTableOpenCache          MetricConfig `mapstructure:"mysql.table_open_cache"`
	MysqlThreads                 MetricConfig `mapstructure:"mysql.threads"`
	MysqlTmpResources            MetricConfig `mapstructure:"mysql.tmp_resources"`
	MysqlUptime                  MetricConfig `mapstructure:"mysql.uptime"`
}

MetricsConfig provides config for mysql 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.

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 {
	MysqlInstanceEndpoint ResourceAttributeConfig `mapstructure:"mysql.instance.endpoint"`
}

ResourceAttributesConfig provides config for mysql 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) SetMysqlInstanceEndpoint added in v0.82.0

func (rb *ResourceBuilder) SetMysqlInstanceEndpoint(val string)

SetMysqlInstanceEndpoint sets provided value as "mysql.instance.endpoint" attribute.

type ResourceMetricsOption added in v0.52.0

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 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.

Jump to

Keyboard shortcuts

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