sile/fibers_http_server

The buckets of request_duration_seconds metrics should be configurable

Closed this issue · 3 comments

Purpose

Exposes an API which can be used to set the buckets for request_duration_seconds.

code:

request_duration_seconds: builder

The required number of buckets for request_duration_seconds metrics differs depending on an environment, so fibers_http_server exposes an API, with which we can set the buckets for request_duration_seconds directly.

For example, we need the following buckets:

            request_duration_seconds: builder
                .histogram("request_duration_seconds")
                .help("Requests processing duration")
                .bucket(0.001)
                .bucket(0.005)
                .bucket(0.01)
                .bucket(0.05)
                .bucket(0.1)
                .bucket(0.4)
                .bucket(0.8)
                .bucket(1.0)
                .bucket(2.0)
                .bucket(4.0)
                .bucket(6.0)
                .bucket(8.0)
                .bucket(10.0)
                .bucket(50.0)
                .finish()
                .expect("Never fails"),
sile commented

Sounds good. I'll address this feature request (probably sometime this month).

We'd like to have this functionality in the near future, so I'll take care of implementing this if it's inconvenient for you to do it in a few days.

sile commented

@koba-e964 Thanks! It is very wellcome!