[pull] main from SigNoz:main - #850
Merged
Merged
Conversation
) * fix(metrics): resolve any filter key context instead of erroring The metrics condition builder hard-errored ("key <name> not found") whenever a filter key was absent from the metadata keys. This hit the full-text search column (metric_name in the Metrics Explorer, labels in query_range) and every explicit label context (resource./scope./attribute.), so a bare/partial filter token 400'd the Metrics Explorer treemap and metric queries. Metrics keeps every label in the `labels` JSON with no per-context storage, so FieldFor already maps any key on its own (intrinsics incl. metric_name to their column, every label context to a labels JSON extract). Use the key directly in the len(keys)==0 branch so filters resolve and run instead of 400ing - matching group-by, which already collapses all label contexts to labels. Update the label-context test to expect the collapse (resource./scope. now resolve like bare/attribute.), add unit coverage for the branch, and add a queriermetrics test that a free-text filter no longer errors. * fix(metrics): resolve free-text and unregistered filter keys instead of erroring The metrics condition builder hard-errored ("key <name> not found") whenever a filter key was absent from the metadata keys: the full-text search column (metric_name on the Metrics Explorer, labels on query_range) and every explicit label context (resource./scope.). So a bare/partial filter token 400'd the Metrics Explorer treemap and metric query-builder filters. Metrics has no per-context storage - every label lives in the `labels` JSON, and FieldFor maps any key on its own (intrinsics incl. metric_name to their column, every label context to a labels extract). Add an opt-in WithIgnoreNotFoundKeys to the metrics condition builder that resolves such keys directly (matching nothing) instead of erroring: - query-builder (querier provider) and Metrics Explorer opt in, so free-text and unregistered contexts resolve - matching the statement builder's own fallback and group-by, which already collapses all label contexts to labels; - infra-monitoring list APIs keep the default (strict), so a typo'd attribute still surfaces as a 400. Intrinsics always resolve regardless of the flag. Adds unit coverage for both modes and a queriermetrics test that a free-text filter no longer errors; the label-context test now expects the collapse. * chore: updated integration tests * fix: dont assert warning == [] * chore: removed warning scaffolding for now * fix: add back removed integration test --------- Co-authored-by: nikhilmantri0902 <nikhil.mantri1999@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )