Skip to content

Conversation

@javiermolinar
Copy link
Contributor

@javiermolinar javiermolinar commented Sep 3, 2025

What this PR does:

Currently we have a lack of visibility when big attributes (or attributes names) are trimmed due to the max_attribute_bytes limit.

This pr aims to fix that by logging the truncated attributes once per batch.

level=warn ts=2025-09-03T14:37:25.753695Z caller=distributor.go:704 msg="attributes values truncated in batch" tenant=single-tenant truncated_total=5 truncated_attributes="[{\"attributeName\":\"my.span.attr\",\"originalSize\":85},{\"attributeName\":\"my.span.add\",\"originalSize\":85},{\"attributeName\":\"my.span.gg\",\"originalSize\":85},{\"attributeName\":\"my.span.ww\",\"originalSize\":85},{\"attributeName\":\"my.span.tt\",\"originalSize\":85}]"

It discriminates between attribute values and attributes names. The original code includes both of them in the same bucket.

Which issue(s) this PR fixes:
Fixes #

Checklist

  • Tests updated
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]
@javiermolinar javiermolinar changed the title feat: improve truncated attributes visibility by loggging them Sep 3, 2025
}

func logTruncatedAttributes(truncatedAttr []truncatedAttribute, message string, tenant string, l log.Logger) {
b, _ := json.Marshal(truncatedAttr)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this a lot of overhead in (potentially) every write for a log?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, i like this idea in theory, but i think this would destroy our distributors. we also need to consider that we may be logging sensitive information if we do this.

perhaps some kind of temporary way to turn this on per tenant paired with some rate limiting?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants