From 8a43a1add804b5b7bbccce8b0878ac7cae46eb87 Mon Sep 17 00:00:00 2001 From: Takeshi Yoneda Date: Tue, 14 Sep 2021 09:45:45 +0900 Subject: [PATCH 1/4] Update Envoy SHA to 09-13. Signed-off-by: Takeshi Yoneda --- WORKSPACE | 8 +++--- src/envoy/extensions/wasm/BUILD | 34 ------------------------- src/envoy/extensions/wasm/wasm.cc | 41 ------------------------------- 3 files changed, 4 insertions(+), 79 deletions(-) delete mode 100644 src/envoy/extensions/wasm/BUILD delete mode 100644 src/envoy/extensions/wasm/wasm.cc diff --git a/WORKSPACE b/WORKSPACE index db65fc8467b..804462ef6aa 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -17,7 +17,7 @@ workspace(name = "io_istio_proxy") # http_archive is not a native function since bazel 0.19 -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file") +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") load( "//bazel:repositories.bzl", "docker_dependencies", @@ -38,10 +38,10 @@ bind( # 2. Update .bazelversion, envoy.bazelrc and .bazelrc if needed. # # Note: this is needed by release builder to resolve envoy dep sha to tag. -# Commit date: 2021-09-11 -ENVOY_SHA = "a22cfc378f9fd8017440fd9239e2c0e778a3b5e1" +# Commit date: 2021-09-13 +ENVOY_SHA = "0bbf23cb5b4cda358b8e5f5da9e91dd03ac27382" -ENVOY_SHA256 = "222e846a763b1ddd7c8a4cedcf61b1792f4526960f253a5090eb5ae24396b74a" +ENVOY_SHA256 = "133e0f71745d198ae3d0f869d867b3d77649dbbb87f22412a5f80103281feadf" ENVOY_ORG = "envoyproxy" diff --git a/src/envoy/extensions/wasm/BUILD b/src/envoy/extensions/wasm/BUILD deleted file mode 100644 index f016ee164cd..00000000000 --- a/src/envoy/extensions/wasm/BUILD +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright 2020 Istio Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -################################################################################ -# - -load( - "@envoy//bazel:envoy_build_system.bzl", - "envoy_cc_library", -) - -envoy_cc_library( - name = "wasm_lib", - srcs = [ - "wasm.cc", - ], - repository = "@envoy", - visibility = ["//visibility:public"], - deps = [ - "@envoy//source/common/stats:stats_lib", - "@envoy//source/server/admin:prometheus_stats_lib", - ], -) diff --git a/src/envoy/extensions/wasm/wasm.cc b/src/envoy/extensions/wasm/wasm.cc deleted file mode 100644 index a8f1b45c372..00000000000 --- a/src/envoy/extensions/wasm/wasm.cc +++ /dev/null @@ -1,41 +0,0 @@ -/* Copyright 2018 Istio Authors. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "source/common/stats/utility.h" -#include "source/server/admin/prometheus_stats.h" - -namespace Envoy { -namespace Extensions { -namespace Common { -namespace Wasm { -namespace Istio { - -// Stat prefix cannot be configured dynamically. -// https://github.com/envoyproxy/envoy/issues/14920 -// https://github.com/istio/istio/issues/27635 -class RegisterPrometheusNamespace { - public: - RegisterPrometheusNamespace() { - ::Envoy::Server::PrometheusStatsFormatter::registerPrometheusNamespace( - "istio"); - } -}; - -RegisterPrometheusNamespace register_namespace; - -} // namespace Istio -} // namespace Wasm -} // namespace Common -} // namespace Extensions -} // namespace Envoy From 8d567c6e191205cb19ff671d89996f0598b347a4 Mon Sep 17 00:00:00 2001 From: Takeshi Yoneda Date: Tue, 14 Sep 2021 09:49:07 +0900 Subject: [PATCH 2/4] Remove the deleted dependency. Signed-off-by: Takeshi Yoneda --- src/envoy/BUILD | 1 - 1 file changed, 1 deletion(-) diff --git a/src/envoy/BUILD b/src/envoy/BUILD index 643f80b4593..5f35b0f7053 100644 --- a/src/envoy/BUILD +++ b/src/envoy/BUILD @@ -30,7 +30,6 @@ envoy_cc_binary( "//extensions/metadata_exchange:metadata_exchange_lib", "//extensions/stackdriver:stackdriver_plugin", "//extensions/stats:stats_plugin", - "//src/envoy/extensions/wasm:wasm_lib", "//src/envoy/http/alpn:config_lib", "//src/envoy/http/authn:filter_lib", "//src/envoy/tcp/forward_downstream_sni:config_lib", From 3824935273a5907fc2dcc98cae443ded4e3392eb Mon Sep 17 00:00:00 2001 From: Takeshi Yoneda Date: Tue, 14 Sep 2021 11:20:21 +0900 Subject: [PATCH 3/4] fix stackdriver plugin. Signed-off-by: Takeshi Yoneda --- extensions/stackdriver/log/exporter.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/stackdriver/log/exporter.cc b/extensions/stackdriver/log/exporter.cc index 00b558b7146..5c5a4b1b8c7 100644 --- a/extensions/stackdriver/log/exporter.cc +++ b/extensions/stackdriver/log/exporter.cc @@ -42,8 +42,8 @@ ExporterImpl::ExporterImpl( const ::Extensions::Stackdriver::Common::StackdriverStubOption& stub_option) { context_ = root_context; - auto success_counter = Common::newExportCallMetric("logging", true); - auto failure_counter = Common::newExportCallMetric("logging", false); + auto success_counter = Common::newExportCallMetric("envoy_logging", true); + auto failure_counter = Common::newExportCallMetric("envoy_logging", false); success_callback_ = [this, success_counter](size_t) { incrementMetric(success_counter, 1); LOG_DEBUG("successfully sent Stackdriver logging request"); From 3bd75ebec2f0148fd6ad33bb66bcd71f9e3de126 Mon Sep 17 00:00:00 2001 From: Takeshi Yoneda Date: Tue, 14 Sep 2021 15:29:56 +0900 Subject: [PATCH 4/4] fix. Signed-off-by: Takeshi Yoneda --- extensions/stackdriver/common/metrics.cc | 2 +- extensions/stackdriver/log/exporter.cc | 4 ++-- test/envoye2e/stackdriver_plugin/stackdriver_test.go | 12 ++++++------ testdata/metric/stackdriver_callout_metric.yaml.tmpl | 2 +- .../stackdriver_gateway_callout_metric.yaml.tmpl | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/extensions/stackdriver/common/metrics.cc b/extensions/stackdriver/common/metrics.cc index 125daa87a0e..3d30062d875 100644 --- a/extensions/stackdriver/common/metrics.cc +++ b/extensions/stackdriver/common/metrics.cc @@ -34,7 +34,7 @@ uint32_t newExportCallMetric(const std::string& type, bool success) { // base VM and thread local VM would cause host side thread local VM root // context missing metric definition. This is not going to be a problem with // real Wasm VM due to memory isolation. - Metric export_call(MetricType::Counter, "export_call", + Metric export_call(MetricType::Counter, "envoy_export_call", {MetricTag{"wasm_filter", MetricTag::TagType::String}, MetricTag{"type", MetricTag::TagType::String}, MetricTag{"success", MetricTag::TagType::Bool}}); diff --git a/extensions/stackdriver/log/exporter.cc b/extensions/stackdriver/log/exporter.cc index 5c5a4b1b8c7..00b558b7146 100644 --- a/extensions/stackdriver/log/exporter.cc +++ b/extensions/stackdriver/log/exporter.cc @@ -42,8 +42,8 @@ ExporterImpl::ExporterImpl( const ::Extensions::Stackdriver::Common::StackdriverStubOption& stub_option) { context_ = root_context; - auto success_counter = Common::newExportCallMetric("envoy_logging", true); - auto failure_counter = Common::newExportCallMetric("envoy_logging", false); + auto success_counter = Common::newExportCallMetric("logging", true); + auto failure_counter = Common::newExportCallMetric("logging", false); success_callback_ = [this, success_counter](size_t) { incrementMetric(success_counter, 1); LOG_DEBUG("successfully sent Stackdriver logging request"); diff --git a/test/envoye2e/stackdriver_plugin/stackdriver_test.go b/test/envoye2e/stackdriver_plugin/stackdriver_test.go index c9d66c85a1d..be98b585ddf 100644 --- a/test/envoye2e/stackdriver_plugin/stackdriver_test.go +++ b/test/envoye2e/stackdriver_plugin/stackdriver_test.go @@ -79,7 +79,7 @@ func TestStackdriverPayload(t *testing.T) { }, true, ), &driver.Stats{params.Ports.ServerAdmin, map[string]driver.StatMatcher{ - "envoy_type_logging_success_true_export_call": &driver.ExactStat{"testdata/metric/stackdriver_callout_metric.yaml.tmpl"}, + "type_logging_success_true_envoy_export_call": &driver.ExactStat{"testdata/metric/stackdriver_callout_metric.yaml.tmpl"}, }}, }, }).Run(params); err != nil { @@ -135,7 +135,7 @@ func TestStackdriverPayloadGateway(t *testing.T) { }, true, ), &driver.Stats{params.Ports.ServerAdmin, map[string]driver.StatMatcher{ - "envoy_type_logging_success_true_export_call": &driver.ExactStat{"testdata/metric/stackdriver_gateway_callout_metric.yaml.tmpl"}, + "type_logging_success_true_envoy_export_call": &driver.ExactStat{"testdata/metric/stackdriver_gateway_callout_metric.yaml.tmpl"}, }}, }, }).Run(params); err != nil { @@ -193,7 +193,7 @@ func TestStackdriverPayloadWithTLS(t *testing.T) { }, true, ), &driver.Stats{params.Ports.ServerAdmin, map[string]driver.StatMatcher{ - "envoy_type_logging_success_true_export_call": &driver.ExactStat{"testdata/metric/stackdriver_callout_metric.yaml.tmpl"}, + "type_logging_success_true_envoy_export_call": &driver.ExactStat{"testdata/metric/stackdriver_callout_metric.yaml.tmpl"}, }}, }, }).Run(params); err != nil { @@ -754,7 +754,7 @@ func TestStackdriverAttributeGen(t *testing.T) { }, true, ), &driver.Stats{params.Ports.ServerAdmin, map[string]driver.StatMatcher{ - "envoy_type_logging_success_true_export_call": &driver.ExactStat{"testdata/metric/stackdriver_callout_metric.yaml.tmpl"}, + "type_logging_success_true_envoy_export_call": &driver.ExactStat{"testdata/metric/stackdriver_callout_metric.yaml.tmpl"}, }}, }, }).Run(params); err != nil { @@ -818,7 +818,7 @@ func TestStackdriverCustomAccessLog(t *testing.T) { }, true, ), &driver.Stats{params.Ports.ServerAdmin, map[string]driver.StatMatcher{ - "envoy_type_logging_success_true_export_call": &driver.ExactStat{"testdata/metric/stackdriver_callout_metric.yaml.tmpl"}, + "type_logging_success_true_envoy_export_call": &driver.ExactStat{"testdata/metric/stackdriver_callout_metric.yaml.tmpl"}, }}, }, }).Run(params); err != nil { @@ -1141,7 +1141,7 @@ func TestStackdriverPayloadUtf8(t *testing.T) { }, true, ), &driver.Stats{params.Ports.ServerAdmin, map[string]driver.StatMatcher{ - "envoy_type_logging_success_true_export_call": &driver.ExactStat{"testdata/metric/stackdriver_callout_metric.yaml.tmpl"}, + "type_logging_success_true_envoy_export_call": &driver.ExactStat{"testdata/metric/stackdriver_callout_metric.yaml.tmpl"}, }}, }, }).Run(params); err != nil { diff --git a/testdata/metric/stackdriver_callout_metric.yaml.tmpl b/testdata/metric/stackdriver_callout_metric.yaml.tmpl index 319ffb9dc51..3e168b5a45e 100644 --- a/testdata/metric/stackdriver_callout_metric.yaml.tmpl +++ b/testdata/metric/stackdriver_callout_metric.yaml.tmpl @@ -1,4 +1,4 @@ -name: envoy_type_logging_success_true_export_call +name: type_logging_success_true_envoy_export_call type: COUNTER metric: - counter: diff --git a/testdata/metric/stackdriver_gateway_callout_metric.yaml.tmpl b/testdata/metric/stackdriver_gateway_callout_metric.yaml.tmpl index 2e1da5f55f3..a8e515b9070 100644 --- a/testdata/metric/stackdriver_gateway_callout_metric.yaml.tmpl +++ b/testdata/metric/stackdriver_gateway_callout_metric.yaml.tmpl @@ -1,4 +1,4 @@ -name: envoy_type_logging_success_true_export_call +name: type_logging_success_true_envoy_export_call type: COUNTER metric: - counter: