Skip to content

[prometheus] Separate prometheus server startup from service logic#523

Draft
dean-amar wants to merge 3 commits intohyperledger:mainfrom
dean-amar:extract-prometheus-startup-and-grpc-server-start
Draft

[prometheus] Separate prometheus server startup from service logic#523
dean-amar wants to merge 3 commits intohyperledger:mainfrom
dean-amar:extract-prometheus-startup-and-grpc-server-start

Conversation

@dean-amar
Copy link
Copy Markdown
Contributor

Type of change

  • Improvement (improvement to code, performance, etc)

Description

This PR refactors the Prometheus monitoring server startup logic across all services to improve code organization and lifecycle management. Previously, each service started its monitoring server internally within its Run() method.
Now, monitoring server lifecycle is explicitly managed separately from service logic.

Related issues

…tartup lifecycle.

* Removed unused code.

Signed-off-by: Dean Amar <Dean.Amar@ibm.com>
Signed-off-by: Dean Amar <Dean.Amar@ibm.com>
@dean-amar dean-amar changed the title [prometheus] Extract prometheus startup and grpc server start [prometheus] Separate prometheus server startup from service logic Apr 6, 2026
Signed-off-by: Dean Amar <Dean.Amar@ibm.com>
@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 91.286% (-0.1%) from 91.382%
when pulling 7ef30d6 on dean-amar:extract-prometheus-startup-and-grpc-server-start
into ae7a02f on hyperledger:main.

// StartMonitoringServer starts the Prometheus monitoring server.
// This method blocks until the server exits or the context is cancelled.
// Monitoring server errors are logged but do not cause the service to stop.
StartMonitoringServer(ctx context.Context) error
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

StartMonitoringServer is starting a http server. I am not sure whether this should be part of grpcservice.

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.

[metrics] Extract monitoring server startup from service implementation

3 participants