Class: OpenTelemetry::SDK::Logs::LogRecordLimits
- Inherits:
-
Object
- Object
- OpenTelemetry::SDK::Logs::LogRecordLimits
- Defined in:
- lib/opentelemetry/sdk/logs/log_record_limits.rb
Overview
Class that holds log record attribute limit parameters.
Constant Summary collapse
- DEFAULT =
The default OpenTelemetry::SDK::Logs::LogRecordLimits.
new
Instance Attribute Summary collapse
-
#attribute_count_limit ⇒ Object
readonly
The global default max number of attributes per LogRecord.
-
#attribute_length_limit ⇒ Object
readonly
The global default max length of attribute value per LogRecord.
Instance Method Summary collapse
-
#initialize(attribute_count_limit: Integer(OpenTelemetry::Common::Utilities.config_opt( 'OTEL_LOG_RECORD_ATTRIBUTE_COUNT_LIMIT', 'OTEL_ATTRIBUTE_COUNT_LIMIT', default: 128 )), attribute_length_limit: OpenTelemetry::Common::Utilities.config_opt( 'OTEL_LOG_RECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT', 'OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT' )) ⇒ LogRecordLimits
constructor
Returns a LogRecordLimits with the desired values.
Constructor Details
#initialize(attribute_count_limit: Integer(OpenTelemetry::Common::Utilities.config_opt( 'OTEL_LOG_RECORD_ATTRIBUTE_COUNT_LIMIT', 'OTEL_ATTRIBUTE_COUNT_LIMIT', default: 128 )), attribute_length_limit: OpenTelemetry::Common::Utilities.config_opt( 'OTEL_LOG_RECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT', 'OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT' )) ⇒ LogRecordLimits
Returns a OpenTelemetry::SDK::Logs::LogRecordLimits with the desired values.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/opentelemetry/sdk/logs/log_record_limits.rb', line 22 def initialize(attribute_count_limit: Integer(OpenTelemetry::Common::Utilities.config_opt( 'OTEL_LOG_RECORD_ATTRIBUTE_COUNT_LIMIT', 'OTEL_ATTRIBUTE_COUNT_LIMIT', default: 128 )), attribute_length_limit: OpenTelemetry::Common::Utilities.config_opt( 'OTEL_LOG_RECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT', 'OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT' )) raise ArgumentError, 'attribute_count_limit must be positive' unless attribute_count_limit.positive? raise ArgumentError, 'attribute_length_limit must not be less than 32' unless attribute_length_limit.nil? || Integer(attribute_length_limit) >= 32 @attribute_count_limit = attribute_count_limit @attribute_length_limit = attribute_length_limit.nil? ? nil : Integer(attribute_length_limit) end |
Instance Attribute Details
#attribute_count_limit ⇒ Object (readonly)
The global default max number of attributes per OpenTelemetry::SDK::Logs::LogRecord.
13 14 15 |
# File 'lib/opentelemetry/sdk/logs/log_record_limits.rb', line 13 def attribute_count_limit @attribute_count_limit end |
#attribute_length_limit ⇒ Object (readonly)
The global default max length of attribute value per OpenTelemetry::SDK::Logs::LogRecord.
16 17 18 |
# File 'lib/opentelemetry/sdk/logs/log_record_limits.rb', line 16 def attribute_length_limit @attribute_length_limit end |