Skip to content

admin: Streaming version of /config_dump - #46911

Open
filipcacky wants to merge 6 commits into
envoyproxy:mainfrom
filipcacky:config_streamed
Open

admin: Streaming version of /config_dump#46911
filipcacky wants to merge 6 commits into
envoyproxy:mainfrom
filipcacky:config_streamed

Conversation

@filipcacky

Copy link
Copy Markdown
Contributor

Commit Message: admin: Streaming version of /config_dump
Additional Description:

Implements streaming version of /config_dump. Each tracked config name is snapshotted at the start and the config is materialized only when it is being serialized. The serialization is done by walking a protobuf with reflection, redacting sensitive fields as they are visited.

Compared to the previous version, this one can't do pretty printing.

Also adds Envoy::Json::MessageStreamer and Envoy::ProtoFilller:fill(). The message streamer is what implements the reflection walk and serialization to json. The fill utility allows for filling arbitrary protobuf objects with non-default values for performance tests.

Benchmark                                                Time             CPU      Time Old      Time New       CPU Old       CPU New
-------------------------------------------------------------------------------------------------------------------------------------
BM_ConfigDump/clusters/1000_pvalue                     0.0002          0.0002      U Test, Repetitions: 10 vs 10
BM_ConfigDump/clusters/1000_mean                      -0.7997         -0.7996           738           148           737           148
BM_ConfigDump/clusters/1000_median                    -0.7979         -0.7979           733           148           732           148
BM_ConfigDump/clusters/1000_stddev                    -0.9440         -0.9419            16             1            16             1
BM_ConfigDump/clusters/1000_cv                        -0.7204         -0.7098             0             0             0             0
BM_ConfigDump/listeners/1000_pvalue                    0.0002          0.0002      U Test, Repetitions: 10 vs 10
BM_ConfigDump/listeners/1000_mean                     -0.7831         -0.7824           841           182           837           182
BM_ConfigDump/listeners/1000_median                   -0.7833         -0.7832           833           180           832           180
BM_ConfigDump/listeners/1000_stddev                   -0.7465         -0.6384            23             6            16             6
BM_ConfigDump/listeners/1000_cv                       +0.1691         +0.6619             0             0             0             0
BM_ConfigDump/routes/1000_pvalue                       0.0002          0.0002      U Test, Repetitions: 10 vs 10
BM_ConfigDump/routes/1000_mean                        -0.7500         -0.7517          1367           342          1366           339
BM_ConfigDump/routes/1000_median                      -0.7520         -0.7520          1360           337          1360           337
BM_ConfigDump/routes/1000_stddev                      -0.3540         -0.6769            21            14            20             6
BM_ConfigDump/routes/1000_cv                          +1.5841         +0.3008             0             0             0             0
BM_ConfigDump/route_scopes/1000_pvalue                 0.0002          0.0002      U Test, Repetitions: 10 vs 10
BM_ConfigDump/route_scopes/1000_mean                  -0.7745         -0.7744          1886           425          1885           425
BM_ConfigDump/route_scopes/1000_median                -0.7744         -0.7743          1882           425          1881           425
BM_ConfigDump/route_scopes/1000_stddev                -0.8896         -0.8817            19             2            18             2
BM_ConfigDump/route_scopes/1000_cv                    -0.5105         -0.4753             0             0             0             0
BM_ConfigDump/secrets/1000_pvalue                      0.0002          0.0002      U Test, Repetitions: 10 vs 10
BM_ConfigDump/secrets/1000_mean                       -0.7998         -0.7998            39             8            39             8
BM_ConfigDump/secrets/1000_median                     -0.7991         -0.7991            39             8            39             8
BM_ConfigDump/secrets/1000_stddev                     -0.9525         -0.9498             0             0             0             0
BM_ConfigDump/secrets/1000_cv                         -0.7629         -0.7491             0             0             0             0

Used AI to bootstrap tests, check comments and doublecheck the ProtoJSON impl against docs, as well as the occasional simplify pass.

Risk Level: Medium, rewrites /config_dump admin endpoint
Testing: Unit tests in proto_streamer_test.cc and config_dump_handler_test.cc, perf tests, manual with configs/envoy-demo.yaml
Docs Changes: N/A
Release Notes: <TODO maybe mention the no pretty printing?>
Platform Specific Features: N/A
[Optional Runtime guard:]
Fixes #32054
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]

@repokitteh-read-only

Copy link
Copy Markdown

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #46911 was opened by filipcacky.

see: more, trace.

@filipcacky

filipcacky commented Aug 24, 2026

Copy link
Copy Markdown
Contributor Author

This impl suffers a bit from small allocations while printing the JSON, which can be remedied by using Buffer::reserveSingleSlice in BufferOutput. I have this drafted and it looks like it might shave off another ~5%.

I tried to reduce the number of allocations in the MessageStreamer, making it accept a message ref instead of a const ref and making the walk zero copy, but it didn't really help in the perf tests.

Let me know if you'd like me to split this to two PRs, one with the proto printer and another with the rest.

@filipcacky
filipcacky force-pushed the config_streamed branch 2 times, most recently from 4a6f7b7 to b6d8411 Compare August 24, 2026 22:44
Signed-off-by: Filip Cacky <filip.cacky@cdn77.com>
Signed-off-by: Filip Cacky <filip.cacky@cdn77.com>
Signed-off-by: Filip Cacky <filip.cacky@cdn77.com>
Signed-off-by: Filip Cacky <filip.cacky@cdn77.com>
Signed-off-by: Filip Cacky <filip.cacky@cdn77.com>
Signed-off-by: Filip Cacky <filip.cacky@cdn77.com>
@filipcacky

Copy link
Copy Markdown
Contributor Author

/retest

@filipcacky
filipcacky marked this pull request as ready for review August 25, 2026 11:15
@filipcacky

Copy link
Copy Markdown
Contributor Author

cc @jmarantz

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.

admin: making a streaming version of /config_dump

1 participant