Documentation ¶
Index ¶
- Variables
- func WithStartTime(startTime pcommon.Timestamp) metricBuilderOption
- type AttributeBufferPoolData
- type AttributeBufferPoolOperations
- type AttributeBufferPoolPages
- type AttributeCommand
- type AttributeDoubleWrites
- type AttributeEventState
- type AttributeHandler
- type AttributeIoWaitsOperations
- type AttributeLocks
- type AttributeLogOperations
- type AttributeMysqlxThreads
- type AttributeOpenedResources
- type AttributeOperations
- type AttributePageOperations
- type AttributeRowLocks
- type AttributeRowOperations
- type AttributeSorts
- type AttributeThreads
- type AttributeTmpResource
- type MetricSettings
- type MetricsBuilder
- func (mb *MetricsBuilder) Emit(rmo ...ResourceMetricsOption) pmetric.Metrics
- func (mb *MetricsBuilder) EmitForResource(rmo ...ResourceMetricsOption)
- func (mb *MetricsBuilder) RecordMysqlBufferPoolDataPagesDataPoint(ts pcommon.Timestamp, val int64, ...)
- func (mb *MetricsBuilder) RecordMysqlBufferPoolLimitDataPoint(ts pcommon.Timestamp, inputVal string) error
- func (mb *MetricsBuilder) RecordMysqlBufferPoolOperationsDataPoint(ts pcommon.Timestamp, inputVal string, ...) error
- func (mb *MetricsBuilder) RecordMysqlBufferPoolPageFlushesDataPoint(ts pcommon.Timestamp, inputVal string) error
- func (mb *MetricsBuilder) RecordMysqlBufferPoolPagesDataPoint(ts pcommon.Timestamp, inputVal string, ...) error
- func (mb *MetricsBuilder) RecordMysqlBufferPoolUsageDataPoint(ts pcommon.Timestamp, val int64, ...)
- func (mb *MetricsBuilder) RecordMysqlCommandsDataPoint(ts pcommon.Timestamp, inputVal string, commandAttributeValue AttributeCommand) error
- func (mb *MetricsBuilder) RecordMysqlDoubleWritesDataPoint(ts pcommon.Timestamp, inputVal string, ...) error
- func (mb *MetricsBuilder) RecordMysqlHandlersDataPoint(ts pcommon.Timestamp, inputVal string, handlerAttributeValue AttributeHandler) error
- func (mb *MetricsBuilder) RecordMysqlIndexIoWaitCountDataPoint(ts pcommon.Timestamp, val int64, ...)
- func (mb *MetricsBuilder) RecordMysqlIndexIoWaitTimeDataPoint(ts pcommon.Timestamp, val int64, ...)
- func (mb *MetricsBuilder) RecordMysqlLockedConnectsDataPoint(ts pcommon.Timestamp, inputVal string) error
- func (mb *MetricsBuilder) RecordMysqlLocksDataPoint(ts pcommon.Timestamp, inputVal string, locksAttributeValue AttributeLocks) error
- func (mb *MetricsBuilder) RecordMysqlLogOperationsDataPoint(ts pcommon.Timestamp, inputVal string, ...) error
- func (mb *MetricsBuilder) RecordMysqlMysqlxWorkerThreadsDataPoint(ts pcommon.Timestamp, inputVal string, ...) error
- func (mb *MetricsBuilder) RecordMysqlOpenedResourcesDataPoint(ts pcommon.Timestamp, inputVal string, ...) error
- func (mb *MetricsBuilder) RecordMysqlOperationsDataPoint(ts pcommon.Timestamp, inputVal string, ...) error
- func (mb *MetricsBuilder) RecordMysqlPageOperationsDataPoint(ts pcommon.Timestamp, inputVal string, ...) error
- func (mb *MetricsBuilder) RecordMysqlRowLocksDataPoint(ts pcommon.Timestamp, inputVal string, ...) error
- func (mb *MetricsBuilder) RecordMysqlRowOperationsDataPoint(ts pcommon.Timestamp, inputVal string, ...) error
- func (mb *MetricsBuilder) RecordMysqlSortsDataPoint(ts pcommon.Timestamp, inputVal string, sortsAttributeValue AttributeSorts) error
- func (mb *MetricsBuilder) RecordMysqlStatementEventCountDataPoint(ts pcommon.Timestamp, val int64, schemaAttributeValue string, ...)
- func (mb *MetricsBuilder) RecordMysqlStatementEventWaitTimeDataPoint(ts pcommon.Timestamp, val int64, schemaAttributeValue string, ...)
- func (mb *MetricsBuilder) RecordMysqlTableIoWaitCountDataPoint(ts pcommon.Timestamp, val int64, ...)
- func (mb *MetricsBuilder) RecordMysqlTableIoWaitTimeDataPoint(ts pcommon.Timestamp, val int64, ...)
- func (mb *MetricsBuilder) RecordMysqlThreadsDataPoint(ts pcommon.Timestamp, inputVal string, threadsAttributeValue AttributeThreads) error
- func (mb *MetricsBuilder) RecordMysqlTmpResourcesDataPoint(ts pcommon.Timestamp, inputVal string, ...) error
- func (mb *MetricsBuilder) Reset(options ...metricBuilderOption)
- type MetricsSettings
- type ResourceMetricsOption
Constants ¶
This section is empty.
Variables ¶
var MapAttributeBufferPoolData = map[string]AttributeBufferPoolData{ "dirty": AttributeBufferPoolDataDirty, "clean": AttributeBufferPoolDataClean, }
MapAttributeBufferPoolData is a helper map of string to AttributeBufferPoolData attribute value.
var MapAttributeBufferPoolOperations = map[string]AttributeBufferPoolOperations{ "read_ahead_rnd": AttributeBufferPoolOperationsReadAheadRnd, "read_ahead": AttributeBufferPoolOperationsReadAhead, "read_ahead_evicted": AttributeBufferPoolOperationsReadAheadEvicted, "read_requests": AttributeBufferPoolOperationsReadRequests, "reads": AttributeBufferPoolOperationsReads, "wait_free": AttributeBufferPoolOperationsWaitFree, "write_requests": AttributeBufferPoolOperationsWriteRequests, }
MapAttributeBufferPoolOperations is a helper map of string to AttributeBufferPoolOperations attribute value.
var MapAttributeBufferPoolPages = map[string]AttributeBufferPoolPages{ "data": AttributeBufferPoolPagesData, "free": AttributeBufferPoolPagesFree, "misc": AttributeBufferPoolPagesMisc, }
MapAttributeBufferPoolPages is a helper map of string to AttributeBufferPoolPages attribute value.
var MapAttributeCommand = map[string]AttributeCommand{ "execute": AttributeCommandExecute, "close": AttributeCommandClose, "fetch": AttributeCommandFetch, "prepare": AttributeCommandPrepare, "reset": AttributeCommandReset, "send_long_data": AttributeCommandSendLongData, }
MapAttributeCommand is a helper map of string to AttributeCommand attribute value.
var MapAttributeDoubleWrites = map[string]AttributeDoubleWrites{ "pages_written": AttributeDoubleWritesPagesWritten, "writes": AttributeDoubleWritesWrites, }
MapAttributeDoubleWrites is a helper map of string to AttributeDoubleWrites attribute value.
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.
var MapAttributeHandler = map[string]AttributeHandler{ "commit": AttributeHandlerCommit, "delete": AttributeHandlerDelete, "discover": AttributeHandlerDiscover, "external_lock": AttributeHandlerExternalLock, "mrr_init": AttributeHandlerMrrInit, "prepare": AttributeHandlerPrepare, "read_first": AttributeHandlerReadFirst, "read_key": AttributeHandlerReadKey, "read_last": AttributeHandlerReadLast, "read_next": AttributeHandlerReadNext, "read_prev": AttributeHandlerReadPrev, "read_rnd": AttributeHandlerReadRnd, "read_rnd_next": AttributeHandlerReadRndNext, "rollback": AttributeHandlerRollback, "savepoint": AttributeHandlerSavepoint, "savepoint_rollback": AttributeHandlerSavepointRollback, "update": AttributeHandlerUpdate, "write": AttributeHandlerWrite, }
MapAttributeHandler is a helper map of string to AttributeHandler attribute value.
var MapAttributeIoWaitsOperations = map[string]AttributeIoWaitsOperations{ "delete": AttributeIoWaitsOperationsDelete, "fetch": AttributeIoWaitsOperationsFetch, "insert": AttributeIoWaitsOperationsInsert, "update": AttributeIoWaitsOperationsUpdate, }
MapAttributeIoWaitsOperations is a helper map of string to AttributeIoWaitsOperations attribute value.
var MapAttributeLocks = map[string]AttributeLocks{ "immediate": AttributeLocksImmediate, "waited": AttributeLocksWaited, }
MapAttributeLocks is a helper map of string to AttributeLocks attribute value.
var MapAttributeLogOperations = map[string]AttributeLogOperations{ "waits": AttributeLogOperationsWaits, "write_requests": AttributeLogOperationsWriteRequests, "writes": AttributeLogOperationsWrites, }
MapAttributeLogOperations is a helper map of string to AttributeLogOperations attribute value.
var MapAttributeMysqlxThreads = map[string]AttributeMysqlxThreads{ "available": AttributeMysqlxThreadsAvailable, "active": AttributeMysqlxThreadsActive, }
MapAttributeMysqlxThreads is a helper map of string to AttributeMysqlxThreads attribute value.
var MapAttributeOpenedResources = map[string]AttributeOpenedResources{ "file": AttributeOpenedResourcesFile, "table_definition": AttributeOpenedResourcesTableDefinition, "table": AttributeOpenedResourcesTable, }
MapAttributeOpenedResources is a helper map of string to AttributeOpenedResources attribute value.
var MapAttributeOperations = map[string]AttributeOperations{ "fsyncs": AttributeOperationsFsyncs, "reads": AttributeOperationsReads, "writes": AttributeOperationsWrites, }
MapAttributeOperations is a helper map of string to AttributeOperations attribute value.
var MapAttributePageOperations = map[string]AttributePageOperations{ "created": AttributePageOperationsCreated, "read": AttributePageOperationsRead, "written": AttributePageOperationsWritten, }
MapAttributePageOperations is a helper map of string to AttributePageOperations attribute value.
var MapAttributeRowLocks = map[string]AttributeRowLocks{ "waits": AttributeRowLocksWaits, "time": AttributeRowLocksTime, }
MapAttributeRowLocks is a helper map of string to AttributeRowLocks attribute value.
var MapAttributeRowOperations = map[string]AttributeRowOperations{ "deleted": AttributeRowOperationsDeleted, "inserted": AttributeRowOperationsInserted, "read": AttributeRowOperationsRead, "updated": AttributeRowOperationsUpdated, }
MapAttributeRowOperations is a helper map of string to AttributeRowOperations attribute value.
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.
var MapAttributeThreads = map[string]AttributeThreads{ "cached": AttributeThreadsCached, "connected": AttributeThreadsConnected, "created": AttributeThreadsCreated, "running": AttributeThreadsRunning, }
MapAttributeThreads is a helper map of string to AttributeThreads attribute value.
var MapAttributeTmpResource = map[string]AttributeTmpResource{ "disk_tables": AttributeTmpResourceDiskTables, "files": AttributeTmpResourceFiles, "tables": AttributeTmpResourceTables, }
MapAttributeTmpResource is a helper map of string to AttributeTmpResource attribute value.
Functions ¶
func WithStartTime ¶ added in v0.44.0
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
func (av AttributeBufferPoolOperations) String() string
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 AttributeCommand ¶ added in v0.39.0
type AttributeCommand int
AttributeCommand specifies the a value command attribute.
const ( AttributeCommandExecute AttributeCommand AttributeCommandClose AttributeCommandFetch AttributeCommandPrepare AttributeCommandReset AttributeCommandSendLongData )
func (AttributeCommand) String ¶ added in v0.51.0
func (av AttributeCommand) String() string
String returns the string representation of the AttributeCommand.
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 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 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 MetricSettings ¶ added in v0.44.0
type MetricSettings struct { Enabled bool `mapstructure:"enabled"` // contains filtered or unexported fields }
MetricSettings provides common settings for a particular metric.
func (*MetricSettings) IsEnabledProvidedByUser ¶ added in v0.63.0
func (ms *MetricSettings) IsEnabledProvidedByUser() bool
IsEnabledProvidedByUser returns true if `enabled` option is explicitly set in user settings to any value.
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 settings.
func NewMetricsBuilder ¶ added in v0.44.0
func NewMetricsBuilder(settings MetricsSettings, buildInfo component.BuildInfo, options ...metricBuilderOption) *MetricsBuilder
func (*MetricsBuilder) Emit ¶ added in v0.44.0
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 settings, 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) 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) 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) 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) RecordMysqlLockedConnectsDataPoint ¶ added in v0.62.0
func (mb *MetricsBuilder) RecordMysqlLockedConnectsDataPoint(ts pcommon.Timestamp, inputVal string) error
RecordMysqlLockedConnectsDataPoint adds a data point to mysql.locked_connects 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) 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) 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) 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) 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 MetricsSettings ¶ added in v0.44.0
type MetricsSettings struct { MysqlBufferPoolDataPages MetricSettings `mapstructure:"mysql.buffer_pool.data_pages"` MysqlBufferPoolLimit MetricSettings `mapstructure:"mysql.buffer_pool.limit"` MysqlBufferPoolOperations MetricSettings `mapstructure:"mysql.buffer_pool.operations"` MysqlBufferPoolPageFlushes MetricSettings `mapstructure:"mysql.buffer_pool.page_flushes"` MysqlBufferPoolPages MetricSettings `mapstructure:"mysql.buffer_pool.pages"` MysqlBufferPoolUsage MetricSettings `mapstructure:"mysql.buffer_pool.usage"` MysqlCommands MetricSettings `mapstructure:"mysql.commands"` MysqlDoubleWrites MetricSettings `mapstructure:"mysql.double_writes"` MysqlHandlers MetricSettings `mapstructure:"mysql.handlers"` MysqlIndexIoWaitCount MetricSettings `mapstructure:"mysql.index.io.wait.count"` MysqlIndexIoWaitTime MetricSettings `mapstructure:"mysql.index.io.wait.time"` MysqlLockedConnects MetricSettings `mapstructure:"mysql.locked_connects"` MysqlLocks MetricSettings `mapstructure:"mysql.locks"` MysqlLogOperations MetricSettings `mapstructure:"mysql.log_operations"` MysqlMysqlxWorkerThreads MetricSettings `mapstructure:"mysql.mysqlx_worker_threads"` MysqlOpenedResources MetricSettings `mapstructure:"mysql.opened_resources"` MysqlOperations MetricSettings `mapstructure:"mysql.operations"` MysqlPageOperations MetricSettings `mapstructure:"mysql.page_operations"` MysqlRowLocks MetricSettings `mapstructure:"mysql.row_locks"` MysqlRowOperations MetricSettings `mapstructure:"mysql.row_operations"` MysqlSorts MetricSettings `mapstructure:"mysql.sorts"` MysqlStatementEventCount MetricSettings `mapstructure:"mysql.statement_event.count"` MysqlStatementEventWaitTime MetricSettings `mapstructure:"mysql.statement_event.wait.time"` MysqlTableIoWaitCount MetricSettings `mapstructure:"mysql.table.io.wait.count"` MysqlTableIoWaitTime MetricSettings `mapstructure:"mysql.table.io.wait.time"` MysqlThreads MetricSettings `mapstructure:"mysql.threads"` MysqlTmpResources MetricSettings `mapstructure:"mysql.tmp_resources"` }
MetricsSettings provides settings for mysqlreceiver metrics.
func DefaultMetricsSettings ¶ added in v0.44.0
func DefaultMetricsSettings() MetricsSettings
type ResourceMetricsOption ¶ added in v0.52.0
type ResourceMetricsOption func(pmetric.ResourceMetrics)
ResourceMetricsOption applies changes to provided resource metrics.
func WithMysqlInstanceEndpoint ¶ added in v0.61.0
func WithMysqlInstanceEndpoint(val string) ResourceMetricsOption
WithMysqlInstanceEndpoint sets provided value as "mysql.instance.endpoint" attribute for current 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.