Skip to content

[profiler] Don't serialize empty metrics.#5690

Merged
mihaibudiu merged 1 commit intomainfrom
skip-empty-labels
Feb 25, 2026
Merged

[profiler] Don't serialize empty metrics.#5690
mihaibudiu merged 1 commit intomainfrom
skip-empty-labels

Conversation

@ryzhyk
Copy link
Contributor

@ryzhyk ryzhyk commented Feb 24, 2026

Make the profiles less verbose by only serializing the labels field of a metric if it's not empty.

Describe Manual Test Plan

Tested manually using the web ui and a new profile.

Checklist

  • Unit tests added/updated
  • Integration tests added/updated
  • Documentation updated
  • Changelog updated

Breaking Changes?

Mark if you think the answer is yes for any of these components:

Describe Incompatible Changes

@ryzhyk ryzhyk added the profiler Issues related to the profiler and it's APIs label Feb 24, 2026
@ryzhyk ryzhyk requested a review from mihaibudiu February 24, 2026 18:31
Make the profiles less verbose by only serializing the `labels` field
of a metric if it's not empty.

Signed-off-by: Leonid Ryzhyk <ryzhyk@gmail.com>
@ryzhyk ryzhyk marked this pull request as ready for review February 24, 2026 18:48
@mihaibudiu mihaibudiu enabled auto-merge February 24, 2026 18:50
@mihaibudiu mihaibudiu added this pull request to the merge queue Feb 24, 2026
if (metric.labels.length !== 0) {
metric_id = metric_id + "." + labels;
if (metric.labels) {
let labels = metric.labels.map(e => e.join(":")).join(".");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Indentation: the body of this if block uses 3 spaces while the surrounding function body uses 4. Minor, but inconsistent with the rest of the file.

Merged via the queue into main with commit 1cc4ca4 Feb 25, 2026
2 checks passed
@mihaibudiu mihaibudiu deleted the skip-empty-labels branch February 25, 2026 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

profiler Issues related to the profiler and it's APIs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants