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

Add AC hit rate metrics with prometheus labels (alternative implementation with decorator) #358

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Sep 26, 2020

  1. Add AC hit rate metrics with prometheus labels

    This is a draft, not ready to be merged. I wait with test cases until
    getting feedback about the main functionality.
    
    Same functionality as in buchgr#350
    
     - Prometheus counter for cache hit ratio of only AC requests.
    
     - Support for prometheus labels based on custom HTTP and gRPC headers.
    
    but implemented in an alternative way:
    
     - disk.io implements two interfaces: cache.CasAcCache, cache.Stats
    
     - cache.metricsdecorator is decorator for cache.CasAcCache and
       provides prometheus metrics.
    
    Pros with this alternative implementation:
    
     - Should allow non-prometheus metrics as requested in
       buchgr#355
    
     - Avoid the question about if the counters should be placed in
       disk.go or http.go/grpc*.go. If placing in disk.go, there are
       issues about how to avoid incrementing counter twice for the
       same request (both in Get and in GetValidatedActionResult)
       and at the same time count found AC but missing CAS, as cache miss.
    
     - Makes headers available also for logic in disk.go, which could be
       useful for other functionality in the future.
    
     - Metrics can be separated from logging, and still not require
       injecting counter increment invocations in tons of places.
       Incrementing from a few well defined places minimize the risk
       for bugs in the metrics.
    ulrfa committed Sep 26, 2020
    Configuration menu
    Copy the full SHA
    4b2b8b2 View commit details
    Browse the repository at this point in the history

Commits on Sep 27, 2020

  1. refactor cache interfaces

    ulrfa committed Sep 27, 2020
    Configuration menu
    Copy the full SHA
    7f54961 View commit details
    Browse the repository at this point in the history