mongodb_exporter

package
v1.3.191 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(logger log.Logger, c *Config) (integrations.Integration, error)

New creates a new mongodb_exporter integration.

func NewLogger

func NewLogger(logger log.Logger, opts ...Option) *logrus.Logger

NewLogger transalates log.Logger to logrus.Logger

Types

type Config

type Config struct {
	// MongoDB connection URI. example:mongodb://user:[email protected]:27017/admin?ssl=true"
	URI config_util.Secret `yaml:"mongodb_uri"`
}

Config controls mongodb_exporter

func (*Config) InstanceKey added in v0.21.0

func (c *Config) InstanceKey(_ string) (string, error)

InstanceKey returns the address:port of the mongodb server being queried.

func (*Config) Name

func (c *Config) Name() string

Name returns the name of the integration that this config represents.

func (*Config) NewIntegration

func (c *Config) NewIntegration(logger log.Logger) (integrations.Integration, error)

NewIntegration creates a new mongodb_exporter

func (*Config) UnmarshalYAML

func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements yaml.Unmarshaler for Config

type Option

type Option func(*output)

Option Exposes logging options

func WithTimestampFromLogrus

func WithTimestampFromLogrus() Option

WithTimestampFromLogrus sets tsFromLogrus logging option

Jump to

Keyboard shortcuts

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