Skip to content

Conversation

@fmorency
Copy link
Contributor

@fmorency fmorency commented May 5, 2025

This pull request introduces a new project, manifest-node-exporter, which serves as a Prometheus metrics exporter for the Manifest Network node. It includes the addition of core functionality, command-line interface (CLI) commands, gRPC client integration, and licensing. Below is a summary of the most important changes grouped by theme.

Project Setup and Licensing:

  • Added an Apache License 2.0 to the project, defining terms for use, reproduction, and distribution of the code. (LICENSE, LICENSER1-R201)
  • Initialized the Go module with dependencies for Prometheus, gRPC, and CLI libraries in go.mod. (go.mod, go.modR1-R44)

CLI Commands:

  • Implemented the root command in cmd/root.go, which initializes the CLI, sets up logging, and binds configuration flags using viper. (cmd/root.go, cmd/root.goR1-R84)
  • Added the serve command in cmd/serve.go, which starts a Prometheus metrics server, integrates gRPC-based collectors, and supports graceful shutdown on signals. (cmd/serve.go, cmd/serve.goR1-R142)

gRPC Client and Collectors:

  • Created a GRPCClient in pkg/client/grpc_client.go for establishing and managing gRPC connections with support for TLS and keepalive parameters. (pkg/client/grpc_client.go, pkg/client/grpc_client.goR1-R52)
  • Added utility functions in pkg/collectors/grpc/common.go for validating gRPC clients and reporting Prometheus metrics. (pkg/collectors/grpc/common.go, pkg/collectors/grpc/common.goR1-R43)

Entry Point:

  • Added the main entry point in main.go to execute the CLI commands. (main.go, main.goR1-R7)

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces the manifest-node-exporter project, a Prometheus metrics exporter for the Manifest Network node, integrating a gRPC client and various metric collectors. Key changes include:

  • Project setup with Apache 2.0 licensing and Go module initialization
  • Addition of CLI commands (root and serve) for exporter startup with graceful shutdown
  • Implementation of gRPC-based collectors (token count, denom information) and a gRPC client for metric queries

Reviewed Changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pkg/config/serve.go Adds validation and loading of serve configuration options
pkg/collectors/grpc/token_count.go Implements a gRPC collector for token count metrics
pkg/collectors/grpc/registry.go Provides a registry for gRPC collectors with factory registration
pkg/collectors/grpc/denom_info_umfx.go Registers a collector for the fixed denom "umfx"
pkg/collectors/grpc/denom_info.go Implements a collector for denomination metadata and supply metrics
pkg/collectors/grpc/common.go Defines helper functions for metric reporting and gRPC client validation
pkg/client/grpc_client.go Creates the gRPC client with TLS and keepalive configuration
cmd/serve.go Implements the CLI “serve” command, initializing collectors, HTTP server, and handling shutdown
cmd/root.go Implements the root CLI command with logging configuration via Viper
LICENSE Adds the Apache License 2.0 document
Files not reviewed (1)
  • go.mod: Language not supported

@fmorency fmorency marked this pull request as ready for review May 5, 2025 17:34
@fmorency fmorency merged commit e1cf99a into manifest-network:main May 5, 2025
@fmorency fmorency deleted the grpc-collectors branch May 5, 2025 17:34
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.

1 participant