Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support stats compression #47997

Merged
merged 6 commits into from
Nov 27, 2023
Merged

Conversation

zirain
Copy link
Member

@zirain zirain commented Nov 22, 2023

Please provide a description of this PR:

Alternative for #47934

xref: #30987

@zirain zirain requested a review from a team as a code owner November 22, 2023 12:44
@istio-testing istio-testing added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Nov 22, 2023
@istio-testing istio-testing added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 22, 2023
Copy link
Member

@GregHanson GregHanson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some minor comments

@@ -274,6 +274,12 @@ func getStatsOptions(meta *model.BootstrapNodeMetadata) []option.Instance {
}
}

var compression string
// TODO: move annotation to api repo
if statsCompression, ok := meta.Annotations["sidecar.istio.io/statsCompression"]; ok {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are adding a new annotation, there should be a release note to highlight it

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sanity check, do we also need a proxy version check here? Asking because I'm not sure if this is tied to any recent istio/proxy or recent commits in upstream envoyproxy repo.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should make it an environment variable. IMO this will not be a permanent API. We should:

  1. Turn off by default with opt in
  2. Turn on by default with opt-out
  3. Remove opt-out, if no one needs it

If we are really confident I am ok with skipping (1).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as @kyessenov suggest, we can exend to support zst or brotli, so maybe it can be a permanent API.

Copy link
Member

@howardjohn howardjohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM. I would request we make sure the original PR is credited in some form

@@ -274,6 +274,12 @@ func getStatsOptions(meta *model.BootstrapNodeMetadata) []option.Instance {
}
}

var compression string
// TODO: move annotation to api repo
if statsCompression, ok := meta.Annotations["sidecar.istio.io/statsCompression"]; ok {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should make it an environment variable. IMO this will not be a permanent API. We should:

  1. Turn off by default with opt in
  2. Turn on by default with opt-out
  3. Remove opt-out, if no one needs it

If we are really confident I am ok with skipping (1).

@howardjohn
Copy link
Member

Can you add the commits from #47934 and/or make @kaiburjack a co-author on the commits?

@kaiburjack
Copy link

Can you add the commits from #47934 and/or make @kaiburjack a co-author on the commits?

I don't really need/want to take credit for this in any way, since I wasn't the one coming up with the original solution anyways. If at all, it should be @svenwltr via #30987 (comment)

@howardjohn
Copy link
Member

howardjohn commented Nov 23, 2023 via email

@istio-testing istio-testing added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Nov 23, 2023
@kaiburjack
Copy link

FYI: I've done some testing with a simple Go HTTP proxy sidecar doing gzip compression for the istio-proxy sidecar's 15090 /stats/prometheus and declaring a new port 14090 to compress the response.
The results are amazing! Without compression (istio-proxy default behaviour) one scrape for one of my pods is 3,979,285 bytes (so ~4 MB) and with gzip compression with everything working and Prometheus happily using the gzip endpoint: 48,554 bytes (so down to just ~48KB!!). That is an improvement of ~81x and will definitely reduce our Inter-Zone Egress Costs by a lot.

@istio-testing istio-testing merged commit 1e9dd60 into istio:master Nov 27, 2023
@zirain zirain deleted the stats/compression branch November 27, 2023 04:53
@Minh-Ng
Copy link

Minh-Ng commented Mar 1, 2024

It seems for agent metrics or for those using merged metrics via the agent at 15020 we are still at the mercy of the agent server supporting/not supporting compression.

While kaiburjack's solution of defining a new listener (e.g. 0.0.0.0:14020) on an adjacent port and routing to the corresponding cluster (127.0.0.1:15020) will work as an intermediate solution perhaps we can get sidecar.istio.io/statsCompression to support merged metrics via the agent as well?

@zirain
Copy link
Member Author

zirain commented Mar 15, 2024

It seems for agent metrics or for those using merged metrics via the agent at 15020 we are still at the mercy of the agent server supporting/not supporting compression.

While kaiburjack's solution of defining a new listener (e.g. 0.0.0.0:14020) on an adjacent port and routing to the corresponding cluster (127.0.0.1:15020) will work as an intermediate solution perhaps we can get sidecar.istio.io/statsCompression to support merged metrics via the agent as well?

can you open another ticket?

@Minh-Ng
Copy link

Minh-Ng commented Mar 19, 2024

can you open another ticket?

Opened: #49987

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants