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

[metrics] Add a more precise histogram implementation #4601

Merged
merged 6 commits into from
Sep 16, 2022
Merged

[metrics] Add a more precise histogram implementation #4601

merged 6 commits into from
Sep 16, 2022

Commits on Sep 16, 2022

  1. [metrics] Add a more precise histogram implementation

    Prometheus histogram implementation requires specifying buckets and reported histogram therefore is not very precise.
    
    The implementation in this PR takes different approach and calculates 'true' histogram by ordering data points.
    
    This approach is more expensive but provides better data and does not require specifying buckets in advance. For things like aggregating network latencies this seems like a better trade off, as it will show outliers better(e.g. there is no 'cut off' on the histogram) and calculate more exact values.
    
    There are more details on caveats and potential usages in documentation for HistogramVec struct.
    
    Current PR also replaces histogram in only one place(SafeClient) for now, hopefully we can see some better data from that.
    andll committed Sep 16, 2022
    Configuration menu
    Copy the full SHA
    8a392b8 View commit details
    Browse the repository at this point in the history
  2. Count sum + count

    andll committed Sep 16, 2022
    Configuration menu
    Copy the full SHA
    3a8af35 View commit details
    Browse the repository at this point in the history
  3. Add unit test

    andll committed Sep 16, 2022
    Configuration menu
    Copy the full SHA
    3fec088 View commit details
    Browse the repository at this point in the history
  4. Add licence header

    andll committed Sep 16, 2022
    Configuration menu
    Copy the full SHA
    779eb15 View commit details
    Browse the repository at this point in the history
  5. Reset counters

    andll committed Sep 16, 2022
    Configuration menu
    Copy the full SHA
    de82a17 View commit details
    Browse the repository at this point in the history
  6. Address feedback

    andll committed Sep 16, 2022
    Configuration menu
    Copy the full SHA
    dda9f45 View commit details
    Browse the repository at this point in the history