Skip to content

Implement Byte Size Limit and Oldest First Truncation for gen_ai.*.messages #17809

@RulaKhaled

Description

@RulaKhaled

For gen_ai.* spans in the corresponding integrations in javascript, we will introduce a new hard limit for the size of the messages attribute (gen_ai.request.messages and gen_ai.output.messages). The limit should be a maximum size limit in bytes that ensures envelop size does not go over the limit that works for ingestion. This limit is to be defined. This should be implemented by counting bytes in the SDKs, and truncating the oldest messages first, until the list of messages fits inside the limit.

Update both vercel.ai.prompt and gen_ai.request.messages

Limit will be set for 20KB for now.

Metadata

Metadata

Assignees

Labels

javascriptPull requests that update javascript code

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions