Skip to content

Commit

Permalink
Use Compression.Gzip (#491)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kludex authored Oct 10, 2024
1 parent c82306b commit 75333be
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion logfire/_internal/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import requests
from opentelemetry import trace
from opentelemetry.environment_variables import OTEL_METRICS_EXPORTER, OTEL_TRACES_EXPORTER
from opentelemetry.exporter.otlp.proto.http import Compression
from opentelemetry.exporter.otlp.proto.http.metric_exporter import OTLPMetricExporter
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
from opentelemetry.metrics import Meter, NoOpMeterProvider, set_meter_provider
Expand Down Expand Up @@ -772,7 +773,9 @@ def check_token():
session = OTLPExporterHttpSession(max_body_size=OTLP_MAX_BODY_SIZE)
session.headers.update(headers)
span_exporter = OTLPSpanExporter(
endpoint=urljoin(self.advanced.base_url, '/v1/traces'), session=session
endpoint=urljoin(self.advanced.base_url, '/v1/traces'),
session=session,
compression=Compression.Gzip,
)
span_exporter = RetryFewerSpansSpanExporter(span_exporter)
span_exporter = FallbackSpanExporter(
Expand All @@ -790,6 +793,7 @@ def check_token():
endpoint=urljoin(self.advanced.base_url, '/v1/metrics'),
headers=headers,
session=session,
compression=Compression.Gzip,
# I'm pretty sure that this line here is redundant,
# and that passing it to the QuietMetricExporter is what matters
# because the PeriodicExportingMetricReader will read it from there.
Expand Down

0 comments on commit 75333be

Please sign in to comment.