-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make -grpc_prometheus work when not using a grpc server #15706
Conversation
Signed-off-by: Henry Robinson <[email protected]>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution. I am requesting some changes as it does not compile.
Could you also open a issue describing the issue you are seeing? We will then be able to remove the NeedsIssue
label.
Moreover, is it possible to add a test to validate this code?
// skip if not registered | ||
if gRPCPort == 0 { | ||
return | ||
} | ||
|
||
if grpccommon.EnableGRPCPrometheus { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks wrong as grpccommon.EnableGRPCPrometheus
is a function and not a boolean. I would suggest calling the function directly.
This PR is being marked as stale because it has been open for 30 days with no activity. To rectify, you may do any of the following:
If no action is taken within 7 days, this PR will be closed. |
This PR was closed because it has been stale for 7 days with no activity. |
--grpc_prometheus enables server and client gRPC metrics. But if we don't have a gRPC server, but call
servenv.Run()
(which we are doing in some internal tools to have theservenv
utilities available but without a gRPC server) the process will crash because of some uninitialized server state. Fix by moving the prom enable logic after the check to see if we actually have a server.