Skip to content

Fix: SplitMetricHelper shared labels dictionary - #5550

Merged
brun0-matheus merged 2 commits into
masterfrom
bruno.fix-split-metric-helper
Oct 21, 2026
Merged

brun0-matheus merged 2 commits into
masterfrom
bruno.fix-split-metric-helper

Conversation

@brun0-matheus

Copy link
Copy Markdown
Contributor

Bug

PR #5530 introduced the class SplitMetricHelper, used for emitting metrics that are duplicated (one metric grouped by FUZZER and another by JOB, like FUZZER_TOTAL_FUZZ_TIME and JOB_TOTAL_FUZZ_TIME). However, this class uses the same labels dictionary instance for both FUZZER and JOB metrics, and the _MetricsStore store references to the dictionary. Thus, when emitting the metric to GCP, both FUZZER and JOB metrics end up with the same labels.

Fix

Change SplitMetricHelper to not use the same dictionary instance.

@brun0-matheus
brun0-matheus requested a review from a team as a code owner October 20, 2026 20:49
@brun0-matheus brun0-matheus self-assigned this Oct 20, 2026
@@ -607,12 +607,13 @@ def __init__(self, fuzzer_metric: Metric, job_metric: Metric):
def insert(self, value: float, labels=None):
labels = dict(labels) if labels else {}
assert 'fuzzer' in labels and 'job' in labels

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.

Since you are fixing a bug here, let's also remove this assert in favor of a check with error log and early return. We probably should not break the execution due to wrong label metric.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

@brun0-matheus
brun0-matheus merged commit 7a22826 into master Oct 21, 2026
15 checks passed
@brun0-matheus
brun0-matheus deleted the bruno.fix-split-metric-helper branch October 21, 2026 12:57
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