GoogleCloudPlatform / prometheus-engine

Google Cloud Managed Service for Prometheus libraries and manifests.
https://g.co/cloud/managedprometheus
Apache License 2.0
191 stars 89 forks source link

refactor: cleanup export flags #1001

Closed TheSpiritXIII closed 2 months ago

TheSpiritXIII commented 3 months ago

This PR cleans up all export flags so that:

Changes:

I also broke up the monstrosity that was the setup package exporter constructor which returned a function that would create an exporter. The reason this was done was because first we setup flags and then returned a method that would create the exporter once the flags were parsed. Now you can just call SetupFlags and then call exporter.New.

Tested a Prometheus version built with these changes with e2e tests, and they pass.

TheSpiritXIII commented 2 months ago

For ease of making this PR easier to review, I split up the rule-evaluator refactors to this PR: https://github.com/GoogleCloudPlatform/prometheus-engine/pull/1058