From e990883aea8ec41eef7e5ad9feacc06e2fd6153a Mon Sep 17 00:00:00 2001 From: Francis Bogsanyi Date: Thu, 11 Feb 2021 10:41:33 -0500 Subject: [PATCH] fix: change limits from 1000 to 128 (#606) --- sdk/lib/opentelemetry/sdk/trace/config/trace_config.rb | 6 +++--- .../sdk/trace/config/trace_config_test.rb | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sdk/lib/opentelemetry/sdk/trace/config/trace_config.rb b/sdk/lib/opentelemetry/sdk/trace/config/trace_config.rb index 9268d7b0a1..5db7844235 100644 --- a/sdk/lib/opentelemetry/sdk/trace/config/trace_config.rb +++ b/sdk/lib/opentelemetry/sdk/trace/config/trace_config.rb @@ -33,9 +33,9 @@ class TraceConfig # @return [TraceConfig] with the desired values. # @raise [ArgumentError] if any of the max numbers are not positive. def initialize(sampler: sampler_from_environment(Samplers.parent_based(root: Samplers::ALWAYS_ON)), - max_attributes_count: Integer(ENV.fetch('OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT', 1000)), - max_events_count: Integer(ENV.fetch('OTEL_SPAN_EVENT_COUNT_LIMIT', 1000)), - max_links_count: Integer(ENV.fetch('OTEL_SPAN_LINK_COUNT_LIMIT', 1000)), + max_attributes_count: Integer(ENV.fetch('OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT', 128)), + max_events_count: Integer(ENV.fetch('OTEL_SPAN_EVENT_COUNT_LIMIT', 128)), + max_links_count: Integer(ENV.fetch('OTEL_SPAN_LINK_COUNT_LIMIT', 128)), max_attributes_per_event: max_attributes_count, max_attributes_per_link: max_attributes_count) raise ArgumentError, 'max_attributes_count must be positive' unless max_attributes_count.positive? diff --git a/sdk/test/opentelemetry/sdk/trace/config/trace_config_test.rb b/sdk/test/opentelemetry/sdk/trace/config/trace_config_test.rb index 6300c587c0..e1034177b1 100644 --- a/sdk/test/opentelemetry/sdk/trace/config/trace_config_test.rb +++ b/sdk/test/opentelemetry/sdk/trace/config/trace_config_test.rb @@ -14,11 +14,11 @@ it 'provides defaults' do config = trace_config.new _(config.sampler).must_equal samplers.parent_based(root: samplers::ALWAYS_ON) - _(config.max_attributes_count).must_equal 1000 - _(config.max_events_count).must_equal 1000 - _(config.max_links_count).must_equal 1000 - _(config.max_attributes_per_event).must_equal 1000 - _(config.max_attributes_per_link).must_equal 1000 + _(config.max_attributes_count).must_equal 128 + _(config.max_events_count).must_equal 128 + _(config.max_links_count).must_equal 128 + _(config.max_attributes_per_event).must_equal 128 + _(config.max_attributes_per_link).must_equal 128 end it 'reflects environment variables' do