gRPC / status / metrics improvements #20
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.
Describe the purpose of your pull request
This PR contains the following:
Added
Option to turn on/off a gRPC health check service.
Option to turn gRPC server reflection on/off.
Option to control the keep-alive settings of the gRPC service.
Option to turn the main HTTP server off in case of gRPC-only usage.
Two more metric indicators were added:
configcat_grpc_rpc_duration_seconds
: Histogram of RPC calls (duration/count).method
: Name of the RPC service method.code
: Response status code.configcat_stream_msg_sent_total
: Total number of all messages sent with streaming.sdk
: The related SDK's identifier.type
:sse
orgrpc
.flag
: The flag's key that was evaluated.Detailed RPC debug logging for gRPC calls has been added. It is enabled automatically when the gRPC's logging option is set to
debug
.Changed
/status
endpoint's contentdown
andinitializing
. Each SDK node starts with theinitializing
status, and later, when initialized, it switches to one of the remaining (healthy
,degraded
, ordown
) statuses.The proxy's status becomes
down
when each SDK hasdown
status. It becomesdegraded
when at least onedegraded
ordown
SDK exists.down
means that the related SDK can't accept evaluation requests because it doesn't have a valid config JSON (neither from cache nor from the ConfigCat CDN) to work with.degraded
means that the related SDK has a valid config JSON in its memory or from the external cache, but the last two refresh attempts failed, so it might work with stale config JSON data.null
result through the built-up connection.Requirement checklist (only if applicable)