Skip to content

Commit

Permalink
fix: change limits from 1000 to 128 (#606)
Browse files Browse the repository at this point in the history
  • Loading branch information
fbogsany authored Feb 11, 2021
1 parent f5c2e8d commit e990883
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions sdk/lib/opentelemetry/sdk/trace/config/trace_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
10 changes: 5 additions & 5 deletions sdk/test/opentelemetry/sdk/trace/config/trace_config_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e990883

Please sign in to comment.