mongodbatlasreceiver

package module
v0.59.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: Apache-2.0 Imports: 33 Imported by: 8

README

MongoDB Atlas Receiver

Status
Stability beta
Supported pipeline types metrics, logs
Distributions contrib

Receives metrics from MongoDB Atlas via their monitoring APIs, as well as alerts via a configured webhook.

Getting Started

The MongoDB Atlas receiver takes the following parameters. public_key and private_key are the only two required values to receive metrics and logs and are obtained via the "API Keys" tab of the MongoDB Atlas Project Access Manager. In the example below both values are being pulled from the environment.

In order to collect logs, at least one project must be specified. By default, logs for all clusters within a project will be collected. Clusters can be limited using either the include_clusters or exclude_clusters setting.

MongoDB Atlas Documentation recommends a polling interval of 5 minutes.

  • public_key (required for metrics)
  • private_key (required for metrics)
  • granularity (default PT1M - See MongoDB Atlas Documentation)
  • retry_on_failure
    • enabled (default true)
    • initial_interval (default 5s)
    • max_interval (default 30s)
    • max_elapsed_time (default 5m)
  • alerts
    • enabled (default false)
    • secret (required if enabled)
    • endpoint (required if enabled)
    • tls
      • key_file
      • cert_file
  • logs
    • enabled (default false)
    • projects (required if enabled)
      • name (required if enabled)
      • collect_audit_logs (default false)
      • include_clusters (default empty)
      • exclude_clusters (default empty)

Examples:

Receive metrics:

receivers:
  mongodbatlas:
    public_key: ${MONGODB_ATLAS_PUBLIC_KEY}
    private_key: ${MONGODB_ATLAS_PRIVATE_KEY}

Receive alerts:

receivers:
  mongodbatlas:
    alerts:
      enabled: true
      secret: "some_secret"
      endpoint: "0.0.0.0:7706"

Receive logs:

receivers:
  mongodbatlas:
    logs:
      enabled: true
      projects: 
        - name: "project 1"
          collect_audit_logs: true

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory() component.ReceiverFactory

NewFactory creates a factory for MongoDB Atlas receiver

Types

type AlertConfig added in v0.54.0

type AlertConfig struct {
	Enabled  bool                        `mapstructure:"enabled"`
	Endpoint string                      `mapstructure:"endpoint"`
	Secret   string                      `mapstructure:"secret"`
	TLS      *configtls.TLSServerSetting `mapstructure:"tls"`
}

type Config

type Config struct {
	scraperhelper.ScraperControllerSettings `mapstructure:",squash"`
	PublicKey                               string                       `mapstructure:"public_key"`
	PrivateKey                              string                       `mapstructure:"private_key"`
	Granularity                             string                       `mapstructure:"granularity"`
	Metrics                                 metadata.MetricsSettings     `mapstructure:"metrics"`
	Alerts                                  AlertConfig                  `mapstructure:"alerts"`
	Logs                                    LogConfig                    `mapstructure:"logs"`
	RetrySettings                           exporterhelper.RetrySettings `mapstructure:"retry_on_failure"`
}

func (*Config) Validate added in v0.54.0

func (c *Config) Validate() error

type LogConfig added in v0.59.0

type LogConfig struct {
	Enabled  bool             `mapstructure:"enabled"`
	Projects []*ProjectConfig `mapstructure:"projects"`
}

type ProjectConfig added in v0.59.0

type ProjectConfig struct {
	Name            string   `mapstructure:"name"`
	ExcludeClusters []string `mapstructure:"exclude_clusters"`
	IncludeClusters []string `mapstructure:"include_clusters"`
	EnableAuditLogs bool     `mapstructure:"collect_audit_logs"`
}

type ProjectContext added in v0.59.0

type ProjectContext struct {
	Project mongodbatlas.Project
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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