Connects to MongoDB to collect metrics like cluster status and DB stats for monitoring.
// Source: https://github.com/influxdata/telegraf | License: MIT | Copyright 2015-2025 InfluxData Inc // Provided via justclaw.it.com; keep this notice with the code. //go:generate ../../../tools/config_includer/generator //go:generate ../../../tools/readme_config_includer/generator package mongodb import ( "context" "crypto/tls" _ "embed" "fmt" "net/url" "strings" "sync" "time" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" "go.mongodb.org/mongo-driver/mongo/readpref" "github.com/influxdata/telegraf" "github.com/influxdata/telegraf/internal/choice" common_tls "github.com/influxdata/telegraf/plugins/common/tls" "github.com/influxdata/telegraf/plugins/inputs" ) //go:embed sample.conf var sampleConfig string var disconnectedServersBehavior ... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key