Skip to content

Commit 560989b

Browse files
authored
DEMRUM-1939 Update attribute size limit (#281)
* DEMRUM-1939 Update attribute size limit * DEMRUM-1939 Update unit tests
1 parent 6a1f0ec commit 560989b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

SplunkRumWorkspace/SplunkRum/SplunkRum/LimitingExporter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import Foundation
2323
// - span rejection based on setRejectionFilter
2424

2525
class LimitingExporter: SpanExporter {
26-
let MAX_ATTRIBUTE_LENGTH = 32768
26+
let MAX_ATTRIBUTE_LENGTH = 131072
2727
static let SPAN_RATE_LIMIT_PERIOD = 30 // seconds
2828
let MAX_SPANS_PER_PERIOD_PER_COMPONENT = 100
2929

SplunkRumWorkspace/SplunkRum/SplunkRumTests/MiscTests.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,25 +43,25 @@ class MiscTests: XCTestCase {
4343
func testLengthLimitingExporter() throws {
4444
// This test is shaped kinda funny since we can't construct SpanData() directly
4545
let span = buildTracer().spanBuilder(spanName: "limitTest").startSpan()
46-
var longString = "0123456789abcdefghijklmnopqurstuvwxyzabcdefghijklmnopqrstuvwxyz0123456789abcde"
46+
var longString = "0123456789abcdefghijklmnopqurstuvwxyzabcdefghijklmnopqrstuvwxyz01"
4747
var i = 0
48-
while i < 9 {
48+
while i < 11 {
4949
longString += longString
5050
i += 1
5151
}
52-
XCTAssertTrue(longString.count > 32768)
52+
XCTAssertTrue(longString.count > 131072)
5353
span.setAttribute(key: "longString", value: longString)
5454
span.setAttribute(key: "normalString", value: "normal")
5555
span.setAttribute(key: "normalInt", value: 7)
5656
span.end()
5757
XCTAssertEqual(1, localSpans.count)
5858
let rawSpans = localSpans
59-
XCTAssertTrue(rawSpans[0].attributes["longString"]?.description.count ?? 0 > 32768)
59+
XCTAssertTrue(rawSpans[0].attributes["longString"]?.description.count ?? 0 > 131072)
6060
localSpans.removeAll()
6161
let le = LimitingExporter(proxy: TestSpanExporter(), spanFilter: nil) // rewrites into localSpans; yes, this is weird
6262
_ = le.export(spans: rawSpans)
6363
XCTAssertEqual(1, localSpans.count)
64-
XCTAssertTrue(localSpans[0].attributes["longString"]?.description.count ?? 32767 <= 32768)
64+
XCTAssertTrue(localSpans[0].attributes["longString"]?.description.count ?? 131071 <= 131072)
6565
XCTAssertEqual("normal", localSpans[0].attributes["normalString"]?.description ?? nil)
6666
XCTAssertEqual("7", localSpans[0].attributes["normalInt"]?.description ?? nil)
6767
}

0 commit comments

Comments
 (0)