Skip to content

Commit e90f4e5

Browse files
increse llm obs size limit from 1mb to 5mb in line with python version and documentation (#7921)
1 parent ce653ab commit e90f4e5

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict'
22

33
module.exports = {
4-
DROPPED_VALUE_TEXT: "[This value has been dropped because this span's size exceeds the 1MB size limit.]",
4+
DROPPED_VALUE_TEXT: "[This value has been dropped because this span's size exceeds the 5MB size limit.]",
55
UNSERIALIZABLE_VALUE_TEXT: 'Unserializable value',
66
}

packages/dd-trace/src/llmobs/constants/writers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ module.exports = {
1313
EVALUATIONS_ENDPOINT: '/api/intake/llm-obs/v2/eval-metric',
1414

1515
EVP_PAYLOAD_SIZE_LIMIT: 5 << 20, // 5MB (actual limit is 5.1MB)
16-
EVP_EVENT_SIZE_LIMIT: (1 << 20) - 1024, // 999KB (actual limit is 1MB)
16+
EVP_EVENT_SIZE_LIMIT: 5 << 20, // 5MB (actual backend limit is 10MB; Python SDK defaults to 5MB)
1717
}

packages/dd-trace/src/llmobs/writers/spans.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class LLMObsSpanWriter extends BaseWriter {
3232
let processedEventSizeBytes = eventSizeBytes
3333

3434
if (shouldTruncate) {
35-
logger.warn(`Dropping event input/output because its size (${eventSizeBytes}) exceeds the 1MB event size limit`)
35+
logger.warn(`Dropping event input/output because its size (${eventSizeBytes}) exceeds the 5MB event size limit`)
3636
event = this._truncateSpanEvent(event)
3737
processedEventSizeBytes = Buffer.byteLength(JSON.stringify(event))
3838
}

packages/dd-trace/test/llmobs/writers/spans.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ describe('LLMObsSpanWriter', () => {
7171
const event = {
7272
name: 'test',
7373
meta: {
74-
input: { value: 'a'.repeat(1024 * 1024) },
75-
output: { value: 'a'.repeat(1024 * 1024) },
74+
input: { value: 'a'.repeat(3 * 1024 * 1024) },
75+
output: { value: 'a'.repeat(3 * 1024 * 1024) },
7676
},
7777
}
7878

@@ -82,8 +82,8 @@ describe('LLMObsSpanWriter', () => {
8282
assert.deepStrictEqual(bufferEvent, {
8383
name: 'test',
8484
meta: {
85-
input: { value: "[This value has been dropped because this span's size exceeds the 1MB size limit.]" },
86-
output: { value: "[This value has been dropped because this span's size exceeds the 1MB size limit.]" },
85+
input: { value: "[This value has been dropped because this span's size exceeds the 5MB size limit.]" },
86+
output: { value: "[This value has been dropped because this span's size exceeds the 5MB size limit.]" },
8787
},
8888
collection_errors: ['dropped_io'],
8989
})

0 commit comments

Comments
 (0)