8000 histogram メトリクスの bucket を設定できるようにする by koba-e964 · Pull Request #260 · frugalos/frugalos · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

histogram メトリクスの bucket を設定できるようにする #260

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

Merged
merged 5 commits into from
Jan 9, 2020

Conversation

koba-e964
Copy link
Contributor
@koba-e964 koba-e964 commented Dec 6, 2019

Types of changes

Please check one of the following:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • New release (merge to both master and develop!)

Description of changes

Behavior

frugalos の設定ファイルの frugalos.fibers_http_server.request_duration_bucket_config が、HTTP レスポンス時間の histogram のバケツ設定を受け取れるようになる。(sile/fibers_http_server#3 の変更を取り込むため。)
また、scripts/setup_debug_cluster.shscripts/frugalos.yml を設定ファイルとして frugalos を起動するようになる。
また、 fibers_http_server が 0.1.8 から 0.1.12 にバージョンアップする (diff) ので、以下の副作用が入る:

Purpose

この実装を入れていない状態だと、バケツが 0.1, 0.5, 1.0, 5.0, ... という設定になっており、例えば 1.0 秒から 5.0 秒までかかるリクエストが全て同一視されてしまい、quantile クエリなどが正確でなくなるという問題があった。
この変更で、外部から見たい範囲のバケツを細かくするなどの調整ができるようになる。

Checklists

  • Run cargo fmt --all.
  • Run cargo clippy --all --all-targets.

@koba-e964 koba-e964 marked this pull request as ready for review December 6, 2019 09:02
brly
brly previously approved these changes Dec 10, 2019
@@ -19,6 +19,8 @@ TOLERABLE_FAULTS=${TOLERABLE_FAULTS:-$(( ($SERVER_COUNT / 2 - 1) >= 1 ? ($SERVER
# Note: $SERVER_COUNT + 1 は contact-server の分を $SERVER_COUNT に追加している。
DATA_FRAGMENTS=${DATA_FRAGMENTS:-$(( ($SERVER_COUNT + 1 - $TOLERABLE_FAULTS) >= 1 ? ($SERVER_COUNT + 1 - $TOLERABLE_FAULTS) : 1 ))}
FRUGALOS_START_FLAGS=${FRUGALOS_START_FLAGS:- --sampling-rate 1.0}
FRUGALOS_CONFIG_FILE=${PWD}/docker/frugalos/frugalos.yml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docker/frugalos/frugalos.yml は docker 用の設定ファイルであって、このような依存関係を作ると変更の影響範囲が読めなくなるので、 scripts/ に設定ファイルを別途置いた方が良いんじゃないでしょうか。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

置きました 046999a

src/lib.rs Outdated
@@ -157,13 +158,17 @@ pub struct FrugalosDaemonConfig {
/// Jaegerのトレースのサンプリング確率。
#[serde(default = "default_sampling_rate")]
pub sampling_rate: f64,
/// daemon 管理の HTTP サーバのメトリクスのバケツの設定
#[serde(default)]
pub bucket_config: HistogramBucketConfig,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

以下の点で設定が分かりづらいように感じます。

  1. 名前からすると一見 frugalos のバケツに対する設定と混同しやすい
  2. 何に対して適用されるのかパッと見て不明。
  3. http_server の設定とこの設定は何が違うのか?なぜ設定が別れているのか?が直感的には理解できない。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. について、daemon の設定でも .frugalos.http_server 以下に書いた方がいいですかね?
    1., 2. は直します。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed 1ece4e4

src/lib.rs Outdated
@@ -174,12 +179,16 @@ pub struct FrugalosHttpServerConfig {
/// bind するアドレス。
#[serde(default = "default_http_server_bind_addr")]
pub bind_addr: SocketAddr,
/// HTTP サーバのメトリクスのバケツの設定
#[serde(default)]
pub bucket_config: HistogramBucketConfig,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

どのメトリクスに適用される設定なのかをどこかに明示した方が親切ではないでしょうか。個人的な好みでは、メトリクス名を設定名内で明示するのが分かりやすくてよいかなと感じます。

Copy link
Contributor Author
8000

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed 1ece4e4

@koba-e964 koba-e964 force-pushed the feature/variable-bucket-config branch 2 times, most recently from 017c70c to 1ece4e4 Compare December 16, 2019 11:24
@shinnya shinnya added this to the v0.17.0 milestone Dec 17, 2019
@@ -19,6 +19,8 @@ TOLERABLE_FAULTS=${TOLERABLE_FAULTS:-$(( ($SERVER_COUNT / 2 - 1) >= 1 ? ($SERVER
# Note: $SERVER_COUNT + 1 は contact-server の分を $SERVER_COUNT に追加している。
DATA_FRAGMENTS=${DATA_FRAGMENTS:-$(( ($SERVER_COUNT + 1 - $TOLERABLE_FAULTS) >= 1 ? ($SERVER_COUNT + 1 - $TOLERABLE_FAULTS) : 1 ))}
FRUGALOS_START_FLAGS=${FRUGALOS_START_FLAGS:- --sampling-rate 1.0}
FRUGALOS_CONFIG_FILE=`cd \`dirname $0\`; pwd`/frugalos.yml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

直した方がいいという話ではないです。
些細な話ですが back quote ではなく $() を使えばエスケープする必要がないです。

shinnya
shinnya previously approved these changes Jan 7, 2020
@shinnya
Copy link
Contributor
shinnya commented Jan 7, 2020

frugalos.daemon の設定に fibers_http_server の設定を生やした点など不思議な感じはしました。ただの感想です。

@koba-e964 koba-e964 force-pushed the feature/variable-bucket-config branch from e2bd444 to fdfccd6 Compare January 8, 2020 13:55
@koba-e964 koba-e964 merged commit c57caaf into develop Jan 9, 2020
@koba-e964 koba-e964 deleted the feature/variable-bucket-config branch January 9, 2020 09:51
@shinnya shinnya mentioned this pull request Jan 10, 2020
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0