Skip to content

Commit

Permalink
Revert "[ZK filter] Add per-opcode decoder error metrics (#31138)" (#…
Browse files Browse the repository at this point in the history
…31245)

This is the prerequisite of reverting #30438 in order to fix the ZK proxy filter "Uncaught Exception" issue.

Risk Level: Low
Testing: Unit test
Docs Changes: Revert doc changes in #31138
Release Notes: Revert release notes in #31138
Platform Specific Features: N/A

Signed-off-by: Zhewei Hu <zhu@pinterest.com>
  • Loading branch information
Winbobob authored Dec 12, 2023
1 parent fd19348 commit e61e461
Show file tree
Hide file tree
Showing 12 changed files with 258 additions and 490 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ message ZooKeeperProxy {
// Whether to emit per opcode response bytes metrics. If not set, it defaults to false.
bool enable_per_opcode_response_bytes_metrics = 8;

// Whether to emit per opcode decoder error metrics. If not set, it defaults to false.
// [#not-implemented-hide:] Whether to emit per opcode decoder error metrics. If not set, it defaults to false.
bool enable_per_opcode_decoder_error_metrics = 9;
}

Expand Down
4 changes: 0 additions & 4 deletions changelogs/current.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,6 @@ new_features:
Added support to copy headers from the redirect response to the
triggered request. See
:ref:`response_headers_to_copy<envoy_v3_api_field_config.route.v3.InternalRedirectPolicy.response_headers_to_copy>`.
- area: zookeeper
change: |
Added support for emitting per opcode decoder error metrics via :ref:`enable_per_opcode_decoder_error_metrics
<envoy_v3_api_field_extensions.filters.network.zookeeper_proxy.v3.ZooKeeperProxy.enable_per_opcode_decoder_error_metrics>`.
- area: stateful_session
change: |
Added :ref:`strict mode <envoy_v3_api_field_extensions.filters.http.stateful_session.v3.StatefulSession.strict>`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ static_resources:
stat_prefix: zookeeper
enable_per_opcode_request_bytes_metrics: true
enable_per_opcode_response_bytes_metrics: true
enable_per_opcode_decoder_error_metrics: true
enable_latency_threshold_metrics: true
default_latency_threshold: "0.1s"
latency_threshold_overrides:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,43 +41,13 @@ Every configured ZooKeeper proxy filter has statistics rooted at *<stat_prefix>.

*_resp_bytes* are per-opcode metrics and will only be emitted when :ref:`enable_per_opcode_response_bytes_metrics <envoy_v3_api_field_extensions.filters.network.zookeeper_proxy.v3.ZooKeeperProxy.enable_per_opcode_response_bytes_metrics>` is set to ``true``.

*_decoder_error* are per-opcode metrics and will only be emitted when :ref:`enable_per_opcode_decoder_error_metrics <envoy_v3_api_field_extensions.filters.network.zookeeper_proxy.v3.ZooKeeperProxy.enable_per_opcode_decoder_error_metrics>` is set to ``true``.

The following counters are available:

.. csv-table::
:header: Name, Type, Description
:widths: 1, 1, 2

decoder_error, Counter, Number of times a message wasn't decoded
connect_decoder_error, Counter, Number of times a connect request message wasn't decoded
ping_decoder_error, Counter, Number of times a ping request message wasn't decoded
auth_decoder_error, Counter, Number of times a auth request message wasn't decoded
getdata_decoder_error, Counter, Number of times a getdata request message wasn't decoded
create_decoder_error, Counter, Number of times a create request message wasn't decoded
create2_decoder_error, Counter, Number of times a create2 request message wasn't decoded
createcontainer_decoder_error, Counter, Number of times a createcontainer request message wasn't decoded
createttl_decoder_error, Counter, Number of times a createttl request message wasn't decoded
setdata_decoder_error, Counter, Number of times a setdata request message wasn't decoded
getchildren_decoder_error, Counter, Number of times a getchildren request message wasn't decoded
getchildren2_decoder_error, Counter, Number of times a getchildren2 request message wasn't decoded
getephemerals_decoder_error, Counter, Number of times a getephemerals request message wasn't decoded
getallchildrennumber_decoder_error, Counter, Number of times a getallchildrennumber request message wasn't decoded
delete_decoder_error, Counter, Number of times a delete request message wasn't decoded
exists_decoder_error, Counter, Number of times a exists request message wasn't decoded
getacl_decoder_error, Counter, Number of times a getacl request message wasn't decoded
setacl_decoder_error, Counter, Number of times a setacl request message wasn't decoded
sync_decoder_error, Counter, Number of times a sync request message wasn't decoded
multi_decoder_error, Counter, Number of times a multi request message wasn't decoded
reconfig_decoder_error, Counter, Number of times a reconfig request message wasn't decoded
close_decoder_error, Counter, Number of times a close request message wasn't decoded
setauth_decoder_error, Counter, Number of times a setauth request message wasn't decoded
setwatches_decoder_error, Counter, Number of times a setwatches request message wasn't decoded
setwatches2_decoder_error, Counter, Number of times a setwatches2 request message wasn't decoded
addwatch_decoder_error, Counter, Number of times a addwatch request message wasn't decoded
checkwatches_decoder_error, Counter, Number of times a checkwatches request message wasn't decoded
removewatches_decoder_error, Counter, Number of times a removewatches request message wasn't decoded
check_decoder_error, Counter, Number of times a check request message wasn't decoded
request_bytes, Counter, Number of bytes in decoded request messages
connect_rq_bytes, Counter, Number of bytes in decoded connect request messages
ping_rq_bytes, Counter, Number of bytes in decoded ping request messages
Expand Down
7 changes: 2 additions & 5 deletions source/extensions/filters/network/zookeeper_proxy/config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ Network::FilterFactoryCb ZooKeeperConfigFactory::createFilterFactoryFromProtoTyp
proto_config.enable_per_opcode_request_bytes_metrics();
const bool enable_per_opcode_response_bytes_metrics =
proto_config.enable_per_opcode_response_bytes_metrics();
const bool enable_per_opcode_decoder_error_metrics =
proto_config.enable_per_opcode_decoder_error_metrics();
const bool enable_latency_threshold_metrics = proto_config.enable_latency_threshold_metrics();
const std::chrono::milliseconds default_latency_threshold(
PROTOBUF_GET_MS_OR_DEFAULT(proto_config, default_latency_threshold, 100));
Expand All @@ -51,9 +49,8 @@ Network::FilterFactoryCb ZooKeeperConfigFactory::createFilterFactoryFromProtoTyp

ZooKeeperFilterConfigSharedPtr filter_config(std::make_shared<ZooKeeperFilterConfig>(
stat_prefix, max_packet_bytes, enable_per_opcode_request_bytes_metrics,
enable_per_opcode_response_bytes_metrics, enable_per_opcode_decoder_error_metrics,
enable_latency_threshold_metrics, default_latency_threshold, latency_threshold_overrides,
context.scope()));
enable_per_opcode_response_bytes_metrics, enable_latency_threshold_metrics,
default_latency_threshold, latency_threshold_overrides, context.scope()));
auto& time_source = context.serverFactoryContext().mainThreadDispatcher().timeSource();

return [filter_config, &time_source](Network::FilterManager& filter_manager) -> void {
Expand Down
Loading

0 comments on commit e61e461

Please sign in to comment.