Skip to content

Conversation

@dehaansa
Copy link
Contributor

PR Description

Update the mongodb dependencies to get the update from aws-sdk to aws-sdk-v2 for #2936 . There may be a few new metrics, but appear to be no other user facing changes.

  • CHANGELOG.md updated

@dehaansa dehaansa requested a review from a team as a code owner September 15, 2025 21:13
@kgeckhart
Copy link
Contributor

kgeckhart commented Sep 16, 2025

Looking at the test failure it seems like this somehow changed the output ordering for the test 🤔

FAIL: TestConvert/integrations.yaml and FAIL: TestConvert/integrations_v2.yaml

-prometheus.exporter.mongodb "integrations_mongodb_exporter" {
            	            	-	mongodb_uri      = "mongodb://mongodb-a:27017"
            	            	-	direct_connect   = true
            	            	-	discovering_mode = true
            	            	-}
            	            	-
            	            	-discovery.relabel "integrations_mongodb_exporter" {
            	            	-	targets = prometheus.exporter.mongodb.integrations_mongodb_exporter.targets
            	            	-
            	            	-	rule {
            	            	-		source_labels = ["__address__"]
            	            	-		target_label  = "service_name"
            	            	-		replacement   = "replicaset1-node1"
            	            	-	}
            	            	-
            	            	-	rule {
            	            	-		source_labels = ["__address__"]
            	            	-		target_label  = "mongodb_cluster"
            	            	-		replacement   = "prod-cluster"
            	            	-	}
            	            	-
            	            	-	rule {
            	            	-		target_label = "instance"
            	            	-		replacement  = "instance-key-value"
            	            	-	}
            	            	-
            	            	-	rule {
            	            	-		target_label = "job"
            	            	-		replacement  = "integrations/mongodb_exporter"
            	            	-	}
            	            	-}
            	            	-
            	            	-prometheus.scrape "integrations_mongodb_exporter" {
            	            	-	targets    = discovery.relabel.integrations_mongodb_exporter.output
            	            	-	forward_to = [prometheus.remote_write.integrations.receiver]
            	            	-	job_name   = "integrations/mongodb_exporter"
            	            	-
            	            	-	tls_config {
            	            	-		ca_file   = "/something7.cert"
            	            	-		cert_file = "/something8.cert"
            	            	-		key_file  = "/something9.cert"
            	            	-	}
            	            	-}
            	            	-
            	            	 prometheus.exporter.mssql "integrations_mssql" {
            	            	@@ -786 +742,45 @@
            	            	 
            	            	+prometheus.exporter.mongodb "integrations_mongodb_exporter" {
            	            	+	mongodb_uri      = "mongodb://mongodb-a:27017"
            	            	+	direct_connect   = true
            	            	+	discovering_mode = true
            	            	+}
            	            	+
            	            	+discovery.relabel "integrations_mongodb_exporter" {
            	            	+	targets = prometheus.exporter.mongodb.integrations_mongodb_exporter.targets
            	            	+
            	            	+	rule {
            	            	+		source_labels = ["__address__"]
            	            	+		target_label  = "service_name"
            	            	+		replacement   = "replicaset1-node1"
            	            	+	}
            	            	+
            	            	+	rule {
            	            	+		source_labels = ["__address__"]
            	            	+		target_label  = "mongodb_cluster"
            	            	+		replacement   = "prod-cluster"
            	            	+	}
            	            	+
            	            	+	rule {
            	            	+		target_label = "instance"
            	            	+		replacement  = "instance-key-value"
            	            	+	}
            	            	+
            	            	+	rule {
            	            	+		target_label = "job"
            	            	+		replacement  = "integrations/mongodb_exporter"
            	            	+	}
            	            	+}
            	            	+
            	            	+prometheus.scrape "integrations_mongodb_exporter" {
            	            	+	targets    = discovery.relabel.integrations_mongodb_exporter.output
            	            	+	forward_to = [prometheus.remote_write.integrations.receiver]
            	            	+	job_name   = "integrations/mongodb_exporter"
            	            	+
            	            	+	tls_config {
            	            	+		ca_file   = "/something7.cert"
            	            	+		cert_file = "/something8.cert"
            	            	+		key_file  = "/something9.cert"
            	            	+	}
            	            	+}
            	            	+

@dehaansa
Copy link
Contributor Author

Looking at the test failure it seems like this somehow changed the output ordering for the test 🤔

Well that's... very strange. I don't see any reason why that happened, I was able to reproduce it locally so I guess I'll keep digging.

@github-actions
Copy link
Contributor

🔍 Dependency Review

github.com/percona/mongodb_exporter v0.45.1-0.20250630080259-d761c954bba6 → v0.47.1 — ⚠️ Needs Review

Summary:

  • No API-breaking changes were introduced between v0.45.x and v0.47.1 for the library surface typically used by embedding the exporter (e.g., creating an exporter with a config and registering collectors).
  • Changes across these releases primarily add new optional functionality (notably PBM/backup-related metrics) and bug fixes.
  • Your repository’s config/testdata for prometheus.exporter.mongodb did not require structural changes in this PR, which is consistent with a non-breaking bump.

What to check in your code:

  • If you construct the exporter via code (as opposed to only using the Alloy component), verify the Exporter/Config types you use still compile unchanged. No changes are expected, but double-check if you reference:
    • Collector settings (e.g., enabling/disabling named collectors).
    • Diagnostic/cluster-level options.
  • If you explicitly manage the list of enabled/disabled collectors, v0.46+ includes new optional backup/PBM-related collectors. These remain opt-in, but if you rely on a whitelist/blacklist, ensure naming matches current collector names.

Likely code changes required:

  • None detected. Keep existing calls as-is. Example (illustrative) config construction remains valid:
- exp, err := exporter.New(exporter.Config{
-   URI:             cfg.MongoURI,
-   DirectConnect:   cfg.DirectConnect,
-   DiscoveringMode: cfg.DiscoveringMode,
-   // CollectorsEnabled / Disabled unchanged
- })
+ exp, err := exporter.New(exporter.Config{
+   URI:             cfg.MongoURI,
+   DirectConnect:   cfg.DirectConnect,
+   DiscoveringMode: cfg.DiscoveringMode,
+   // If you want new backup/PBM metrics, explicitly enable the relevant collector(s).
+   // Otherwise, leave as-is to preserve current behavior.
+ })

Why “Needs Review” (not “Safe”):

  • New optional collectors were introduced (backup/PBM) and bring new transitive deps (minio-go, mongo-tools, percona-backup-mongodb). While not breaking, this can:
    • Increase binary size and transitive surface.
    • Change runtime behavior if you programmatically enable “collect all” or specific collectors by name.
    • Affect scrape cardinality if you opt into new collectors.

Evidence:

Action items:

  • If you only use the Alloy prometheus.exporter.mongodb component and do not enable new collectors: no code changes are required.
  • If you enable collectors programmatically or via config, review the collector names you pass and opt in to new functionality only if desired.

Notes

  • Several indirect dependencies were added or updated (e.g., cel.dev/expr, cloud.google.com/go/storage, github.com/minio/minio-go/v7, github.com/rs/xid, github.com/spiffe/go-spiffe/v2, github.com/zeebo/errs). These are transitive and part of new optional exporter functionality; no direct code changes are indicated for this repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants