feat: geoip collector and refactor #6
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces several changes to the Manifest Node Exporter project, focusing on restructuring the codebase, adding a new GeoIP collector, and improving modularity. The most significant changes include reorganizing the
autodetectmodule, adding a GeoIP collector for geographical metrics, and updating dependencies.Codebase Restructuring and Modularity Improvements:
autodetectfunctionality into thepkg/collectors/autodetectdirectory to improve module organization. This includes renaming files and updating package declarations accordingly. [1] [2] [3] [4] [5]pkg/collectors/common.gofrom private to public for reuse across modules (e.g.,ReportUpMetric,ReportInvalidMetric,ValidateClient). [1] [2] [3]GeoIP Collector Addition:
GeoIPCollectorinpkg/collectors/geoip.goto gather geographical metrics (latitude, longitude, and location info) based on the node's public IP. This includes HTTP client setup, Prometheus metric descriptors, and data collection logic.servecommand by appending it to the list of collectors registered with Prometheus.Dependency Updates:
resty.dev/v3as a new dependency ingo.modto facilitate HTTP requests in the GeoIP collector.Documentation Enhancements:
README.mdfile for theautodetectmodule, providing an overview and purpose of the module's functionality.Code Adjustments for Collector Reusability:
ValidateClient,ReportUpMetric) in the renamedmanifestdcollectors to reflect their new location in thecollectorspackage. [1] [2] [3] [4]These changes collectively improve the modularity, functionality, and maintainability of the project.