Skip to content
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

gRPC / status / metrics improvements #20

Merged
merged 11 commits into from
Mar 14, 2024

Conversation

z4kn4fein
Copy link
Member

@z4kn4fein z4kn4fein commented Mar 13, 2024

Describe the purpose of your pull request

This PR contains the following:

Added

  • Option to turn on/off a gRPC health check service.

    grpc:
      health_check_enabled: true # default: true
  • Option to turn gRPC server reflection on/off.

    grpc:
      server_reflection_enabled: true # default: false
  • Option to control the keep-alive settings of the gRPC service.

    grpc:
      keep_alive: 
        # these values are only examples
        max_connection_idle: 15 # If a client is idle for 15 seconds, send a GOAWAY
        max_connection_age: 30 # If any connection is alive for more than 30 seconds, send a GOAWAY
        max_connection_age_grace: 5 # Allow 5 seconds for pending RPCs to complete before forcibly closing connections
        time: 5 # Ping the client if it is idle for 5 seconds to ensure the connection is still active
        timeout: 1 # Wait 1 second for the ping ack before assuming the connection is dead
  • Option to turn the main HTTP server off in case of gRPC-only usage.

    http:
      enabled: false # default: true
  • Two more metric indicators were added:

    • configcat_grpc_rpc_duration_seconds: Histogram of RPC calls (duration/count).
      • Tags:
        • method: Name of the RPC service method.
        • code: Response status code.
    • configcat_stream_msg_sent_total: Total number of all messages sent with streaming.
      • Tags:
        • sdk: The related SDK's identifier.
        • type: sse or grpc.
        • 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

  • Two more status indicators were added to the /status endpoint's content down and initializing. Each SDK node starts with the initializing status, and later, when initialized, it switches to one of the remaining (healthy, degraded, or down) statuses.
    The proxy's status becomes down when each SDK has down status. It becomes degraded when at least one degraded or down 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.
  • SSE and gRPC stream requests are now rejected when the related SDK doesn't have a valid config JSON to work with or when the requested feature flag key doesn't exist. These requests were accepted before but got a null result through the built-up connection.

Requirement checklist (only if applicable)

  • I have covered the applied changes with automated tests.
  • I have executed the full automated test set against my changes.
  • I have validated my changes against all supported platform versions.
  • I have read and accepted the contribution agreement.

@z4kn4fein z4kn4fein requested a review from a team as a code owner March 13, 2024 15:23
@z4kn4fein z4kn4fein mentioned this pull request Mar 13, 2024
3 tasks
Copy link

@z4kn4fein z4kn4fein merged commit 27566ea into main Mar 14, 2024
6 checks passed
@z4kn4fein z4kn4fein deleted the grpc-status-metrics-improvements branch March 14, 2024 12:58
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.

2 participants