MongoDB Metrics

Requirements

User from endpoint should have enough privileges for running serverStatus command.

Configuration Options

Required Options

endpoints(required)
TypeSyntaxDefaultExample
arrayliteral["mongodb://localhost:27017"]
type(required)

The component type. This is a required field for all components and tells Vector which component to use.

TypeSyntaxDefaultExample
stringliteral["mongodb_metrics"]

Advanced Options

scrape_interval_secs(optional)

The interval between scrapes.

TypeSyntaxDefaultExample
uint15
namespace(optional)

The namespace of metrics. Disabled if empty.

TypeSyntaxDefaultExample
stringliteralmongodb

How it Works

MongoDB `serverStatus` command

The serverStatus command returns a document that provides an overview of the database’s state. The output fields vary depending on the version of MongoDB, underlying operating system platform, the storage engine, and the kind of node, including mongos, mongod or replica set member.

State

This component is stateless, meaning its behavior is consistent across each input.

Context

By default, the mongodb_metrics source augments events with helpful context keys.