forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
str_f
5860 lines (5860 loc) · 342 KB
/
str_f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
[1mdiff --git a/.bazelrc b/.bazelrc[m
[1mindex ce5e826be6..79da7e60c4 100644[m
[1m--- a/.bazelrc[m
[1m+++ b/.bazelrc[m
[36m@@ -159,7 +159,9 @@[m [mbuild:libc++ --action_env=BAZEL_LINKOPTS=-lm:-pthread[m
build:libc++ --define force_libcpp=enabled[m
[m
# Optimize build for binary size reduction.[m
[31m-build:sizeopt -c opt --copt -Os --linkopt=-Wl,--gc-sections --linkopt=-Wl,--dead_strip[m
[32m+[m[32mbuild:sizeopt-sections -c opt --copt -Os --linkopt=-Wl,--gc-sections[m
[32m+[m[32mbuild:sizeopt -c opt --copt -Os[m
[32m+[m[32mbuild:sizeopt-strip -c opt --copt -Os --linkopt=-Wl,-dead_strip[m
[m
# Test options[m
build --test_env=HEAPCHECK=normal --test_env=PPROF_PATH[m
[1mdiff --git a/.github/workflows/depsreview.yml b/.github/workflows/depsreview.yml[m
[1mindex f8aac61052..ca7fc7d313 100644[m
[1m--- a/.github/workflows/depsreview.yml[m
[1m+++ b/.github/workflows/depsreview.yml[m
[36m@@ -9,4 +9,4 @@[m [mjobs:[m
- name: 'Checkout Repository'[m
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8[m
- name: 'Dependency Review'[m
[31m- uses: actions/dependency-review-action@0efb1d1d84fc9633afcdaad14c485cbbc90ef46c[m
[32m+[m[32m uses: actions/dependency-review-action@30d582111533d59ab793fd9f971817241654f3ec[m
[1mdiff --git a/CODEOWNERS b/CODEOWNERS[m
[1mindex 749a89644b..672dc4a717 100644[m
[1m--- a/CODEOWNERS[m
[1m+++ b/CODEOWNERS[m
[36m@@ -164,6 +164,8 @@[m [mextensions/filters/http/oauth2 @derekargueta @snowp[m
/*/extensions/matching/input_matchers/consistent_hashing @snowp @donyu[m
# environment generic input[m
/*/extensions/matching/common_inputs/environment @snowp @donyu[m
[32m+[m[32m# format string matching[m
[32m+[m[32m/*/extensions/matching/actions/format_string @kyessenov @UNOWNED[m
# user space socket pair, event, connection and listener[m
/*/extensions/io_socket/user_space @kyessenov @antoniovicente[m
/*/extensions/bootstrap/internal_listener @kyessenov @adisuissa[m
[1mdiff --git a/api/envoy/config/endpoint/v3/endpoint_components.proto b/api/envoy/config/endpoint/v3/endpoint_components.proto[m
[1mindex 59e699ae64..247f2a5019 100644[m
[1m--- a/api/envoy/config/endpoint/v3/endpoint_components.proto[m
[1m+++ b/api/envoy/config/endpoint/v3/endpoint_components.proto[m
[36m@@ -51,6 +51,10 @@[m [mmessage Endpoint {[m
//[m
// The form of the health check host address is expected to be a direct IP address.[m
core.v3.Address address = 3;[m
[32m+[m
[32m+[m[32m // Optional flag to control if perform active health check for this endpoint.[m
[32m+[m[32m // Active health check is enabled by default if there is a health checker.[m
[32m+[m[32m bool disable_active_health_check = 4;[m
}[m
[m
// The upstream host address.[m
[1mdiff --git a/api/envoy/config/rbac/v3/rbac.proto b/api/envoy/config/rbac/v3/rbac.proto[m
[1mindex e4299789e7..e8d9e9cf8b 100644[m
[1m--- a/api/envoy/config/rbac/v3/rbac.proto[m
[1m+++ b/api/envoy/config/rbac/v3/rbac.proto[m
[36m@@ -5,6 +5,7 @@[m [mpackage envoy.config.rbac.v3;[m
import "envoy/config/core/v3/address.proto";[m
import "envoy/config/core/v3/extension.proto";[m
import "envoy/config/route/v3/route_components.proto";[m
[32m+[m[32mimport "envoy/type/matcher/v3/filter_state.proto";[m
import "envoy/type/matcher/v3/metadata.proto";[m
import "envoy/type/matcher/v3/path.proto";[m
import "envoy/type/matcher/v3/string.proto";[m
[36m@@ -229,7 +230,7 @@[m [mmessage Permission {[m
[m
// Principal defines an identity or a group of identities for a downstream[m
// subject.[m
[31m-// [#next-free-field: 12][m
[32m+[m[32m// [#next-free-field: 13][m
message Principal {[m
option (udpa.annotations.versioning).previous_message_type = "envoy.config.rbac.v2.Principal";[m
[m
[36m@@ -304,6 +305,9 @@[m [mmessage Principal {[m
// Metadata that describes additional information about the principal.[m
type.matcher.v3.MetadataMatcher metadata = 7;[m
[m
[32m+[m[32m // Identifies the principal using a filter state object.[m
[32m+[m[32m type.matcher.v3.FilterStateMatcher filter_state = 12;[m
[32m+[m
// Negates matching the provided principal. For instance, if the value of[m
// ``not_id`` would match, this principal would not match. Conversely, if the[m
// value of ``not_id`` would not match, this principal would match.[m
[1mdiff --git a/api/envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto b/api/envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto[m
[1mindex 8288684fbf..132ce3a4eb 100644[m
[1m--- a/api/envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto[m
[1m+++ b/api/envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto[m
[36m@@ -157,6 +157,11 @@[m [mmessage ExternalProcessor {[m
// with the header prefix set via[m
// :ref:`header_prefix <envoy_v3_api_field_config.bootstrap.v3.Bootstrap.header_prefix>`[m
// (which is usually "x-envoy").[m
[32m+[m[32m // Note that changing headers such as "host" or ":authority" may not in itself[m
[32m+[m[32m // change Envoy's routing decision, as routes can be cached. To also force the[m
[32m+[m[32m // route to be recomputed, set the[m
[32m+[m[32m // :ref:`clear_route_cache <envoy_v3_api_field_service.ext_proc.v3.CommonResponse.clear_route_cache>`[m
[32m+[m[32m // field to true in the same response.[m
config.common.mutation_rules.v3.HeaderMutationRules mutation_rules = 9;[m
}[m
[m
[1mdiff --git a/api/envoy/type/matcher/v3/filter_state.proto b/api/envoy/type/matcher/v3/filter_state.proto[m
[1mnew file mode 100644[m
[1mindex 0000000000..f813178ae0[m
[1m--- /dev/null[m
[1m+++ b/api/envoy/type/matcher/v3/filter_state.proto[m
[36m@@ -0,0 +1,29 @@[m
[32m+[m[32msyntax = "proto3";[m
[32m+[m
[32m+[m[32mpackage envoy.type.matcher.v3;[m
[32m+[m
[32m+[m[32mimport "envoy/type/matcher/v3/string.proto";[m
[32m+[m
[32m+[m[32mimport "udpa/annotations/status.proto";[m
[32m+[m[32mimport "validate/validate.proto";[m
[32m+[m
[32m+[m[32moption java_package = "io.envoyproxy.envoy.type.matcher.v3";[m
[32m+[m[32moption java_outer_classname = "FilterStateProto";[m
[32m+[m[32moption java_multiple_files = true;[m
[32m+[m[32moption go_package = "github.com/envoyproxy/go-control-plane/envoy/type/matcher/v3;matcherv3";[m
[32m+[m[32moption (udpa.annotations.file_status).package_version_status = ACTIVE;[m
[32m+[m
[32m+[m[32m// [#protodoc-title: Filter state matcher][m
[32m+[m
[32m+[m[32m// FilterStateMatcher provides a general interface for matching the filter state objects.[m
[32m+[m[32mmessage FilterStateMatcher {[m
[32m+[m[32m // The filter state key to retrieve the object.[m
[32m+[m[32m string key = 1 [(validate.rules).string = {min_len: 1}];[m
[32m+[m
[32m+[m[32m oneof matcher {[m
[32m+[m[32m option (validate.required) = true;[m
[32m+[m
[32m+[m[32m // Matches the filter state object as a string value.[m
[32m+[m[32m StringMatcher string_match = 2;[m
[32m+[m[32m }[m
[32m+[m[32m}[m
[1mdiff --git a/bazel/envoy_build_system.bzl b/bazel/envoy_build_system.bzl[m
[1mindex 57f2cc7c0b..de733b15e5 100644[m
[1m--- a/bazel/envoy_build_system.bzl[m
[1m+++ b/bazel/envoy_build_system.bzl[m
[36m@@ -49,6 +49,7 @@[m [mload([m
"@envoy_build_config//:extensions_build_config.bzl",[m
"CONTRIB_EXTENSION_PACKAGE_VISIBILITY",[m
"EXTENSION_PACKAGE_VISIBILITY",[m
[32m+[m[32m "MOBILE_PACKAGE_VISIBILITY",[m
)[m
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")[m
[m
[36m@@ -69,7 +70,9 @@[m [mdef envoy_extension_package(enabled_default = True, default_visibility = EXTENSI[m
)[m
[m
def envoy_mobile_package():[m
[31m- envoy_extension_package()[m
[32m+[m[32m # Mobile packages should only be visible to other mobile packages, not any other[m
[32m+[m[32m # parts of the Envoy codebase.[m
[32m+[m[32m envoy_extension_package(default_visibility = MOBILE_PACKAGE_VISIBILITY)[m
[m
def envoy_contrib_package():[m
envoy_extension_package(default_visibility = CONTRIB_EXTENSION_PACKAGE_VISIBILITY)[m
[1mdiff --git a/bazel/repository_locations.bzl b/bazel/repository_locations.bzl[m
[1mindex 60bb366f0c..6c6c0e0914 100644[m
[1m--- a/bazel/repository_locations.bzl[m
[1m+++ b/bazel/repository_locations.bzl[m
[36m@@ -1080,12 +1080,12 @@[m [mREPOSITORY_LOCATIONS_SPEC = dict([m
project_name = "QUICHE",[m
project_desc = "QUICHE (QUIC, HTTP/2, Etc) is Google‘s implementation of QUIC and related protocols",[m
project_url = "https://github.com/google/quiche",[m
[31m- version = "c6efbc4f790a274f1f4030cd8437683a321f23b8",[m
[31m- sha256 = "7911438519437af82356c76a9b96a8a61fcb3ee5c11ca7e6f190e4bca53c3cb0",[m
[32m+[m[32m version = "8b0d15bda8fdeb80a40ef53b7932b0897025dc11",[m
[32m+[m[32m sha256 = "b03b0c8e1c7d261ebb1865f9c9c7a3e6e14bc382203526e5bf767c7fed0f9c16",[m
urls = ["https://github.com/google/quiche/archive/{version}.tar.gz"],[m
strip_prefix = "quiche-{version}",[m
use_category = ["dataplane_core"],[m
[31m- release_date = "2022-11-02",[m
[32m+[m[32m release_date = "2022-11-10",[m
cpe = "N/A",[m
license = "BSD-3-Clause",[m
license_url = "https://github.com/google/quiche/blob/{version}/LICENSE",[m
[1mdiff --git a/changelogs/current.yaml b/changelogs/current.yaml[m
[1mindex b11b2363c2..ee03fcf329 100644[m
[1m--- a/changelogs/current.yaml[m
[1m+++ b/changelogs/current.yaml[m
[36m@@ -113,9 +113,15 @@[m [mnew_features:[m
- area: udp_proxy[m
change: |[m
added support for :ref:`proxy_access_log <envoy_v3_api_field_extensions.filters.udp.udp_proxy.v3.UdpProxyConfig.proxy_access_log>`.[m
[32m+[m[32m- area: health_check[m
[32m+[m[32m change: |[m
[32m+[m[32m added an optional bool flag :ref:`disable_active_health_check <envoy_v3_api_field_config.endpoint.v3.Endpoint.HealthCheckConfig.disable_active_health_check>` to disable the active health check for the endpoint.[m
- area: mobile[m
change: |[m
started merging the Envoy mobile library into the main Envoy repo.[m
[32m+[m[32m- area: matching[m
[32m+[m[32m change: |[m
[32m+[m[32m support filter chain selection based on the dynamic metadata and the filter state using :ref:`formatter actions <extension_envoy.matching.actions.format_string>`.[m
- area: redis[m
change: |[m
extended :ref:`cluster support <arch_overview_redis_cluster_support>` by adding a :ref:`dns_cache_config <envoy_v3_api_field_extensions.filters.network.redis_proxy.v3.RedisProxy.ConnPoolSettings.dns_cache_config>` option that can be used to resolve hostnames returned by MOVED/ASK responses.[m
[1mdiff --git a/ci/Dockerfile-envoy b/ci/Dockerfile-envoy[m
[1mindex 1b736accba..c80c0c5923 100644[m
[1m--- a/ci/Dockerfile-envoy[m
[1m+++ b/ci/Dockerfile-envoy[m
[36m@@ -42,7 +42,7 @@[m [mCMD ["envoy", "-c", "/etc/envoy/envoy.yaml"][m
[m
# STAGE: envoy-distroless[m
# gcr.io/distroless/base-debian11:nonroot[m
[31m-FROM gcr.io/distroless/base-debian11@sha256:49d2923f35d66b8402487a7c01bc62a66d8279cd42e89c11b64cdce8d5826c03 AS envoy-distroless[m
[32m+[m[32mFROM gcr.io/distroless/base-debian11:nonroot@sha256:4b22ca3c68018333c56f8dddcf1f8b55f32889f2dd12d28ab60856eba1130d04 AS envoy-distroless[m
[m
COPY --from=binary /usr/local/bin/envoy* /usr/local/bin/[m
COPY --from=binary /usr/local/bin/su-exec /usr/local/bin/[m
[1mdiff --git a/ci/osx-build-config/extensions_build_config.bzl b/ci/osx-build-config/extensions_build_config.bzl[m
[1mindex d0ff8fdfac..79a960e731 100644[m
[1m--- a/ci/osx-build-config/extensions_build_config.bzl[m
[1m+++ b/ci/osx-build-config/extensions_build_config.bzl[m
[36m@@ -17,6 +17,7 @@[m [mWINDOWS_EXTENSIONS = {}[m
EXTENSION_CONFIG_VISIBILITY = ["//:extension_config"][m
EXTENSION_PACKAGE_VISIBILITY = ["//:extension_library"][m
CONTRIB_EXTENSION_PACKAGE_VISIBILITY = ["//:contrib_library"][m
[32m+[m[32mMOBILE_PACKAGE_VISIBILITY = ["//:mobile_library"][m
[m
# As part of (https://github.com/envoyproxy/envoy-mobile/issues/175) we turned down alwayslink for envoy libraries[m
# This tracks libraries that should be registered as extensions.[m
[1mdiff --git a/docs/root/api-docs/diagrams/envoy-perf-script.svg b/docs/root/api-docs/diagrams/envoy-perf-script.svg[m
[1mdeleted file mode 100644[m
[1mindex 74759e1482..0000000000[m
Binary files a/docs/root/api-docs/diagrams/envoy-perf-script.svg and /dev/null differ
[1mdiff --git a/docs/root/api-v3/types/types.rst b/docs/root/api-v3/types/types.rst[m
[1mindex 081171a162..6ebcc0b551 100644[m
[1m--- a/docs/root/api-v3/types/types.rst[m
[1m+++ b/docs/root/api-v3/types/types.rst[m
[36m@@ -12,6 +12,7 @@[m [mTypes[m
../type/v3/http_status.proto[m
../type/http/v3/cookie.proto[m
../type/metadata/v3/metadata.proto[m
[32m+[m[32m ../type/matcher/v3/filter_state.proto[m
../type/matcher/v3/metadata.proto[m
../type/matcher/v3/node.proto[m
../type/matcher/v3/number.proto[m
[1mdiff --git a/docs/root/intro/arch_overview/advanced/matching/matching_api.rst b/docs/root/intro/arch_overview/advanced/matching/matching_api.rst[m
[1mindex ec72c0253d..721a3a6a0e 100644[m
[1m--- a/docs/root/intro/arch_overview/advanced/matching/matching_api.rst[m
[1m+++ b/docs/root/intro/arch_overview/advanced/matching/matching_api.rst[m
[36m@@ -86,6 +86,28 @@[m [mare available in some contexts:[m
[m
* :ref:`Trie-based IP matcher <envoy_v3_api_msg_.xds.type.matcher.v3.IPMatcher>` applies to network inputs.[m
[m
[32m+[m[32mMatching actions[m
[32m+[m[32m################[m
[32m+[m
[32m+[m[32mThe action in the matcher framework typically refers to the selected resource by name.[m
[32m+[m
[32m+[m[32mNetwork filter chain matching supports the following extensions:[m
[32m+[m
[32m+[m[32m.. _extension_envoy.matching.actions.format_string:[m
[32m+[m
[32m+[m[32m* :ref:`Format string action <envoy_v3_api_msg_config.core.v3.SubstitutionFormatString>` computes the filter chain name[m
[32m+[m[32m from the connection dynamic metadata and its filter state. Example:[m
[32m+[m
[32m+[m[32m.. validated-code-block:: yaml[m
[32m+[m[32m :type-name: envoy.config.common.matcher.v3.Matcher.OnMatch[m
[32m+[m
[32m+[m[32m action:[m
[32m+[m[32m name: foo[m
[32m+[m[32m typed_config:[m
[32m+[m[32m "@type": type.googleapis.com/envoy.config.core.v3.SubstitutionFormatString[m
[32m+[m[32m text_format_source:[m
[32m+[m[32m inline_string: "%DYNAMIC_METADATA(com.test_filter:test_key)%"[m
[32m+[m
Filter Integration[m
##################[m
[m
[1mdiff --git a/envoy/formatter/substitution_formatter.h b/envoy/formatter/substitution_formatter.h[m
[1mindex 99f00ecc38..c0d1502c19 100644[m
[1m--- a/envoy/formatter/substitution_formatter.h[m
[1m+++ b/envoy/formatter/substitution_formatter.h[m
[36m@@ -36,6 +36,7 @@[m [mpublic:[m
};[m
[m
using FormatterPtr = std::unique_ptr<Formatter>;[m
[32m+[m[32musing FormatterConstSharedPtr = std::shared_ptr<const Formatter>;[m
[m
/**[m
* Interface for substitution provider.[m
[1mdiff --git a/envoy/http/filter.h b/envoy/http/filter.h[m
[1mindex 10ba0ec44c..c625bfe925 100644[m
[1m--- a/envoy/http/filter.h[m
[1m+++ b/envoy/http/filter.h[m
[36m@@ -172,7 +172,7 @@[m [menum class FilterMetadataStatus {[m
* Return codes for onLocalReply filter invocations.[m
*/[m
enum class LocalErrorStatus {[m
[31m- // Continue sending the local reply after onLocalError has been sent to all filters.[m
[32m+[m[32m // Continue sending the local reply after onLocalReply has been sent to all filters.[m
Continue,[m
[m
// Continue sending onLocalReply to all filters, but reset the stream once all filters have been[m
[36m@@ -781,7 +781,7 @@[m [mpublic:[m
* from onLocalReply, as that has the potential for looping.[m
*[m
* @param data data associated with the sendLocalReply call.[m
[31m- * @param LocalErrorStatus the action to take after onLocalError completes.[m
[32m+[m[32m * @param LocalErrorStatus the action to take after onLocalReply completes.[m
*/[m
virtual LocalErrorStatus onLocalReply(const LocalReplyData&) {[m
return LocalErrorStatus::Continue;[m
[1mdiff --git a/envoy/upstream/cluster_manager.h b/envoy/upstream/cluster_manager.h[m
[1mindex bbdcaf2711..fbb50d1736 100644[m
[1m--- a/envoy/upstream/cluster_manager.h[m
[1m+++ b/envoy/upstream/cluster_manager.h[m
[36m@@ -378,7 +378,10 @@[m [mpublic:[m
*[m
* @return the stat names.[m
*/[m
[31m- virtual const ClusterStatNames& clusterStatNames() const PURE;[m
[32m+[m[32m virtual const ClusterTrafficStatNames& clusterStatNames() const PURE;[m
[32m+[m[32m virtual const ClusterConfigUpdateStatNames& clusterConfigUpdateStatNames() const PURE;[m
[32m+[m[32m virtual const ClusterLbStatNames& clusterLbStatNames() const PURE;[m
[32m+[m[32m virtual const ClusterEndpointStatNames& clusterEndpointStatNames() const PURE;[m
virtual const ClusterLoadReportStatNames& clusterLoadReportStatNames() const PURE;[m
virtual const ClusterCircuitBreakersStatNames& clusterCircuitBreakersStatNames() const PURE;[m
virtual const ClusterRequestResponseSizeStatNames&[m
[1mdiff --git a/envoy/upstream/upstream.h b/envoy/upstream/upstream.h[m
[1mindex 2633fc60f7..69b600b484 100644[m
[1m--- a/envoy/upstream/upstream.h[m
[1m+++ b/envoy/upstream/upstream.h[m
[36m@@ -242,6 +242,16 @@[m [mpublic:[m
* connection pools no longer need this host.[m
*/[m
virtual HostHandlePtr acquireHandle() const PURE;[m
[32m+[m
[32m+[m[32m /**[m
[32m+[m[32m * @return true if active health check is disabled.[m
[32m+[m[32m */[m
[32m+[m[32m virtual bool disableActiveHealthCheck() const PURE;[m
[32m+[m
[32m+[m[32m /**[m
[32m+[m[32m * Set true to disable active health check for the host.[m
[32m+[m[32m */[m
[32m+[m[32m virtual void setDisableActiveHealthCheck(bool disable_active_health_check) PURE;[m
};[m
[m
using HostConstSharedPtr = std::shared_ptr<const Host>;[m
[36m@@ -565,12 +575,36 @@[m [mpublic:[m
};[m
[m
/**[m
[31m- * All cluster stats. @see stats_macros.h[m
[32m+[m[32m * All cluster config update related stats.[m
[32m+[m[32m * See https://github.com/envoyproxy/envoy/issues/23575 for details. Stats from ClusterInfo::stats()[m
[32m+[m[32m * will be split into subgroups "config-update", "lb", "endpoint" and "the rest"(which are mainly[m
[32m+[m[32m * upstream related), roughly based on their semantics.[m
*/[m
[31m-#define ALL_CLUSTER_STATS(COUNTER, GAUGE, HISTOGRAM, TEXT_READOUT, STATNAME) \[m
[32m+[m[32m#define ALL_CLUSTER_CONFIG_UPDATE_STATS(COUNTER, GAUGE, HISTOGRAM, TEXT_READOUT, STATNAME) \[m
COUNTER(assignment_stale) \[m
COUNTER(assignment_timeout_received) \[m
[31m- COUNTER(bind_errors) \[m
[32m+[m[32m COUNTER(update_attempt) \[m
[32m+[m[32m COUNTER(update_empty) \[m
[32m+[m[32m COUNTER(update_failure) \[m
[32m+[m[32m COUNTER(update_no_rebuild) \[m
[32m+[m[32m COUNTER(update_success) \[m
[32m+[m[32m GAUGE(version, NeverImport)[m
[32m+[m
[32m+[m[32m/**[m
[32m+[m[32m * All cluster endpoints related stats.[m
[32m+[m[32m */[m
[32m+[m[32m#define ALL_CLUSTER_ENDPOINT_STATS(COUNTER, GAUGE, HISTOGRAM, TEXT_READOUT, STATNAME) \[m
[32m+[m[32m GAUGE(max_host_weight, NeverImport) \[m
[32m+[m[32m COUNTER(membership_change) \[m
[32m+[m[32m GAUGE(membership_degraded, NeverImport) \[m
[32m+[m[32m GAUGE(membership_excluded, NeverImport) \[m
[32m+[m[32m GAUGE(membership_healthy, NeverImport) \[m
[32m+[m[32m GAUGE(membership_total, NeverImport)[m
[32m+[m
[32m+[m[32m/**[m
[32m+[m[32m * All cluster loadbalancing related stats.[m
[32m+[m[32m */[m
[32m+[m[32m#define ALL_CLUSTER_LB_STATS(COUNTER, GAUGE, HISTOGRAM, TEXT_READOUT, STATNAME) \[m
COUNTER(lb_healthy_panic) \[m
COUNTER(lb_local_cluster_not_ok) \[m
COUNTER(lb_recalculate_zone_structures) \[m
[36m@@ -585,14 +619,15 @@[m [mpublic:[m
COUNTER(lb_zone_routing_all_directly) \[m
COUNTER(lb_zone_routing_cross_zone) \[m
COUNTER(lb_zone_routing_sampled) \[m
[31m- COUNTER(membership_change) \[m
[32m+[m[32m GAUGE(lb_subsets_active, Accumulate)[m
[32m+[m
[32m+[m[32m/**[m
[32m+[m[32m * All cluster stats. @see stats_macros.h[m
[32m+[m[32m */[m
[32m+[m[32m#define ALL_CLUSTER_TRAFFIC_STATS(COUNTER, GAUGE, HISTOGRAM, TEXT_READOUT, STATNAME) \[m
[32m+[m[32m COUNTER(bind_errors) \[m
COUNTER(original_dst_host_invalid) \[m
COUNTER(retry_or_shadow_abandoned) \[m
[31m- COUNTER(update_attempt) \[m
[31m- COUNTER(update_empty) \[m
[31m- COUNTER(update_failure) \[m
[31m- COUNTER(update_no_rebuild) \[m
[31m- COUNTER(update_success) \[m
COUNTER(upstream_cx_close_notify) \[m
COUNTER(upstream_cx_connect_attempts_exceeded) \[m
COUNTER(upstream_cx_connect_fail) \[m
[36m@@ -644,18 +679,11 @@[m [mpublic:[m
COUNTER(upstream_rq_total) \[m
COUNTER(upstream_rq_tx_reset) \[m
COUNTER(upstream_http3_broken) \[m
[31m- GAUGE(lb_subsets_active, Accumulate) \[m
[31m- GAUGE(max_host_weight, NeverImport) \[m
[31m- GAUGE(membership_degraded, NeverImport) \[m
[31m- GAUGE(membership_excluded, NeverImport) \[m
[31m- GAUGE(membership_healthy, NeverImport) \[m
[31m- GAUGE(membership_total, NeverImport) \[m
GAUGE(upstream_cx_active, Accumulate) \[m
GAUGE(upstream_cx_rx_bytes_buffered, Accumulate) \[m
GAUGE(upstream_cx_tx_bytes_buffered, Accumulate) \[m
GAUGE(upstream_rq_active, Accumulate) \[m
GAUGE(upstream_rq_pending_active, Accumulate) \[m
[31m- GAUGE(version, NeverImport) \[m
HISTOGRAM(upstream_cx_connect_ms, Milliseconds) \[m
HISTOGRAM(upstream_cx_length_ms, Milliseconds)[m
[m
[36m@@ -708,10 +736,29 @@[m [mpublic:[m
HISTOGRAM(upstream_rq_timeout_budget_per_try_percent_used, Unspecified)[m
[m
/**[m
[31m- * Struct definition for all cluster stats. @see stats_macros.h[m
[32m+[m[32m * Struct definition for cluster config update stats. @see stats_macros.h[m
[32m+[m[32m */[m
[32m+[m[32mMAKE_STAT_NAMES_STRUCT(ClusterConfigUpdateStatNames, ALL_CLUSTER_CONFIG_UPDATE_STATS);[m
[32m+[m[32mMAKE_STATS_STRUCT(ClusterConfigUpdateStats, ClusterConfigUpdateStatNames,[m
[32m+[m[32m ALL_CLUSTER_CONFIG_UPDATE_STATS);[m
[32m+[m
[32m+[m[32m/**[m
[32m+[m[32m * Struct definition for cluster endpoint related stats. @see stats_macros.h[m
[32m+[m[32m */[m
[32m+[m[32mMAKE_STAT_NAMES_STRUCT(ClusterEndpointStatNames, ALL_CLUSTER_ENDPOINT_STATS);[m
[32m+[m[32mMAKE_STATS_STRUCT(ClusterEndpointStats, ClusterEndpointStatNames, ALL_CLUSTER_ENDPOINT_STATS);[m
[32m+[m
[32m+[m[32m/**[m
[32m+[m[32m * Struct definition for cluster load balancing stats. @see stats_macros.h[m
*/[m
[31m-MAKE_STAT_NAMES_STRUCT(ClusterStatNames, ALL_CLUSTER_STATS);[m
[31m-MAKE_STATS_STRUCT(ClusterStats, ClusterStatNames, ALL_CLUSTER_STATS);[m
[32m+[m[32mMAKE_STAT_NAMES_STRUCT(ClusterLbStatNames, ALL_CLUSTER_LB_STATS);[m
[32m+[m[32mMAKE_STATS_STRUCT(ClusterLbStats, ClusterLbStatNames, ALL_CLUSTER_LB_STATS);[m
[32m+[m
[32m+[m[32m/**[m
[32m+[m[32m * Struct definition for all cluster traffic stats. @see stats_macros.h[m
[32m+[m[32m */[m
[32m+[m[32mMAKE_STAT_NAMES_STRUCT(ClusterTrafficStatNames, ALL_CLUSTER_TRAFFIC_STATS);[m
[32m+[m[32mMAKE_STATS_STRUCT(ClusterTrafficStats, ClusterTrafficStatNames, ALL_CLUSTER_TRAFFIC_STATS);[m
[m
MAKE_STAT_NAMES_STRUCT(ClusterLoadReportStatNames, ALL_CLUSTER_LOAD_REPORT_STATS);[m
MAKE_STATS_STRUCT(ClusterLoadReportStats, ClusterLoadReportStatNames,[m
[36m@@ -992,9 +1039,24 @@[m [mpublic:[m
virtual TransportSocketMatcher& transportSocketMatcher() const PURE;[m
[m
/**[m
[31m- * @return ClusterStats& strongly named stats for this cluster.[m
[32m+[m[32m * @return ClusterConfigUpdateStats& config update stats for this cluster.[m
[32m+[m[32m */[m
[32m+[m[32m virtual ClusterConfigUpdateStats& configUpdateStats() const PURE;[m
[32m+[m
[32m+[m[32m /**[m
[32m+[m[32m * @return ClusterLbStats& load-balancer-related stats for this cluster.[m
[32m+[m[32m */[m
[32m+[m[32m virtual ClusterLbStats& lbStats() const PURE;[m
[32m+[m
[32m+[m[32m /**[m
[32m+[m[32m * @return ClusterEndpointStats& endpoint related stats for this cluster.[m
[32m+[m[32m */[m
[32m+[m[32m virtual ClusterEndpointStats& endpointStats() const PURE;[m
[32m+[m
[32m+[m[32m /**[m
[32m+[m[32m * @return ClusterTrafficStats& all traffic related stats for this cluster.[m
*/[m
[31m- virtual ClusterStats& stats() const PURE;[m
[32m+[m[32m virtual ClusterTrafficStats& trafficStats() const PURE;[m
[m
/**[m
* @return the stats scope that contains all cluster stats. This can be used to produce dynamic[m
[36m@@ -1003,7 +1065,7 @@[m [mpublic:[m
virtual Stats::Scope& statsScope() const PURE;[m
[m
/**[m
[31m- * @return ClusterLoadReportStats& strongly named load report stats for this cluster.[m
[32m+[m[32m * @return ClusterLoadReportStats& load report stats for this cluster.[m
*/[m
virtual ClusterLoadReportStats& loadReportStats() const PURE;[m
[m
[1mdiff --git a/examples/ext_authz/auth/grpc-service/Dockerfile b/examples/ext_authz/auth/grpc-service/Dockerfile[m
[1mindex 99d1ac5926..778497f4c2 100644[m
[1m--- a/examples/ext_authz/auth/grpc-service/Dockerfile[m
[1m+++ b/examples/ext_authz/auth/grpc-service/Dockerfile[m
[36m@@ -1,4 +1,4 @@[m
[31m-FROM golang:alpine@sha256:8558ae624304387d18694b9ea065cc9813dd4f7f9bd5073edb237541f2d0561b AS builder[m
[32m+[m[32mFROM golang:alpine@sha256:dc4f4756a4fb91b6f496a958e11e00c0621130c8dfbb31ac0737b0229ad6ad9c AS builder[m
[m
RUN apk --no-cache add make[m
COPY . /app[m
[1mdiff --git a/examples/ext_authz/auth/http-service/Dockerfile b/examples/ext_authz/auth/http-service/Dockerfile[m
[1mindex 28c511b2d1..805d3ed04e 100644[m
[1m--- a/examples/ext_authz/auth/http-service/Dockerfile[m
[1m+++ b/examples/ext_authz/auth/http-service/Dockerfile[m
[36m@@ -1,4 +1,4 @@[m
[31m-FROM node:alpine@sha256:00c5c0850a48bbbf0136f1c886bad52784f9816a8d314a99307d734598359ed4[m
[32m+[m[32mFROM node:alpine@sha256:083a23fe246cc82294f64e154f5d6bce8c90b9fc8f2dce54d3c58d41ddd8f8c8[m
[m
COPY . /app[m
CMD ["node", "/app/http-service/server"][m
[1mdiff --git a/examples/shared/postgres/Dockerfile b/examples/shared/postgres/Dockerfile[m
[1mindex daa795e062..4129a88250 100644[m
[1m--- a/examples/shared/postgres/Dockerfile[m
[1m+++ b/examples/shared/postgres/Dockerfile[m
[36m@@ -1 +1 @@[m
[31m-FROM postgres:latest@sha256:bab8d7be6466e029f7fa1e69ff6aa0082704db330572638fd01f2791824774d8[m
[32m+[m[32mFROM postgres:latest@sha256:9eb2589e67e69daf321fa95ae40e7509ce08bb1ef90d5a27a0775aa88ee0c704[m
[1mdiff --git a/source/common/common/matchers.cc b/source/common/common/matchers.cc[m
[1mindex 021e5e9a64..c1355f35f2 100644[m
[1m--- a/source/common/common/matchers.cc[m
[1m+++ b/source/common/common/matchers.cc[m
[36m@@ -96,6 +96,33 @@[m [mMetadataMatcher::MetadataMatcher(const envoy::type::matcher::v3::MetadataMatcher[m
value_matcher_ = ValueMatcher::create(v);[m
}[m
[m
[32m+[m[32mnamespace {[m
[32m+[m[32mStringMatcherPtr[m
[32m+[m[32mvalueMatcherFromProto(const envoy::type::matcher::v3::FilterStateMatcher& matcher) {[m
[32m+[m[32m switch (matcher.matcher_case()) {[m
[32m+[m[32m case envoy::type::matcher::v3::FilterStateMatcher::MatcherCase::kStringMatch:[m
[32m+[m[32m return std::make_unique<const StringMatcherImpl<envoy::type::matcher::v3::StringMatcher>>([m
[32m+[m[32m matcher.string_match());[m
[32m+[m[32m break;[m
[32m+[m[32m default:[m
[32m+[m[32m PANIC_DUE_TO_PROTO_UNSET;[m
[32m+[m[32m }[m
[32m+[m[32m}[m
[32m+[m
[32m+[m[32m} // namespace[m
[32m+[m
[32m+[m[32mFilterStateMatcher::FilterStateMatcher(const envoy::type::matcher::v3::FilterStateMatcher& matcher)[m
[32m+[m[32m : key_(matcher.key()), value_matcher_(valueMatcherFromProto(matcher)) {}[m
[32m+[m
[32m+[m[32mbool FilterStateMatcher::match(const StreamInfo::FilterState& filter_state) const {[m
[32m+[m[32m const auto* object = filter_state.getDataReadOnlyGeneric(key_);[m
[32m+[m[32m if (object == nullptr) {[m
[32m+[m[32m return false;[m
[32m+[m[32m }[m
[32m+[m[32m const auto string_value = object->serializeAsString();[m
[32m+[m[32m return string_value && value_matcher_->match(*string_value);[m
[32m+[m[32m}[m
[32m+[m
PathMatcherConstSharedPtr PathMatcher::createExact(const std::string& exact, bool ignore_case) {[m
envoy::type::matcher::v3::StringMatcher matcher;[m
matcher.set_exact(exact);[m
[1mdiff --git a/source/common/common/matchers.h b/source/common/common/matchers.h[m
[1mindex 34a8730dbd..214c628b64 100644[m
[1m--- a/source/common/common/matchers.h[m
[1m+++ b/source/common/common/matchers.h[m
[36m@@ -6,6 +6,7 @@[m
#include "envoy/common/matchers.h"[m
#include "envoy/common/regex.h"[m
#include "envoy/config/core/v3/base.pb.h"[m
[32m+[m[32m#include "envoy/type/matcher/v3/filter_state.pb.h"[m
#include "envoy/type/matcher/v3/metadata.pb.h"[m
#include "envoy/type/matcher/v3/number.pb.h"[m
#include "envoy/type/matcher/v3/path.pb.h"[m
[36m@@ -189,6 +190,22 @@[m [mprivate:[m
ValueMatcherConstSharedPtr value_matcher_;[m
};[m
[m
[32m+[m[32mclass FilterStateMatcher {[m
[32m+[m[32mpublic:[m
[32m+[m[32m FilterStateMatcher(const envoy::type::matcher::v3::FilterStateMatcher& matcher);[m
[32m+[m
[32m+[m[32m /**[m
[32m+[m[32m * Check whether the filter state object is matched to the matcher.[m
[32m+[m[32m * @param filter state to check.[m
[32m+[m[32m * @return true if it's matched otherwise false.[m
[32m+[m[32m */[m
[32m+[m[32m bool match(const StreamInfo::FilterState& filter_state) const;[m
[32m+[m
[32m+[m[32mprivate:[m
[32m+[m[32m const std::string key_;[m
[32m+[m[32m const StringMatcherPtr value_matcher_;[m
[32m+[m[32m};[m
[32m+[m
class PathMatcher : public StringMatcher {[m
public:[m
PathMatcher(const envoy::type::matcher::v3::PathMatcher& path) : matcher_(path.path()) {}[m
[1mdiff --git a/source/common/conn_pool/conn_pool_base.cc b/source/common/conn_pool/conn_pool_base.cc[m
[1mindex 78d26a13f9..31ee3f3aff 100644[m
[1m--- a/source/common/conn_pool/conn_pool_base.cc[m
[1m+++ b/source/common/conn_pool/conn_pool_base.cc[m
[36m@@ -135,7 +135,7 @@[m [mConnPoolImplBase::tryCreateNewConnection(float global_preconnect_ratio) {[m
const bool can_create_connection = host_->canCreateConnection(priority_);[m
[m
if (!can_create_connection) {[m
[31m- host_->cluster().stats().upstream_cx_overflow_.inc();[m
[32m+[m[32m host_->cluster().trafficStats().upstream_cx_overflow_.inc();[m
}[m
// If we are at the connection circuit-breaker limit due to other upstreams having[m
// too many open connections, and this upstream has no connections, always create one, to[m
[36m@@ -168,14 +168,14 @@[m [mvoid ConnPoolImplBase::attachStreamToClient(Envoy::ConnectionPool::ActiveClient&[m
ASSERT(client.readyForStream());[m
[m
if (client.state() == Envoy::ConnectionPool::ActiveClient::State::ReadyForEarlyData) {[m
[31m- host_->cluster().stats().upstream_rq_0rtt_.inc();[m
[32m+[m[32m host_->cluster().trafficStats().upstream_rq_0rtt_.inc();[m
}[m
[m
if (enforceMaxRequests() && !host_->cluster().resourceManager(priority_).requests().canCreate()) {[m
ENVOY_LOG(debug, "max streams overflow");[m
onPoolFailure(client.real_host_description_, absl::string_view(),[m
ConnectionPool::PoolFailureReason::Overflow, context);[m
[31m- host_->cluster().stats().upstream_rq_pending_overflow_.inc();[m
[32m+[m[32m host_->cluster().trafficStats().upstream_rq_pending_overflow_.inc();[m
return;[m
}[m
ENVOY_CONN_LOG(debug, "creating stream", client);[m
[36m@@ -185,7 +185,7 @@[m [mvoid ConnPoolImplBase::attachStreamToClient(Envoy::ConnectionPool::ActiveClient&[m
client.remaining_streams_--;[m
if (client.remaining_streams_ == 0) {[m
ENVOY_CONN_LOG(debug, "maximum streams per connection, start draining", client);[m
[31m- host_->cluster().stats().upstream_cx_max_requests_.inc();[m
[32m+[m[32m host_->cluster().trafficStats().upstream_cx_max_requests_.inc();[m
transitionActiveClientState(client, Envoy::ConnectionPool::ActiveClient::State::Draining);[m
} else if (capacity == 1) {[m
// As soon as the new stream is created, the client will be maxed out.[m
[36m@@ -202,8 +202,8 @@[m [mvoid ConnPoolImplBase::attachStreamToClient(Envoy::ConnectionPool::ActiveClient&[m
num_active_streams_++;[m
host_->stats().rq_total_.inc();[m
host_->stats().rq_active_.inc();[m
[31m- host_->cluster().stats().upstream_rq_total_.inc();[m
[31m- host_->cluster().stats().upstream_rq_active_.inc();[m
[32m+[m[32m host_->cluster().trafficStats().upstream_rq_total_.inc();[m
[32m+[m[32m host_->cluster().trafficStats().upstream_rq_active_.inc();[m
host_->cluster().resourceManager(priority_).requests().inc();[m
[m
onPoolReady(client, context);[m
[36m@@ -216,7 +216,7 @@[m [mvoid ConnPoolImplBase::onStreamClosed(Envoy::ConnectionPool::ActiveClient& clien[m
state_.decrActiveStreams(1);[m
num_active_streams_--;[m
host_->stats().rq_active_.dec();[m
[31m- host_->cluster().stats().upstream_rq_active_.dec();[m
[32m+[m[32m host_->cluster().trafficStats().upstream_rq_active_.dec();[m
host_->cluster().resourceManager(priority_).requests().dec();[m
// We don't update the capacity for HTTP/3 as the stream count should only[m
// increase when a MAX_STREAMS frame is received.[m
[36m@@ -282,7 +282,7 @@[m [mConnectionPool::Cancellable* ConnPoolImplBase::newStreamImpl(AttachContext& cont[m
ENVOY_LOG(debug, "max pending streams overflow");[m
onPoolFailure(nullptr, absl::string_view(), ConnectionPool::PoolFailureReason::Overflow,[m
context);[m
[31m- host_->cluster().stats().upstream_rq_pending_overflow_.inc();[m
[32m+[m[32m host_->cluster().trafficStats().upstream_rq_pending_overflow_.inc();[m
return nullptr;[m
}[m
[m
[36m@@ -490,7 +490,7 @@[m [mvoid ConnPoolImplBase::onConnectionEvent(ActiveClient& client, absl::string_view[m
[m
if (!client.hasHandshakeCompleted()) {[m
client.has_handshake_completed_ = true;[m
[31m- host_->cluster().stats().upstream_cx_connect_fail_.inc();[m
[32m+[m[32m host_->cluster().trafficStats().upstream_cx_connect_fail_.inc();[m
host_->stats().cx_connect_fail_.inc();[m
[m
onConnectFailed(client);[m
[36m@@ -595,7 +595,7 @@[m [mvoid ConnPoolImplBase::onConnectionEvent(ActiveClient& client, absl::string_view[m
client.currentUnusedCapacity());[m
// No need to update connecting capacity and connect_timer_ as the client is still connecting.[m
ASSERT(client.state() == ActiveClient::State::Connecting);[m
[31m- host()->cluster().stats().upstream_cx_connect_with_0_rtt_.inc();[m
[32m+[m[32m host()->cluster().trafficStats().upstream_cx_connect_with_0_rtt_.inc();[m
transitionActiveClientState(client, (client.currentUnusedCapacity() > 0[m
? ActiveClient::State::ReadyForEarlyData[m
: ActiveClient::State::Busy));[m
[36m@@ -606,13 +606,13 @@[m [mvoid ConnPoolImplBase::onConnectionEvent(ActiveClient& client, absl::string_view[m
[m
PendingStream::PendingStream(ConnPoolImplBase& parent, bool can_send_early_data)[m
: parent_(parent), can_send_early_data_(can_send_early_data) {[m
[31m- parent_.host()->cluster().stats().upstream_rq_pending_total_.inc();[m
[31m- parent_.host()->cluster().stats().upstream_rq_pending_active_.inc();[m
[32m+[m[32m parent_.host()->cluster().trafficStats().upstream_rq_pending_total_.inc();[m
[32m+[m[32m parent_.host()->cluster().trafficStats().upstream_rq_pending_active_.inc();[m
parent_.host()->cluster().resourceManager(parent_.priority()).pendingRequests().inc();[m
}[m
[m
PendingStream::~PendingStream() {[m
[31m- parent_.host()->cluster().stats().upstream_rq_pending_active_.dec();[m
[32m+[m[32m parent_.host()->cluster().trafficStats().upstream_rq_pending_active_.dec();[m
parent_.host()->cluster().resourceManager(parent_.priority()).pendingRequests().dec();[m
}[m
[m
[36m@@ -630,7 +630,7 @@[m [mvoid ConnPoolImplBase::purgePendingStreams([m
while (!pending_streams_to_purge_.empty()) {[m
PendingStreamPtr stream =[m
pending_streams_to_purge_.front()->removeFromList(pending_streams_to_purge_);[m
[31m- host_->cluster().stats().upstream_rq_pending_failure_eject_.inc();[m
[32m+[m[32m host_->cluster().trafficStats().upstream_rq_pending_failure_eject_.inc();[m
onPoolFailure(host_description, failure_reason, reason, stream->context());[m
}[m
}[m
[36m@@ -683,7 +683,7 @@[m [mvoid ConnPoolImplBase::onPendingStreamCancel(PendingStream& stream,[m
}[m
}[m
[m
[31m- host_->cluster().stats().upstream_rq_cancelled_.inc();[m
[32m+[m[32m host_->cluster().trafficStats().upstream_rq_cancelled_.inc();[m
checkForIdleAndCloseIdleConnsIfDraining();[m
}[m
[m
[36m@@ -757,14 +757,16 @@[m [mActiveClient::ActiveClient(ConnPoolImplBase& parent, uint32_t lifetime_stream_li[m
concurrent_stream_limit_(translateZeroToUnlimited(concurrent_stream_limit)),[m
connect_timer_(parent_.dispatcher().createTimer([this]() { onConnectTimeout(); })) {[m
conn_connect_ms_ = std::make_unique<Stats::HistogramCompletableTimespanImpl>([m
[31m- parent_.host()->cluster().stats().upstream_cx_connect_ms_, parent_.dispatcher().timeSource());[m
[32m+[m[32m parent_.host()->cluster().trafficStats().upstream_cx_connect_ms_,[m
[32m+[m[32m parent_.dispatcher().timeSource());[m
conn_length_ = std::make_unique<Stats::HistogramCompletableTimespanImpl>([m
[31m- parent_.host()->cluster().stats().upstream_cx_length_ms_, parent_.dispatcher().timeSource());[m
[32m+[m[32m parent_.host()->cluster().trafficStats().upstream_cx_length_ms_,[m
[32m+[m[32m parent_.dispatcher().timeSource());[m
connect_timer_->enableTimer(parent_.host()->cluster().connectTimeout());[m
parent_.host()->stats().cx_total_.inc();[m
parent_.host()->stats().cx_active_.inc();[m
[31m- parent_.host()->cluster().stats().upstream_cx_total_.inc();[m
[31m- parent_.host()->cluster().stats().upstream_cx_active_.inc();[m
[32m+[m[32m parent_.host()->cluster().trafficStats().upstream_cx_total_.inc();[m
[32m+[m[32m parent_.host()->cluster().trafficStats().upstream_cx_active_.inc();[m
parent_.host()->cluster().resourceManager(parent_.priority()).connections().inc();[m
}[m
[m
[36m@@ -776,7 +778,7 @@[m [mvoid ActiveClient::releaseResourcesBase() {[m
[m
conn_length_->complete();[m
[m
[31m- parent_.host()->cluster().stats().upstream_cx_active_.dec();[m
[32m+[m[32m parent_.host()->cluster().trafficStats().upstream_cx_active_.dec();[m
parent_.host()->stats().cx_active_.dec();[m
parent_.host()->cluster().resourceManager(parent_.priority()).connections().dec();[m
}[m
[36m@@ -784,7 +786,7 @@[m [mvoid ActiveClient::releaseResourcesBase() {[m
[m
void ActiveClient::onConnectTimeout() {[m
ENVOY_CONN_LOG(debug, "connect timeout", *this);[m
[31m- parent_.host()->cluster().stats().upstream_cx_connect_timeout_.inc();[m
[32m+[m[32m parent_.host()->cluster().trafficStats().upstream_cx_connect_timeout_.inc();[m
timed_out_ = true;[m
close();[m
}[m
[36m@@ -809,7 +811,7 @@[m [mvoid ActiveClient::onConnectionDurationTimeout() {[m
}[m
[m
ENVOY_CONN_LOG(debug, "max connection duration reached, start draining", *this);[m
[31m- parent_.host()->cluster().stats().upstream_cx_max_duration_reached_.inc();[m
[32m+[m[32m parent_.host()->cluster().trafficStats().upstream_cx_max_duration_reached_.inc();[m
parent_.transitionActiveClientState(*this, Envoy::ConnectionPool::ActiveClient::State::Draining);[m
[m
// Close out the draining client if we no longer have active streams.[m
[1mdiff --git a/source/common/event/dispatcher_impl.cc b/source/common/event/dispatcher_impl.cc[m
[1mindex 104d72afc9..fead55e225 100644[m
[1m--- a/source/common/event/dispatcher_impl.cc[m
[1m+++ b/source/common/event/dispatcher_impl.cc[m
[36m@@ -151,8 +151,8 @@[m [mDispatcherImpl::createServerConnection(Network::ConnectionSocketPtr&& socket,[m
Network::TransportSocketPtr&& transport_socket,[m
StreamInfo::StreamInfo& stream_info) {[m
ASSERT(isThreadSafe());[m
[31m- return std::make_unique<Network::ServerConnectionImpl>([m
[31m- *this, std::move(socket), std::move(transport_socket), stream_info, true);[m
[32m+[m[32m return std::make_unique<Network::ServerConnectionImpl>(*this, std::move(socket),[m
[32m+[m[32m std::move(transport_socket), stream_info);[m
}[m
[m
Network::ClientConnectionPtr DispatcherImpl::createClientConnection([m
[1mdiff --git a/source/common/http/codec_client.cc b/source/common/http/codec_client.cc[m
[1mindex e7e8008ef1..19c1110618 100644[m
[1m--- a/source/common/http/codec_client.cc[m
[1m+++ b/source/common/http/codec_client.cc[m
[36m@@ -171,7 +171,7 @@[m [mvoid CodecClient::onData(Buffer::Instance& data) {[m
if (!isPrematureResponseError(status) ||[m
(!active_requests_.empty() ||[m
getPrematureResponseHttpCode(status) != Code::RequestTimeout)) {[m
[31m- host_->cluster().stats().upstream_cx_protocol_error_.inc();[m
[32m+[m[32m host_->cluster().trafficStats().upstream_cx_protocol_error_.inc();[m
protocol_error_ = true;[m
}[m
close();[m
[1mdiff --git a/source/common/http/codec_client.h b/source/common/http/codec_client.h[m
[1mindex c53fbf5c34..6dee7081f4 100644[m
[1m--- a/source/common/http/codec_client.h[m
[1m+++ b/source/common/http/codec_client.h[m
[36m@@ -164,7 +164,7 @@[m [mprotected:[m
}[m
[m
void onIdleTimeout() {[m
[31m- host_->cluster().stats().upstream_cx_idle_timeout_.inc();[m
[32m+[m[32m host_->cluster().trafficStats().upstream_cx_idle_timeout_.inc();[m
close();[m
}[m
[m
[1mdiff --git a/source/common/http/conn_pool_base.cc b/source/common/http/conn_pool_base.cc[m
[1mindex 284e479a86..0ed8e5ef1c 100644[m
[1m--- a/source/common/http/conn_pool_base.cc[m
[1m+++ b/source/common/http/conn_pool_base.cc[m
[36m@@ -99,7 +99,7 @@[m [mstatic const uint64_t DEFAULT_MAX_STREAMS = (1 << 29);[m
[m
void MultiplexedActiveClientBase::onGoAway(Http::GoAwayErrorCode) {[m
ENVOY_CONN_LOG(debug, "remote goaway", *codec_client_);[m
[31m- parent_.host()->cluster().stats().upstream_cx_close_notify_.inc();[m
[32m+[m[32m parent_.host()->cluster().trafficStats().upstream_cx_close_notify_.inc();[m
if (state() != ActiveClient::State::Draining) {[m
if (codec_client_->numActiveRequests() == 0) {[m
codec_client_->close();[m
[36m@@ -160,16 +160,16 @@[m [mvoid MultiplexedActiveClientBase::onStreamReset(Http::StreamResetReason reason)[m
switch (reason) {[m
case StreamResetReason::ConnectionTermination:[m
case StreamResetReason::ConnectionFailure:[m
[31m- parent_.host()->cluster().stats().upstream_rq_pending_failure_eject_.inc();[m
[32m+[m[32m parent_.host()->cluster().trafficStats().upstream_rq_pending_failure_eject_.inc();[m
closed_with_active_rq_ = true;[m
break;[m
case StreamResetReason::LocalReset:[m
case StreamResetReason::ProtocolError:[m
case StreamResetReason::OverloadManager:[m
[31m- parent_.host()->cluster().stats().upstream_rq_tx_reset_.inc();[m
[32m+[m[32m parent_.host()->cluster().trafficStats().upstream_rq_tx_reset_.inc();[m
break;[m
case StreamResetReason::RemoteReset:[m
[31m- parent_.host()->cluster().stats().upstream_rq_rx_reset_.inc();[m
[32m+[m[32m parent_.host()->cluster().trafficStats().upstream_rq_rx_reset_.inc();[m
break;[m
case StreamResetReason::LocalRefusedStreamReset:[m
case StreamResetReason::RemoteRefusedStreamReset:[m
[1mdiff --git a/source/common/http/conn_pool_base.h b/source/common/http/conn_pool_base.h[m
[1mindex 44451ab606..33e2faabf1 100644[m
[1m--- a/source/common/http/conn_pool_base.h[m
[1m+++ b/source/common/http/conn_pool_base.h[m
[36m@@ -129,11 +129,11 @@[m [mpublic:[m
codec_client_ = parent.createCodecClient(data);[m
codec_client_->addConnectionCallbacks(*this);[m
codec_client_->setConnectionStats([m
[31m- {parent_.host()->cluster().stats().upstream_cx_rx_bytes_total_,[m
[31m- parent_.host()->cluster().stats().upstream_cx_rx_bytes_buffered_,[m
[31m- parent_.host()->cluster().stats().upstream_cx_tx_bytes_total_,[m
[31m- parent_.host()->cluster().stats().upstream_cx_tx_bytes_buffered_,[m
[31m- &parent_.host()->cluster().stats().bind_errors_, nullptr});[m
[32m+[m[32m {parent_.host()->cluster().trafficStats().upstream_cx_rx_bytes_total_,[m
[32m+[m[32m parent_.host()->cluster().trafficStats().upstream_cx_rx_bytes_buffered_,[m
[32m+[m[32m parent_.host()->cluster().trafficStats().upstream_cx_tx_bytes_total_,[m
[32m+[m[32m parent_.host()->cluster().trafficStats().upstream_cx_tx_bytes_buffered_,[m
[32m+[m[32m &parent_.host()->cluster().trafficStats().bind_errors_, nullptr});[m
}[m
[m
absl::optional<Http::Protocol> protocol() const override { return codec_client_->protocol(); }[m
[1mdiff --git a/source/common/http/conn_pool_grid.cc b/source/common/http/conn_pool_grid.cc[m
[1mindex 6c45e48eca..15db9536b9 100644[m
[1m--- a/source/common/http/conn_pool_grid.cc[m
[1m+++ b/source/common/http/conn_pool_grid.cc[m
[36m@@ -382,7 +382,7 @@[m [mHttpServerPropertiesCache::Http3StatusTracker& ConnectivityGrid::getHttp3StatusT[m
bool ConnectivityGrid::isHttp3Broken() const { return getHttp3StatusTracker().isHttp3Broken(); }[m
[m
void ConnectivityGrid::markHttp3Broken() {[m
[31m- host_->cluster().stats().upstream_http3_broken_.inc();[m
[32m+[m[32m host_->cluster().trafficStats().upstream_http3_broken_.inc();[m
getHttp3StatusTracker().markHttp3Broken();[m
}[m
[m
[1mdiff --git a/source/common/http/http1/balsa_parser.cc b/source/common/http/http1/balsa_parser.cc[m
[1mindex 4fe04ab5a3..4cba847421 100644[m
[1m--- a/source/common/http/http1/balsa_parser.cc[m
[1m+++ b/source/common/http/http1/balsa_parser.cc[m
[36m@@ -143,7 +143,12 @@[m [mParserStatus BalsaParser::getStatus() const { return status_; }[m
uint16_t BalsaParser::statusCode() const { return headers_.parsed_response_code(); }[m
[m
bool BalsaParser::isHttp11() const {[m
[31m- return absl::EndsWith(headers_.first_line(), Http::Headers::get().ProtocolStrings.Http11String);[m
[32m+[m[32m if (framer_.is_request()) {[m
[32m+[m[32m return absl::EndsWith(headers_.first_line(), Http::Headers::get().ProtocolStrings.Http11String);[m
[32m+[m[32m } else {[m
[32m+[m[32m return absl::StartsWith(headers_.first_line(),[m
[32m+[m[32m Http::Headers::get().ProtocolStrings.Http11String);[m
[32m+[m[32m }[m
}[m
[m
absl::optional<uint64_t> BalsaParser::contentLength() const {[m
[1mdiff --git a/source/common/http/http1/conn_pool.cc b/source/common/http/http1/conn_pool.cc[m
[1mindex ab7165f5d3..77cf7ebcdd 100644[m
[1m--- a/source/common/http/http1/conn_pool.cc[m
[1m+++ b/source/common/http/http1/conn_pool.cc[m
[36m@@ -42,7 +42,7 @@[m [mvoid ActiveClient::StreamWrapper::decodeHeaders(ResponseHeaderMapPtr&& headers,[m
close_connection_ =[m
HeaderUtility::shouldCloseConnection(parent_.codec_client_->protocol(), *headers);[m
if (close_connection_) {[m
[31m- parent_.parent().host()->cluster().stats().upstream_cx_close_notify_.inc();[m
[32m+[m[32m parent_.parent().host()->cluster().trafficStats().upstream_cx_close_notify_.inc();[m
}[m
ResponseDecoderWrapper::decodeHeaders(std::move(headers), end_stream);[m
}[m
[36m@@ -76,7 +76,7 @@[m [mActiveClient::ActiveClient(HttpConnPoolImplBase& parent,[m
: Envoy::Http::ActiveClient(parent, parent.host()->cluster().maxRequestsPerConnection(),[m
/* effective_concurrent_stream_limit */ 1,[m
/* configured_concurrent_stream_limit */ 1, data) {[m
[31m- parent.host()->cluster().stats().upstream_cx_http1_total_.inc();[m
[32m+[m[32m parent.host()->cluster().trafficStats().upstream_cx_http1_total_.inc();[m
}[m
[m
ActiveClient::~ActiveClient() { ASSERT(!stream_wrapper_.get()); }[m
[1mdiff --git a/source/common/http/http2/conn_pool.cc b/source/common/http/http2/conn_pool.cc[m
[1mindex 8879d75282..67761b3889 100644[m
[1m--- a/source/common/http/http2/conn_pool.cc[m
[1m+++ b/source/common/http/http2/conn_pool.cc[m
[36m@@ -45,7 +45,7 @@[m [mActiveClient::ActiveClient(HttpConnPoolImplBase& parent,[m
: MultiplexedActiveClientBase([m
parent, calculateInitialStreamsLimit(parent.cache(), parent.origin(), parent.host()),[m
parent.host()->cluster().http2Options().max_concurrent_streams().value(),[m
[31m- parent.host()->cluster().stats().upstream_cx_http2_total_, data) {}[m
[32m+[m[32m parent.host()->cluster().trafficStats().upstream_cx_http2_total_, data) {}[m
[m
ConnectionPool::InstancePtr[m
allocateConnPool(Event::Dispatcher& dispatcher, Random::RandomGenerator& random_generator,[m
[1mdiff --git a/source/common/http/http3/conn_pool.cc b/source/common/http/http3/conn_pool.cc[m
[1mindex 25d3cc5bc5..061f71b364 100644[m
[1m--- a/source/common/http/http3/conn_pool.cc[m
[1m+++ b/source/common/http/http3/conn_pool.cc[m
[36m@@ -39,9 +39,9 @@[m [mstd::string sni(const Network::TransportSocketOptionsConstSharedPtr& options,[m
[m
ActiveClient::ActiveClient(Envoy::Http::HttpConnPoolImplBase& parent,[m
Upstream::Host::CreateConnectionData& data)[m
[31m- : MultiplexedActiveClientBase(parent, getMaxStreams(parent.host()->cluster()),[m
[31m- getMaxStreams(parent.host()->cluster()),[m
[31m- parent.host()->cluster().stats().upstream_cx_http3_total_, data),[m
[32m+[m[32m : MultiplexedActiveClientBase([m
[32m+[m[32m parent, getMaxStreams(parent.host()->cluster()), getMaxStreams(parent.host()->cluster()),[m
[32m+[m[32m parent.host()->cluster().trafficStats().upstream_cx_http3_total_, data),[m
async_connect_callback_(parent_.dispatcher().createSchedulableCallback([this]() {[m
if (state() != Envoy::ConnectionPool::ActiveClient::State::Connecting) {[m
return;[m
[1mdiff --git a/source/common/http/utility.cc b/source/common/http/utility.cc[m
[1mindex e5d8b851f8..b20bbeb086 100644[m
[1m--- a/source/common/http/utility.cc[m
[1m+++ b/source/common/http/utility.cc[m
[36m@@ -551,25 +551,6 @@[m [mbool Utility::isWebSocketUpgradeRequest(const RequestHeaderMap& headers) {[m
Http::Headers::get().UpgradeValues.WebSocket));[m
}[m
[m
[31m-void Utility::sendLocalReply(const bool& is_reset, StreamDecoderFilterCallbacks& callbacks,[m
[31m- const LocalReplyData& local_reply_data) {[m
[31m- absl::string_view details;[m
[31m- if (callbacks.streamInfo().responseCodeDetails().has_value()) {[m
[31m- details = callbacks.streamInfo().responseCodeDetails().value();[m
[31m- };[m
[31m-[m
[31m- sendLocalReply([m
[31m- is_reset,[m
[31m- Utility::EncodeFunctions{nullptr, nullptr,[m
[31m- [&](ResponseHeaderMapPtr&& headers, bool end_stream) -> void {[m
[31m- callbacks.encodeHeaders(std::move(headers), end_stream, details);[m
[31m- },[m
[31m- [&](Buffer::Instance& data, bool end_stream) -> void {[m
[31m- callbacks.encodeData(data, end_stream);[m
[31m- }},[m
[31m- local_reply_data);[m
[31m-}[m
[31m-[m
void Utility::sendLocalReply(const bool& is_reset, const EncodeFunctions& encode_functions,[m
const LocalReplyData& local_reply_data) {[m
// encode_headers() may reset the stream, so the stream must not be reset before calling it.[m
[1mdiff --git a/source/common/http/utility.h b/source/common/http/utility.h[m
[1mindex 641bf2d764..90ae1fbb2f 100644[m
[1m--- a/source/common/http/utility.h[m
[1m+++ b/source/common/http/utility.h[m
[36m@@ -379,17 +379,6 @@[m [mstruct LocalReplyData {[m
bool is_head_request_ = false;[m
};[m
[m
[31m-/**[m
[31m- * Create a locally generated response using filter callbacks.[m
[31m- * @param is_reset boolean reference that indicates whether a stream has been reset. It is the[m
[31m- * responsibility of the caller to ensure that this is set to false if onDestroy()[m
[31m- * is invoked in the context of sendLocalReply().[m
[31m- * @param callbacks supplies the filter callbacks to use.[m
[31m- * @param local_reply_data struct which keeps data related to generate reply.[m
[31m- */[m
[31m-void sendLocalReply(const bool& is_reset, StreamDecoderFilterCallbacks& callbacks,[m
[31m- const LocalReplyData& local_reply_data);[m
[31m-[m
/**[m
* Create a locally generated response using the provided lambdas.[m
[m
[1mdiff --git a/source/common/matcher/matcher.h b/source/common/matcher/matcher.h[m
[1mindex 265182fc40..ff83ecfbdb 100644[m
[1m--- a/source/common/matcher/matcher.h[m
[1m+++ b/source/common/matcher/matcher.h[m
[36m@@ -24,8 +24,10 @@[m
namespace Envoy {[m
namespace Matcher {[m
[m