File tree Expand file tree Collapse file tree
include/opentelemetry/sdk/configuration Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5656 run : |
5757 sudo -E ./ci/install_thirdparty.sh --install-dir /usr/local --tags-file third_party_release --packages "ryml"
5858 - name : Initialize CodeQL
59- uses : github/codeql-action/init@5595ccaf912efad79be6eef63a5619ff05969be3 # v4.37.6
59+ uses : github/codeql-action/init@ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd # v4.37.7
6060 with :
6161 languages : cpp
6262 config : |
7171 "${GITHUB_WORKSPACE}"
7272 cmake --build . --parallel
7373 - name : Perform CodeQL Analysis
74- uses : github/codeql-action/analyze@5595ccaf912efad79be6eef63a5619ff05969be3 # v4.37.6
74+ uses : github/codeql-action/analyze@ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd # v4.37.7
Original file line number Diff line number Diff line change @@ -246,6 +246,22 @@ Important changes:
246246
247247Breaking changes:
248248
249+ * [ CONFIGURATION] Align declarative configuration schema defaults with
250+ OpenTelemetry Configuration Schema v1.1.0
251+ [ #4432 ] ( https://github.com/open-telemetry/opentelemetry-cpp/issues/4432 )
252+ * When a YAML field is omitted, the parsed configuration model now uses
253+ these schema defaults instead of the previous legacy values:
254+ * ` attribute_limits.attribute_value_length_limit ` ,
255+ ` logger_provider.limits.attribute_value_length_limit ` , and
256+ ` tracer_provider.limits.attribute_value_length_limit ` default to no limit
257+ (unlimited attribute value length) instead of 4096 bytes.
258+ * ` batch ` log record processor ` schedule_delay ` defaults to 1000 ms instead
259+ of 5000 ms (more frequent batch exports when the field is omitted).
260+ * ` periodic ` metric reader ` interval ` defaults to 60000 ms instead of 5000 ms
261+ (less frequent metric exports when the field is omitted).
262+ * ` trace_id_ratio_based ` sampler ` ratio ` defaults to 1.0 instead of 0.0
263+ (sample all traces instead of dropping all when the field is omitted).
264+
249265* [ CONFIGURATION] SDK default component builder libraries and example
250266 [ #4367 ] ( https://github.com/open-telemetry/opentelemetry-cpp/pull/4367 )
251267 * The declaritive configuration registry is now empty on construction and
Original file line number Diff line number Diff line change 44#pragma once
55
66#include < cstddef>
7+ #include < limits>
78
89#include " opentelemetry/version.h"
910
@@ -18,9 +19,9 @@ namespace configuration
1819class AttributeLimitsConfiguration
1920{
2021public:
21- // TODO: spec default is no limit, using 4096 to preserve original behavior
22- static constexpr std::size_t kDefaultAttributeValueLengthLimit = 4096 ;
23- static constexpr std::size_t kDefaultAttributeCountLimit = 128 ;
22+ static constexpr std:: size_t kDefaultAttributeValueLengthLimit =
23+ ( std::numeric_limits<std:: size_t >::max)() ;
24+ static constexpr std::size_t kDefaultAttributeCountLimit = 128 ;
2425
2526 std::size_t attribute_value_length_limit{kDefaultAttributeValueLengthLimit };
2627 std::size_t attribute_count_limit{kDefaultAttributeCountLimit };
Original file line number Diff line number Diff line change @@ -22,8 +22,7 @@ namespace configuration
2222class BatchLogRecordProcessorConfiguration : public LogRecordProcessorConfiguration
2323{
2424public:
25- // TODO: spec default is 1000ms for schedule_delay, using 5000ms to preserve original behavior
26- static constexpr std::size_t kDefaultScheduleDelayMs = 5000 ;
25+ static constexpr std::size_t kDefaultScheduleDelayMs = 1000 ;
2726 static constexpr std::size_t kDefaultExportTimeoutMs = 30000 ;
2827 static constexpr std::size_t kDefaultMaxQueueSize = 2048 ;
2928 static constexpr std::size_t kDefaultMaxExportBatchSize = 512 ;
Original file line number Diff line number Diff line change 44#pragma once
55
66#include < cstddef>
7+ #include < limits>
78
89#include " opentelemetry/version.h"
910
@@ -18,9 +19,9 @@ namespace configuration
1819class LogRecordLimitsConfiguration
1920{
2021public:
21- // TODO: spec default is no limit, using 4096 to preserve original behavior
22- static constexpr std::size_t kDefaultAttributeValueLengthLimit = 4096 ;
23- static constexpr std::size_t kDefaultAttributeCountLimit = 128 ;
22+ static constexpr std:: size_t kDefaultAttributeValueLengthLimit =
23+ ( std::numeric_limits<std:: size_t >::max)() ;
24+ static constexpr std::size_t kDefaultAttributeCountLimit = 128 ;
2425
2526 std::size_t attribute_value_length_limit{kDefaultAttributeValueLengthLimit };
2627 std::size_t attribute_count_limit{kDefaultAttributeCountLimit };
Original file line number Diff line number Diff line change @@ -25,8 +25,7 @@ namespace configuration
2525class PeriodicMetricReaderConfiguration : public MetricReaderConfiguration
2626{
2727public:
28- // TODO: spec default is 60000ms for interval, using 5000ms to preserve original behavior
29- static constexpr std::size_t kDefaultIntervalMs = 5000 ;
28+ static constexpr std::size_t kDefaultIntervalMs = 60000 ;
3029 static constexpr std::size_t kDefaultTimeoutMs = 30000 ;
3130
3231 void Accept (MetricReaderConfigurationVisitor *visitor) const override
Original file line number Diff line number Diff line change 44#pragma once
55
66#include < cstddef>
7+ #include < limits>
78
89#include " opentelemetry/version.h"
910
@@ -18,8 +19,8 @@ namespace configuration
1819class SpanLimitsConfiguration
1920{
2021public:
21- // TODO: spec default is no limit, using 4096 to preserve original behavior
22- static constexpr std::size_t kDefaultAttributeValueLengthLimit = 4096 ;
22+ static constexpr std:: size_t kDefaultAttributeValueLengthLimit =
23+ ( std::numeric_limits<std:: size_t >::max)() ;
2324 static constexpr std::uint32_t kDefaultAttributeCountLimit = 128 ;
2425 static constexpr std::uint32_t kDefaultEventCountLimit = 128 ;
2526 static constexpr std::uint32_t kDefaultLinkCountLimit = 128 ;
Original file line number Diff line number Diff line change @@ -18,8 +18,7 @@ namespace configuration
1818class TraceIdRatioBasedSamplerConfiguration : public SamplerConfiguration
1919{
2020public:
21- // TODO: spec default is 1.0, using 0.0 to preserve original behavior
22- static constexpr double kDefaultRatio = 0.0 ;
21+ static constexpr double kDefaultRatio = 1.0 ;
2322
2423 void Accept (SamplerConfigurationVisitor *visitor) const override
2524 {
Original file line number Diff line number Diff line change @@ -120,7 +120,8 @@ file_format: "1.1-logs"
120120 auto *batch =
121121 reinterpret_cast <opentelemetry::sdk::configuration::BatchLogRecordProcessorConfiguration *>(
122122 processor);
123- ASSERT_EQ (batch->schedule_delay , 5000 );
123+ const auto defaults = opentelemetry::sdk::configuration::BatchLogRecordProcessorConfiguration{};
124+ ASSERT_EQ (batch->schedule_delay , defaults.schedule_delay );
124125 ASSERT_EQ (batch->export_timeout , 30000 );
125126 ASSERT_EQ (batch->max_queue_size , 2048 );
126127 ASSERT_EQ (batch->max_export_batch_size , 512 );
@@ -460,7 +461,9 @@ file_format: "1.0-logs"
460461 ASSERT_NE (config, nullptr );
461462 ASSERT_NE (config->logger_provider , nullptr );
462463 ASSERT_NE (config->logger_provider ->limits , nullptr );
463- ASSERT_EQ (config->logger_provider ->limits ->attribute_value_length_limit , 4096 );
464+ const auto defaults = opentelemetry::sdk::configuration::LogRecordLimitsConfiguration{};
465+ ASSERT_EQ (config->logger_provider ->limits ->attribute_value_length_limit ,
466+ defaults.attribute_value_length_limit );
464467 ASSERT_EQ (config->logger_provider ->limits ->attribute_count_limit , 128 );
465468}
466469
Original file line number Diff line number Diff line change @@ -114,7 +114,8 @@ file_format: "1.0-metrics"
114114 auto *periodic =
115115 reinterpret_cast <opentelemetry::sdk::configuration::PeriodicMetricReaderConfiguration *>(
116116 reader);
117- ASSERT_EQ (periodic->interval , 5000 );
117+ const auto defaults = opentelemetry::sdk::configuration::PeriodicMetricReaderConfiguration{};
118+ ASSERT_EQ (periodic->interval , defaults.interval );
118119 ASSERT_EQ (periodic->timeout , 30000 );
119120 ASSERT_NE (periodic->exporter , nullptr );
120121 auto *exporter = periodic->exporter .get ();
You can’t perform that action at this time.
0 commit comments