Compress envelopes with Zstandard on .NET 11

Aperta
#5,914 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
30/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Attiva
Stack tecnologico
csharp

Direzione di ricerca

Start with GzipRequestBodyHandler, GzipBufferedRequestBodyHandler, DefaultSentryHttpClientFactory, and the RequestBodyCompressionLevel option; inspect how options are bound through BindableSentryOptions. Then review the .NET 11 compression APIs and the issue’s open questions about opt-in selection, older target frameworks, and mobile performance. Done means choosing and implementing the option and target framework behavior, with measurements informing any default.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Improvement State: Needs Discussion

On net11.0, envelopes could be compressed with Zstandard instead of gzip. Smaller envelopes matter most on Android and iOS, which also target net11.0 on version7.

Current state

We compress request bodies by hand with GZipStream, in GzipRequestBodyHandler and GzipBufferedRequestBodyHandler. DefaultSentryHttpClientFactory picks one when RequestBodyCompressionLevel isn't NoCompression.

What .NET 11 adds

System.Net.Http now has GZipCompressedContent, BrotliCompressedContent and ZstandardCompressedContent. They set Content-Encoding and compress the content as the request is written. ZstandardStream and ZstandardEncoder live in System.IO.Compression. All five are in the 11.0.0 GA reference pack.

See What's new in the .NET 11 libraries.

Server support

Relay has accepted Content-Encoding: zstd since getsentry/relay#4089. However, Relay rejects encodings it doesn't recognise, so a self-hosted Sentry running an older Relay would drop zstd envelopes. Zstd should therefore be opt-in, not the new default.

Open questions

  • How should users choose the algorithm? One option is a new option next to RequestBodyCompressionLevel, which also needs a matching BindableSentryOptions property.
  • Should the net11.0 gzip path also move to GZipCompressedContent? The existing handlers have to stay for older TFMs either way, so this adds a #if NET11_0_OR_GREATER path rather than removing code.
  • How much smaller are typical envelopes with zstd than with gzip, and what does it cost in CPU on mobile? Measure before choosing defaults.
Lingua principale
C#
Stelle
775
Fork
262
Merge medio
1g 16h
PR unite (30g)
118

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di getsentry/sentry-dotnet

Tutte le issue di getsentry/sentry-dotnet

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.