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

rds: add config reload time stat for rds #17033

Merged
merged 12 commits into from
Jun 22, 2021

Conversation

ramaraochavali
Copy link
Contributor

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:]

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>
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
Copy link
Contributor Author

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.

Copy link
Contributor

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>
@jmarantz jmarantz self-assigned this Jun 18, 2021
@@ -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
Copy link
Contributor

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?

@@ -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_
Copy link
Contributor

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.

Copy link
Contributor Author

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.

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>
@ramaraochavali
Copy link
Contributor Author

@jmarantz PTAL addressed comments. The coverage failure not seems relevant.

jmarantz
jmarantz previously approved these changes Jun 21, 2021
Copy link
Contributor

@jmarantz jmarantz left a 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

COUNTER(config_reload) \
GAUGE(config_reload_time_ms, NeverImport) \
Copy link
Contributor

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.

@@ -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) \
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

@repokitteh-read-only
Copy link

@envoyproxy/senior-maintainers assignee is @ggreenway

🐱

Caused by: a #17033 (review) was submitted by @jmarantz.

see: more, trace.

Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
@ggreenway
Copy link
Contributor

/retest

@repokitteh-read-only
Copy link

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #17033 (comment) was created by @ggreenway.

see: more, trace.

@ggreenway ggreenway merged commit 305ea53 into envoyproxy:main Jun 22, 2021
@ramaraochavali ramaraochavali deleted the fix/config_reload branch June 23, 2021 04:16
baojr added a commit to baojr/envoy that referenced this pull request Jun 23, 2021
…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>
chrisxrepo pushed a commit to chrisxrepo/envoy that referenced this pull request Jul 8, 2021
Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
Signed-off-by: chris.xin <xinchuantao@qq.com>
leyao-daily pushed a commit to leyao-daily/envoy that referenced this pull request Sep 30, 2021
Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
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