diff --git a/source/common/runtime/runtime_impl.cc b/source/common/runtime/runtime_impl.cc index 3f469c4921d06..1ec08fc6d424d 100644 --- a/source/common/runtime/runtime_impl.cc +++ b/source/common/runtime/runtime_impl.cc @@ -428,13 +428,14 @@ RtdsSubscription::RtdsSubscription( : Envoy::Config::SubscriptionBase( rtds_layer.rtds_config().resource_api_version(), validation_visitor, "name"), parent_(parent), config_source_(rtds_layer.rtds_config()), store_(store), - resource_name_(rtds_layer.name()), + stats_scope_(store_.createScope("runtime")), resource_name_(rtds_layer.name()), init_target_("RTDS " + resource_name_, [this]() { start(); }) {} void RtdsSubscription::createSubscription() { const auto resource_name = getResourceName(); subscription_ = parent_.cm_->subscriptionFactory().subscriptionFromConfigSource( - config_source_, Grpc::Common::typeUrl(resource_name), store_, *this, resource_decoder_); + config_source_, Grpc::Common::typeUrl(resource_name), *stats_scope_, *this, + resource_decoder_); } void RtdsSubscription::onConfigUpdate(const std::vector& resources, diff --git a/source/common/runtime/runtime_impl.h b/source/common/runtime/runtime_impl.h index 7f2cda13bf2ec..982a32b863a38 100644 --- a/source/common/runtime/runtime_impl.h +++ b/source/common/runtime/runtime_impl.h @@ -211,6 +211,7 @@ struct RtdsSubscription : Envoy::Config::SubscriptionBasecounter("runtime.load_error")->value()); + EXPECT_EQ(0, test_server_->counter("runtime.update_failure")->value()); EXPECT_EQ(initial_load_success_ + 2, test_server_->counter("runtime.load_success")->value()); + EXPECT_EQ(2, test_server_->counter("runtime.update_success")->value()); EXPECT_EQ(initial_keys_ + 1, test_server_->gauge("runtime.num_keys")->value()); EXPECT_EQ(3, test_server_->gauge("runtime.num_layers")->value()); }