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

Provide a way to set DistributionSummary config via builder #4781

Closed
minwoox opened this issue Mar 28, 2023 · 1 comment · Fixed by #4829
Closed

Provide a way to set DistributionSummary config via builder #4781

minwoox opened this issue Mar 28, 2023 · 1 comment · Fixed by #4829

Comments

@minwoox
Copy link
Member

minwoox commented Mar 28, 2023

Users need to use MoreMeters.setDistributionStatisticConfig(config) to specify the distribution config.
That means users cannot configure different configs depending on the client. Using the static class is also not intuitive and not the Armeria style which uses a builder for setting configuration.
We can probably do:

MetricCollectingClient.builder(meterIdPrefixFunction)
  .distributionStatisticConfig(config)
  ...

We can also add the getter to FlagsProvider:

public interface FlagsProvider {
  default DistributionStatisticConfig distributionStatisticConfig() { return null;}
}
@echo304
Copy link
Contributor

echo304 commented Apr 11, 2023

I will take this issue :) ✋

jrhee17 added a commit that referenced this issue Apr 2, 2024
Motivation:
As of now, users need to use
`MoreMeters.setDistributionStatisticConfig(config)` to specify the
distribution config.
It prevents users from configuring different configs depending on the
client.
This PR is to resolve above issue.

Modifications:

- Add `distributionStatisticConfig` getter to `FlagsProvider` and
`DefaultFlagsProvider`
- Add `distributionStatisticConfig` setter and getter to
`AbstractMetricCollectingBuilder`

Result:

- Closes #4781 
- User can specify custom Distribution Config with builder

<!--
Visit this URL to learn more about how to write a pull request
description:

https://armeria.dev/community/developer-guide#how-to-write-pull-request-description
-->

---------

Co-authored-by: minux <minu.song@linecorp.com>
Co-authored-by: jrhee17 <guins_j@guins.org>
Co-authored-by: Ikhun Um <ikhun.um@linecorp.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants