Limit x-datadog-tags size by total bytes#5687
Conversation
|
suggestion (non-blocking): make the byte unit visible in the warning and docstring The bytesize fix is exactly the right call, and the tests are well-chosen — A small observation while reading The warning could name the unit: ::Datadog.logger.warn(
"Failed to #{scenario} x-datadog-tags: tags are too large for configured byte-size limit (size:#{size} >= " \
"limit:#{::Datadog.configuration.tracing.x_datadog_tags_max_length}). This limit can be configured " \
'through the DD_TRACE_X_DATADOG_TAGS_MAX_LENGTH environment variable.'
)Existing The core fix is correct as-is. |
BenchmarksBenchmark execution time: 2026-05-06 21:44:26 Comparing candidate commit 296b5af in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 45 metrics, 1 unstable metrics.
|
@p-datadog I added the wording around "byte" to the message. Thank you! |
🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage (details) 🔗 Commit SHA: 44f99c8 | Docs | Datadog PR Page | Give us feedback! |
What does this PR do?
Enforce
x-datadog-tagsmax length checks byString#bytesizeinstead of character size, during both propagation injection and extraction.Motivation:
We were checking by character size before this change.
Change log entry
Yes. Enforce
x-datadog-tagspropagation header size limits by byte size.Additional Notes:
How to test the change?
bundle exec rspec spec/datadog/tracing/distributed/datadog_spec.rb spec/datadog/tracing/contrib/http/distributed/propagation_spec.rb spec/datadog/tracing/contrib/grpc/distributed/propagation_spec.rb