Skip to main content
Source: Al0090UncompressedExportAnalyzer.cs

Description

OTLP export over HTTP should enable gzip compression to reduce bandwidth usage and improve performance.

Bad Code

t.AddOtlpExporter(o => {
    o.Protocol = OtlpExportProtocol.HttpProtobuf;
    // No compression configured
});

Good Code

t.AddOtlpExporter(o => {
    o.Protocol = OtlpExportProtocol.HttpProtobuf;
    o.HttpClientFactory = () => new HttpClient(new GzipHandler());
});

Properties

  • Category: OpenTelemetry
  • Severity: Warning
  • Enabled by default: True
  • Code fix available: False

Configuration

dotnet_diagnostic.AL0090.severity = warning