Skip to content

Bug 2047640 - Cut ads-client telemetry strings to Glean's 255-byte limit - #7680

Merged
Almaju merged 2 commits into
mozilla:mainfrom
Almaju:ads-client-string-overflow
Oct 22, 2026
Merged

Almaju merged 2 commits into
mozilla:mainfrom
Almaju:ads-client-string-overflow

Conversation

@Almaju

@Almaju Almaju commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Fixes bug 2047640: invalid_overflow errors on ads_client.client_error.

The labeled_string metrics receive the whole nested error message, which can exceed Glean's 255-byte string limit. Every string value is now cut to 255 bytes on a char boundary before it reaches the MozAdsTelemetry callback.

Pull Request checklist

  • Breaking changes: none.
  • Quality: This PR builds and tests run cleanly
  • Tests: Unit test for the cut
  • Changelog: Entry under Ads-Client
  • Dependencies: None added

@Almaju
Almaju enabled auto-merge October 22, 2026 16:22

/// Glean drops the end of longer string values and records an
/// `invalid_overflow` error (bug 2047640).
const MAX_STRING_SIZE: ByteSize = ByteSize::b(255);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: Do we want the constant to be midway through the file?

@Almaju
Almaju added this pull request to the merge queue Oct 22, 2026
Merged via the queue into mozilla:main with commit d036def Oct 22, 2026
15 checks passed
@Almaju
Almaju deleted the ads-client-string-overflow branch October 22, 2026 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants