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

draft: return histograms for time metrics #1005

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Keksoj
Copy link
Member

@Keksoj Keksoj commented Oct 18, 2023

Up until now, time metrics were returned by Sōzu, and rendered in the CLI, as percentiles:

┌────────────────────────┬─────────┬──────┬──────┬──────┬───────┬────────┬─────────┬──────┐
│ Percentiles            │ samples │ p50  │ p90  │ p99  │ p99.9 │ p99.99 │ p99.999 │ p100 │
├────────────────────────┼─────────┼──────┼──────┼──────┼───────┼────────┼─────────┼──────┤
│ accept_queue.wait_time │ 6       │ 0    │ 0    │ 0    │ 0     │ 0      │ 0       │ 0    │
├────────────────────────┼─────────┼──────┼──────┼──────┼───────┼────────┼─────────┼──────┤
│ epoll_time             │ 40      │ 1000 │ 1001 │ 1001 │ 1001  │ 1001   │ 1001    │ 1001 │
├────────────────────────┼─────────┼──────┼──────┼──────┼───────┼────────┼─────────┼──────┤
│ event_loop_time        │ 40      │ 0    │ 0    │ 4    │ 4     │ 4      │ 4       │ 4    │
├────────────────────────┼─────────┼──────┼──────┼──────┼───────┼────────┼─────────┼──────┤
│ response_time          │ 6       │ 0    │ 0    │ 0    │ 0     │ 0      │ 0       │ 0    │
├────────────────────────┼─────────┼──────┼──────┼──────┼───────┼────────┼─────────┼──────┤
│ service_time           │ 6       │ 0    │ 0    │ 0    │ 0     │ 0      │ 0       │ 0    │
└────────────────────────┴─────────┴──────┴──────┴──────┴───────┴────────┴─────────┴──────┘

These percentiles are not convertible for a prometheus layer, however.

Since the time metrics are collected by sozu_lib's LocalDrain as hdrhistograms, why not return them in a histogram form as well? This would allow the Sozu prometheus connector to convert them to prometheus metrics.

This PR creates the protobuf type FilteredHistogram. Now, for each time metric:

  1. a Percentiles metric is produced, for instance response_time
  2. a FilteredHistogram is produced, named response_time_hist

@Keksoj Keksoj added this to the v0.16.0 milestone Oct 18, 2023
@Keksoj Keksoj added this to In progress in Roadmap via automation Oct 18, 2023
@Keksoj Keksoj self-assigned this Oct 18, 2023
@Keksoj
Copy link
Member Author

Keksoj commented Oct 26, 2023

Check issue #751 for inspiration

@Keksoj
Copy link
Member Author

Keksoj commented Nov 16, 2023

Actually I need to rebase the branch of PR #1004 into this one. #1004 refactors the display of metrics in a much cleaner way, and allows a way better display of JSON. This is crucial for development purposes.

@Keksoj Keksoj changed the base branch from main to fix-display-in-json-form November 16, 2023 21:35
@Keksoj Keksoj force-pushed the produce-histogram-metrics branch 3 times, most recently from f9a9218 to aa9df5f Compare November 20, 2023 12:05
@Keksoj Keksoj force-pushed the fix-display-in-json-form branch 2 times, most recently from f0ba2cd to 88fb8cb Compare November 27, 2023 14:19
@Keksoj Keksoj changed the base branch from fix-display-in-json-form to main January 24, 2024 09:38
@Keksoj Keksoj force-pushed the produce-histogram-metrics branch 2 times, most recently from bb9d9c8 to 8866640 Compare January 24, 2024 09:59
create local type MetricsMap
implement receive_metric function for local types
add error management
@Keksoj Keksoj changed the title return histograms for time metrics draft: return histograms for time metrics Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Roadmap
  
In progress
Development

Successfully merging this pull request may close these issues.

None yet

1 participant