This repository has been archived by the owner on Apr 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 164
Decouple registration from grpc.Server implementation #17
Open
ppg
wants to merge
6
commits into
grpc-ecosystem:master
Choose a base branch
from
ppg:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ab08d00
Add RegisterServiceInfo to decouple Register from grpc.Server.
ppg a47cc0d
Accept Server interface for Register to allow flexibility.
ppg 8d96c0f
[CR] Use private interface and only support Register
ppg 1cfc0ff
Merge remote-tracking branch 'upstream/master'
ppg d50de4f
[CR] Address feedback on godoc comments
ppg f7df608
Merge remote-tracking branch 'upstream/master'
ppg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,9 +129,9 @@ func (m *ServerMetrics) StreamServerInterceptor() func(srv interface{}, ss grpc. | |
} | ||
|
||
// InitializeMetrics initializes all metrics, with their appropriate null | ||
// value, for all gRPC methods registered on a gRPC server. This is useful, to | ||
// value, for all gRPC methods registered on a prometheusServer. This is useful, to | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please keep this as gRPC server. |
||
// ensure that all metrics exist when collecting and querying. | ||
func (m *ServerMetrics) InitializeMetrics(server *grpc.Server) { | ||
func (m *ServerMetrics) InitializeMetrics(server prometheusServer) { | ||
serviceInfo := server.GetServiceInfo() | ||
for serviceName, info := range serviceInfo { | ||
for _, mInfo := range info.Methods { | ||
|
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.
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.
In general please talk about gRPC.Server and mention ("or any compatible type"), so it is clear for most users.