Skip to content

Commit 02f47c3

Browse files
NH-110704: enforce gzip and delta (#191)
* NH-110704: enforce gzip and delta * Update lib/solarwinds_apm/otel_native_config.rb Co-authored-by: Raphaël Thériault <113933910+raphael-theriault-swi@users.noreply.github.com> --------- Co-authored-by: Raphaël Thériault <113933910+raphael-theriault-swi@users.noreply.github.com>
1 parent 31ade05 commit 02f47c3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/solarwinds_apm/otel_native_config.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,14 @@ def self.initialize
5858
final_attributes = mandatory_resource.merge({})
5959
end
6060

61+
# set gzip compression
62+
%w[TRACES METRICS LOGS].each do |signal|
63+
ENV["OTEL_EXPORTER_OTLP_#{signal}_COMPRESSION"] = 'gzip' if ENV["OTEL_EXPORTER_OTLP_#{signal}_COMPRESSION"].to_s.empty? && ENV['OTEL_EXPORTER_OTLP_COMPRESSION'].to_s.empty?
64+
end
65+
66+
# set delta temporality
67+
ENV['OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE'] = 'delta' if ENV['OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE'].to_s.empty?
68+
6169
# log level
6270
if ENV['OTEL_LOG_LEVEL'].to_s.empty?
6371
log_level = (ENV['SW_APM_DEBUG_LEVEL'] || SolarWindsAPM::Config[:debug_level] || 3).to_i

0 commit comments

Comments
 (0)