[pull] main from SigNoz:main - #846
Merged
Merged
Conversation
…ead of injecting a fingerprint label (#12152) #8563 worked around duplicate-labelset collisions (a label value going empty re-fingerprints a series; empty-valued labels are dropped at read) by appending a synthetic fingerprint label to every series and stripping it from results. The label participates in evaluation before any strip runs: without() grouped per fingerprint (duplicate identical-labeled output series) and unaggregated vector matching never matched. Resolve series identity at the adapter instead: drop empty-valued labels at unmarshal, merge fingerprints that share the resulting labelset (timestamp-ordered k-way merge, highest fingerprint wins equal timestamps), and delete the injection and every RemoveExtraLabels strip. Engine-semantic duplicates (e.g. rate over {__name__=~"a|b"}) still error, matching upstream Prometheus. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
* fix: convert key not found to warnings * fix(logs): has-family body-only errors, not-found warnings, and condition-builder cleanup - has/hasAny/hasAll/hasToken on a non-body key now return "supports only body JSON search" (both modes); a not-found body path warns and queries the underlying data instead of 400 (JSON mode) - capture the two has-family 500s (hasToken separator/whitespace needle; hasAny/hasAll quoted int >= 2^32) as regression tests - use telemetrytypes.NewTelemetryFieldKey for derived keys (fresh identity-only keys, no stale resolved metadata) instead of struct copies of the field key - rename ConditionForKeys -> ConditionFor and inline conditionsForKeys into it across the builders; rename private conditionFor -> conditionForResolvedKey - move the trace_noise fixture from queriertraces/conftest.py to fixtures/traces.py * fix: convert trace_noise fixture to util
…the query window end (#12153) The series lookup bounded registration rows with unix_milli < end while the samples query uses <= end. The exporter writes registration rows hour-floored, so a series first registered in the hour starting exactly at end was invisible even though its samples were fetchable — queries ending exactly on an hour boundary missed newly-registered series. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
…regation in the metric query spec (#12164) * fix(querybuildertypesv5): omit unset metric enum fields on the wire A metric builder query serialized empty strings for its enum fields because omitempty has no effect on struct-backed valuer types: "source":"", "aggregations":[{"temporality":"","timeAggregation":"","spaceAggregation":""}] Those "" values are not members of the corresponding OpenAPI enums (source=[meter], temporality=[delta,cumulative,unspecified], etc.), so a typed client reading a rule back rejected it (create -> GET round-trip drift; terraform-provider-signoz generate-config failed schema validation). Tag Source/Temporality/TimeAggregation/SpaceAggregation with ,omitzero so an unset value is dropped instead of emitted as an invalid "", matching the existing convention (dashboardtypes Sort, telemetrytypes field keys). Valid values still serialize. The OpenAPI spec regenerates byte-identical, which confirms the enums were already correct. * test(querybuildertypesv5): cover client-sent empty enum values A client (e.g. terraform) may send explicit source:"" / temporality:"" for an unset enum. Assert unmarshaling accepts them, normalizes to the zero value, and re-marshaling drops them so the round-trip never echoes an invalid "" back. * fix(querybuildertypesv5): allow empty metric enum values in the spec The server accepts and echoes back an unset source, temporality, and timeAggregation for a metric query (a create -> GET returns "" for them), but their OpenAPI enums omitted "". A typed client (terraform-provider-signoz generate-config) therefore rejected the config generated for an imported rule. Add "" as a valid member of the Source, Temporality, and TimeAggregation enums so the spec matches what the server actually accepts and returns. spaceAggregation is left unchanged: an empty value is rejected with 400 at creation (IsValid), so it is never stored or echoed and "" must stay out of its enum. Drop the earlier ,omitzero tags: these fields already always-serialize, so an accepted "" round-trips faithfully instead of being silently dropped (silent mutation is itself drift). source loses its no-op omitempty for the same reason. Regenerate the OpenAPI spec and frontend client (both git-diff gated). * test(querybuildertypesv5): assert accepted empty enums round-trip Empty source/temporality/timeAggregation are echoed back (not dropped) and are stable across marshal -> unmarshal -> marshal; spaceAggregation carries a valid value since an empty one is 400'd at creation. * test(querybuildertypesv5): merge and rename metric enum round-trip test Fold the unmarshal-echo case into the table-driven marshal round-trip test (its marshal -> unmarshal -> marshal check already covers the client-sends-"" path) and rename to TestQueryBuilderQuery_MetricAggregation_MarshalJSONEnumRoundTrip. * style(metrictypes): drop explanatory comments on enum changes Remove the comments added to Temporality/TimeAggregation Enum() and the metric enum round-trip test case. * style(telemetrytypes): drop explanatory comment on Source enum change Remove the comment added to Source.Enum(), keeping the pre-existing doc/TODO.
* fix(dashboardtypes): round-trip zero-valued variable/display fields
omitempty dropped explicit zero values from the create -> GET response, so
a typed client (Terraform/SDK) that sent them read back null and reported
drift. Remove the tag so these always serialize:
- Display.Description ("" round-trips; applies to dashboard/panel/variable
displays)
- TextVariableSpec.Constant (constant: false, like the disabled fix)
- ListVariableSpec.CustomAllValue / CapturingRegexp ("" round-trips)
Scalars carry no nullability, so the OpenAPI spec and generated client are
unchanged. Sort stays omitzero: its "no sort" value is "none", not "", so
omitzero only omits the invalid unset state.
* fix(dashboardtypes): round-trip panel and dashboard links
`links` used omitempty (dropped an explicit []) and its element type was the
imported perses dashboard.Link, whose own fields tag name/tooltip/
renderVariables/targetBlank omitempty — so a link's false/"" were dropped
too, and a typed client read them back as null.
- Replicate dashboard.Link as a SigNoz Link type (same pattern as
ListVariableSpec/TextVariableSpec) with every field always serialized.
- Use ,omitzero on PanelSpec.Links and DashboardSpec.Links so an explicit
[] round-trips while an unset list stays omitted (never null).
Regenerate the OpenAPI spec and frontend client: the element schema is now
DashboardtypesLink (was the perses DashboardLink) and links is nullable.
Update the frontend consumers to the renamed type and coalesce the now
type-nullable spec.links (never null on the wire) at its two boundaries.
* test(dashboard): cover variable/display/link round-trip cases
Extend the v2 dashboard round-trip test with the spec-wide zero values this
PR fixes: a display description "", a text variable's constant false, a list
variable's customAllValue/capturingRegexp "", an explicit [] of panel links
that round-trips, a link whose own zero-valued fields (name/tooltip "",
renderVariables/targetBlank false) echo back, and a linkless panel whose
links stay omitted (never null).
* test(dashboard): accept null-or-absent for unset panel links
A panel with no links round-trips as "links": null rather than being
omitted (the panel serialization path differs from the query slices, which
omit). Both mean "no links" and neither drifts for a typed client, so assert
the value is None (null or absent) instead of strictly absent. The explicit
[] case still asserts a verbatim round-trip, which is the guarantee the fix
provides.
* fix(dashboardtypes): round-trip remaining zero-valued spec fields
Complete the dashboards-v2 create -> GET round-trip audit:
- DashboardSpec.Datasources: ,omitempty -> ,omitzero so an explicit {}
round-trips (omitempty dropped it) while an unset map stays omitted.
- DashboardV2 Image, DashboardSpec.Duration/RefreshInterval: drop ,omitempty
so an explicit "" round-trips (same class as Display.Description). The
server accepts "": DurationString.validate() returns nil for len 0, and
Image/Duration/RefreshInterval have no create-time validation, so a
GET-then-PUT of "" is not rejected.
Scalars carry no nullability (no spec change); the datasources map is now
nullable: true in the regenerated OpenAPI spec and client.
* test(dashboard): cover datasources/image/duration/refreshInterval round-trip
Extend the round-trip test with the spec-wide zero values just fixed: a
dashboard-level image "", spec duration/refreshInterval "", and an explicit
empty datasources {} that must echo back as {} (omitzero) rather than being
dropped.
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 : )