-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
rds: add config reload time stat for rds #17033
Conversation
Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
@@ -53,6 +53,7 @@ The following statistics are generated for all subscriptions. | |||
:widths: 1, 1, 2 | |||
|
|||
config_reload, Counter, Total API fetches that resulted in a config reload due to a different config | |||
config_reload_time, Gauge, Timestamp of the last config reload as milliseconds since the epoch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
config_reload is only applicable/implemented for RDS/SRDS and VHDS - but added here generically. I followed the same pattern and added this new stat here even though it is implemented only for RDS and SRDS. If it is better to move to rds stats page - I can move.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you name this stat config_reload_time_ms
?
Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
@@ -53,6 +53,7 @@ The following statistics are generated for all subscriptions. | |||
:widths: 1, 1, 2 | |||
|
|||
config_reload, Counter, Total API fetches that resulted in a config reload due to a different config | |||
config_reload_time, Gauge, Timestamp of the last config reload as milliseconds since the epoch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you name this stat config_reload_time_ms
?
test/common/router/rds_impl_test.cc
Outdated
@@ -290,6 +290,10 @@ TEST_F(RdsImplTest, Basic) { | |||
// Old config use count should be 1 now. | |||
EXPECT_EQ(1, config.use_count()); | |||
EXPECT_EQ(2UL, scope_.counter("foo.rds.foo_route_config.config_reload").value()); | |||
EXPECT_NE(0, scope_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could this flake if the test runs in <1ms?
If you are just trying to ensure that the gauge exists, you can use findGaugeByString, which is on class TestStore, which is the base class of MockIsolatedStatsStore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure.. Will change to ensure gauge exists.
@jmarantz PTAL addressed comments. The coverage failure not seems relevant. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great modulo nits.
/assign-from @envoyproxy/senior-maintainers
source/common/router/rds_impl.h
Outdated
COUNTER(config_reload) \ | ||
GAUGE(config_reload_time_ms, NeverImport) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: sort this block alphabetically, so the 2 counters go together.
source/common/router/scoped_rds.h
Outdated
@@ -84,6 +84,7 @@ class InlineScopedRoutesConfigProvider : public Envoy::Config::ImmutableConfigPr | |||
// clang-format off | |||
#define ALL_SCOPED_RDS_STATS(COUNTER, GAUGE) \ | |||
COUNTER(config_reload) \ | |||
GAUGE(config_reload_time_ms, NeverImport) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
@envoyproxy/senior-maintainers assignee is @ggreenway |
Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
/retest |
Retrying Azure Pipelines: |
…bridge-stream * upstream/main: (268 commits) tools: adding dio,better comments (envoyproxy#17104) doc: fix misplaced #[extension-category] for Wasm runtimes (envoyproxy#17078) ci: Speedup deps precheck (envoyproxy#17102) doc: fix wrong link on wasm network filter. (envoyproxy#17079) docs: Added v3 API reference. (envoyproxy#17095) docs: Update include paths in repo (envoyproxy#17098) exception: make Ipv6Instance and Ipv4Instance not throw and remove some try catch pattern (envoyproxy#16122) tools: adding reminders for API shephards (envoyproxy#17081) ci: Fix wasm verify example (envoyproxy#17086) [fuzz]: fix oss fuzz bug 34515, limit maglev table size (envoyproxy#16671) test: silencing flaky test (envoyproxy#17084) Set `validate` flag when the SAN(SubjectAltName) matching is performed (envoyproxy#16816) Listener: reset the file event when destroying listener filters (envoyproxy#16952) docs: link additional filters that emit dynamic metadata (envoyproxy#17059) rds: add config reload time stat for rds (envoyproxy#17033) bazel: Use color by default for build and run commands (envoyproxy#17077) ci: Add timing for docker pull (envoyproxy#17074) [Windows] Adding note section in Original Source HTTP Filter (envoyproxy#17058) quic: add quic version counters in http3 codec stats. (envoyproxy#16943) quiche: change crypto stream factory interfaces (envoyproxy#17046) ... Signed-off-by: Garrett Bourg <bourg@squareup.com>
Signed-off-by: Rama Chavali <rama.rao@salesforce.com> Signed-off-by: chris.xin <xinchuantao@qq.com>
Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
We would like to know when a route update is loaded to Envoy. This PR adds a stat to indicate the same.
Commit Message: add config reload time stat.
Additional Description:
Risk Level: Low
Testing: Added
Docs Changes: Updated
Release Notes: Updated
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Deprecated:]
[Optional API Considerations:]