Documentation ¶
Index ¶
- Variables
- func WithStartTime(startTime pdata.Timestamp) metricBuilderOption
- type MetricSettings
- type MetricsBuilder
- func (mb *MetricsBuilder) Emit(metrics pdata.MetricSlice)
- func (mb *MetricsBuilder) EmitAdmin(metrics pdata.MetricSlice)
- func (mb *MetricsBuilder) EmitDatabase(metrics pdata.MetricSlice)
- func (mb *MetricsBuilder) RecordMongodbCacheOperationsDataPoint(ts pdata.Timestamp, val int64, typeAttributeValue string)
- func (mb *MetricsBuilder) RecordMongodbCollectionCountDataPoint(ts pdata.Timestamp, val int64, databaseAttributeValue string)
- func (mb *MetricsBuilder) RecordMongodbConnectionCountDataPoint(ts pdata.Timestamp, val int64, databaseAttributeValue string, ...)
- func (mb *MetricsBuilder) RecordMongodbDataSizeDataPoint(ts pdata.Timestamp, val int64, databaseAttributeValue string)
- func (mb *MetricsBuilder) RecordMongodbExtentCountDataPoint(ts pdata.Timestamp, val int64, databaseAttributeValue string)
- func (mb *MetricsBuilder) RecordMongodbGlobalLockTimeDataPoint(ts pdata.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordMongodbIndexCountDataPoint(ts pdata.Timestamp, val int64, databaseAttributeValue string)
- func (mb *MetricsBuilder) RecordMongodbIndexSizeDataPoint(ts pdata.Timestamp, val int64, databaseAttributeValue string)
- func (mb *MetricsBuilder) RecordMongodbMemoryUsageDataPoint(ts pdata.Timestamp, val int64, databaseAttributeValue string, ...)
- func (mb *MetricsBuilder) RecordMongodbObjectCountDataPoint(ts pdata.Timestamp, val int64, databaseAttributeValue string)
- func (mb *MetricsBuilder) RecordMongodbOperationCountDataPoint(ts pdata.Timestamp, val int64, operationAttributeValue string)
- func (mb *MetricsBuilder) RecordMongodbStorageSizeDataPoint(ts pdata.Timestamp, val int64, databaseAttributeValue string)
- func (mb *MetricsBuilder) Reset(options ...metricBuilderOption)
- type MetricsSettings
Constants ¶
This section is empty.
Variables ¶
var A = Attributes
A is an alias for Attributes.
var AttributeConnectionType = struct { Active string Available string Current string }{ "active", "available", "current", }
AttributeConnectionType are the possible values that the attribute "connection_type" can have.
var AttributeMemoryType = struct { Resident string Virtual string }{ "resident", "virtual", }
AttributeMemoryType are the possible values that the attribute "memory_type" can have.
var AttributeOperation = struct { Insert string Query string Update string Delete string Getmore string Command string }{ "insert", "query", "update", "delete", "getmore", "command", }
AttributeOperation are the possible values that the attribute "operation" can have.
var AttributeType = struct { Hit string Miss string }{ "hit", "miss", }
AttributeType are the possible values that the attribute "type" can have.
var Attributes = struct { // ConnectionType (The status of the connection.) ConnectionType string // Database (The name of a database.) Database string // MemoryType (The type of memory used.) MemoryType string // Operation (The MongoDB operation being counted.) Operation string // Type (The result of a cache request.) Type string }{ "type", "database", "type", "operation", "type", }
Attributes contains the possible metric attributes that can be used.
Functions ¶
func WithStartTime ¶
WithStartTime sets startTime on the metrics builder.
Types ¶
type MetricSettings ¶
type MetricSettings struct {
Enabled bool `mapstructure:"enabled"`
}
MetricSettings provides common settings 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 settings.
func NewMetricsBuilder ¶
func NewMetricsBuilder(settings MetricsSettings, options ...metricBuilderOption) *MetricsBuilder
func (*MetricsBuilder) Emit ¶
func (mb *MetricsBuilder) Emit(metrics pdata.MetricSlice)
Emit appends generated metrics to a pdata.MetricsSlice and updates the internal state to be ready for recording another set of data points. This function will be doing all transformations required to produce metric representation defined in metadata and user settings, e.g. delta/cumulative translation.
func (*MetricsBuilder) EmitAdmin ¶
func (mb *MetricsBuilder) EmitAdmin(metrics pdata.MetricSlice)
func (*MetricsBuilder) EmitDatabase ¶
func (mb *MetricsBuilder) EmitDatabase(metrics pdata.MetricSlice)
func (*MetricsBuilder) RecordMongodbCacheOperationsDataPoint ¶
func (mb *MetricsBuilder) RecordMongodbCacheOperationsDataPoint(ts pdata.Timestamp, val int64, typeAttributeValue string)
RecordMongodbCacheOperationsDataPoint adds a data point to mongodb.cache.operations metric.
func (*MetricsBuilder) RecordMongodbCollectionCountDataPoint ¶
func (mb *MetricsBuilder) RecordMongodbCollectionCountDataPoint(ts pdata.Timestamp, val int64, databaseAttributeValue string)
RecordMongodbCollectionCountDataPoint adds a data point to mongodb.collection.count metric.
func (*MetricsBuilder) RecordMongodbConnectionCountDataPoint ¶
func (mb *MetricsBuilder) RecordMongodbConnectionCountDataPoint(ts pdata.Timestamp, val int64, databaseAttributeValue string, connectionTypeAttributeValue string)
RecordMongodbConnectionCountDataPoint adds a data point to mongodb.connection.count metric.
func (*MetricsBuilder) RecordMongodbDataSizeDataPoint ¶
func (mb *MetricsBuilder) RecordMongodbDataSizeDataPoint(ts pdata.Timestamp, val int64, databaseAttributeValue string)
RecordMongodbDataSizeDataPoint adds a data point to mongodb.data.size metric.
func (*MetricsBuilder) RecordMongodbExtentCountDataPoint ¶
func (mb *MetricsBuilder) RecordMongodbExtentCountDataPoint(ts pdata.Timestamp, val int64, databaseAttributeValue string)
RecordMongodbExtentCountDataPoint adds a data point to mongodb.extent.count metric.
func (*MetricsBuilder) RecordMongodbGlobalLockTimeDataPoint ¶
func (mb *MetricsBuilder) RecordMongodbGlobalLockTimeDataPoint(ts pdata.Timestamp, val int64)
RecordMongodbGlobalLockTimeDataPoint adds a data point to mongodb.global_lock.time metric.
func (*MetricsBuilder) RecordMongodbIndexCountDataPoint ¶
func (mb *MetricsBuilder) RecordMongodbIndexCountDataPoint(ts pdata.Timestamp, val int64, databaseAttributeValue string)
RecordMongodbIndexCountDataPoint adds a data point to mongodb.index.count metric.
func (*MetricsBuilder) RecordMongodbIndexSizeDataPoint ¶
func (mb *MetricsBuilder) RecordMongodbIndexSizeDataPoint(ts pdata.Timestamp, val int64, databaseAttributeValue string)
RecordMongodbIndexSizeDataPoint adds a data point to mongodb.index.size metric.
func (*MetricsBuilder) RecordMongodbMemoryUsageDataPoint ¶
func (mb *MetricsBuilder) RecordMongodbMemoryUsageDataPoint(ts pdata.Timestamp, val int64, databaseAttributeValue string, memoryTypeAttributeValue string)
RecordMongodbMemoryUsageDataPoint adds a data point to mongodb.memory.usage metric.
func (*MetricsBuilder) RecordMongodbObjectCountDataPoint ¶
func (mb *MetricsBuilder) RecordMongodbObjectCountDataPoint(ts pdata.Timestamp, val int64, databaseAttributeValue string)
RecordMongodbObjectCountDataPoint adds a data point to mongodb.object.count metric.
func (*MetricsBuilder) RecordMongodbOperationCountDataPoint ¶
func (mb *MetricsBuilder) RecordMongodbOperationCountDataPoint(ts pdata.Timestamp, val int64, operationAttributeValue string)
RecordMongodbOperationCountDataPoint adds a data point to mongodb.operation.count metric.
func (*MetricsBuilder) RecordMongodbStorageSizeDataPoint ¶
func (mb *MetricsBuilder) RecordMongodbStorageSizeDataPoint(ts pdata.Timestamp, val int64, databaseAttributeValue string)
RecordMongodbStorageSizeDataPoint adds a data point to mongodb.storage.size 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 MetricsSettings ¶
type MetricsSettings struct { MongodbCacheOperations MetricSettings `mapstructure:"mongodb.cache.operations"` MongodbCollectionCount MetricSettings `mapstructure:"mongodb.collection.count"` MongodbConnectionCount MetricSettings `mapstructure:"mongodb.connection.count"` MongodbDataSize MetricSettings `mapstructure:"mongodb.data.size"` MongodbExtentCount MetricSettings `mapstructure:"mongodb.extent.count"` MongodbGlobalLockTime MetricSettings `mapstructure:"mongodb.global_lock.time"` MongodbIndexCount MetricSettings `mapstructure:"mongodb.index.count"` MongodbIndexSize MetricSettings `mapstructure:"mongodb.index.size"` MongodbMemoryUsage MetricSettings `mapstructure:"mongodb.memory.usage"` MongodbObjectCount MetricSettings `mapstructure:"mongodb.object.count"` MongodbOperationCount MetricSettings `mapstructure:"mongodb.operation.count"` MongodbStorageSize MetricSettings `mapstructure:"mongodb.storage.size"` }
MetricsSettings provides settings for mongodbreceiver metrics.
func DefaultMetricsSettings ¶
func DefaultMetricsSettings() MetricsSettings