Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCommandMonitor ¶
func NewCommandMonitor(opts ...Option) *event.CommandMonitor
NewCommandMonitor creates a event.CommandMonitor that exports metrics of Mongo commands. It also registers Prometheus collectors.
The following metrics are exported:
- Histogram of command duration. - Counter of command errors.
func NewPoolMonitor ¶
func NewPoolMonitor(opts ...PoolOption) *event.PoolMonitor
Types ¶
type Option ¶
type Option func(*Options)
func WithDurationBuckets ¶
WithDurationBuckets sets the duration buckets of commands.
func WithInstanceName ¶
WithInstanceName sets the name of the MongoDB instance.
func WithNamespace ¶
WithNamespace sets the namespace of all metrics.
type PoolConnectionsRepository ¶
type PoolConnectionsRepository struct {
// contains filtered or unexported fields
}
func (*PoolConnectionsRepository) Clear ¶
func (c *PoolConnectionsRepository) Clear()
func (*PoolConnectionsRepository) Get ¶
func (c *PoolConnectionsRepository) Get()
func (*PoolConnectionsRepository) Return ¶
func (c *PoolConnectionsRepository) Return()
func (*PoolConnectionsRepository) Value ¶
func (c *PoolConnectionsRepository) Value() int
type PoolOption ¶
type PoolOption func(*PoolOptions)
func PoolWithInstanceName ¶
func PoolWithInstanceName(name string) PoolOption
PoolWithInstanceName sets the name of the MongoDB instance.
func PoolWithNamespace ¶
func PoolWithNamespace(namespace string) PoolOption
PoolWithNamespace sets the namespace of all metrics.
type PoolOptions ¶
PoolOptions represents options to customize the exported metrics.
func DefaultPoolOptions ¶
func DefaultPoolOptions() *PoolOptions
DefaultPoolOptions returns the default options.
func (*PoolOptions) Merge ¶
func (options *PoolOptions) Merge(opts ...PoolOption)
Click to show internal directories.
Click to hide internal directories.