Repository navigation
feat: release v1.3.0 with metric label filtering - #33
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
There was a problem hiding this comment.
[P1] This PR must not be merged until the metric filtering issue that silently drops valid samples is fixed.
This finding was reproduced on the revision associated with this review.
When filtering metrics by instance identity, another label's value can end with a comma followed by the instance-identity label name and an equals sign. The filter then misidentifies a label boundary and drops the entire sample. This was reproduced both for a sample without the instance-identity label and for a sample with a genuinely matching instance-identity label later in its label list. The documented API contract requires both samples to be retained.
Please correctly identify label boundaries and handle quoting and escaping according to the Prometheus text format. Label values containing double quotes, commas, and backslashes must be supported. Before merging, fix the filtering logic and add regression tests that verify the following behavior.
- Samples without the target label are retained.
- Samples whose target label value matches are retained, including when the target label appears after other labels.
- Samples with the target label and a different value are excluded.
|
Addressed this review in |
Add an optional exact label filter to
metric_data()andcollect(). This lets callers expose the series for a current identity while retaining samples without the selected label.The filter uses the existing label encoding and runs before sample and metadata rendering. It leaves the shared index and values intact, including series registered by other writers. It also applies to labels supplied for the error metric. Calls that omit the option retain their existing behavior.
Release the API as 1.3.0.
Summary by CodeRabbit