Proto commits in pyrra-dev/pyrra

These 26 commits are when the Protocol Buffers files have changed:

Commit:6c7bd2e
Author:Matthias Loibl
Committer:GitHub

feat(api): serve duration graphs for unstored SLOs (#1902) * proto: add PreviewGraphDuration RPC The duration graph is the last panel the Create SLO preview can't render. GraphDuration resolves its objective by expr, which only works once the SLO is stored, so a draft has no way in. PreviewGraphDuration takes the editor's YAML instead, mirroring how Preview already materializes an objective. Generated stubs regenerated with make proto. * feat(api): serve duration graphs for unstored SLOs Preview and GraphDuration each parsed configs and folded in grouping matchers their own way. Pulling that apart into objectiveFromConfig, mergeGroupingMatchers, graphRange and durationTimeseries lets PreviewGraphDuration reuse both halves without touching the backend client, and fixes three things the copies had drifted on: GraphDuration's merge nil-checked Ratio, Latency and BoolGauge but not LatencyNative, so picking a grouping on a native-histogram SLO silently plotted every series instead of the selected one. A percentile with no samples aborted the whole graph with NotFound — and passed connect a nil error while doing it. Draft SLOs hit that constantly, so skip the empty percentile and only fail when none of them have data. Non-latency objectives now fail with FailedPrecondition instead of letting DurationRange's empty query reach Prometheus.

Commit:399d77e
Author:Matthias Loibl
Committer:Matthias Loibl

proto: add PreviewGraphDuration RPC The duration graph is the last panel the Create SLO preview can't render. GraphDuration resolves its objective by expr, which only works once the SLO is stored, so a draft has no way in. PreviewGraphDuration takes the editor's YAML instead, mirroring how Preview already materializes an objective. Generated stubs regenerated with make proto.

Commit:5283c58
Author:Matthias Loibl
Committer:GitHub

feat(ui): suggest metrics and labels from Prometheus (#1901) * feat(ui): load metric/label/value suggestions live from Prometheus The Create SLO editor's autocomplete was backed by a small static catalog of demo metrics, so it suggested the wrong (and far too few) names against a real cluster. Add LabelNames/LabelValues RPCs to PrometheusService, surfacing the label discovery already available in the underlying Prometheus client but previously narrowed away by Pyrra's prometheusAPI wrappers. The editor now queries these live and unbounded (no start/end), matching how Prometheus' own UI drives its typeahead — metric names, then label names inside {}, then label values after an operator, scoped to the metric/label currently typed. The dropdown itself scrolls rather than truncating results. * feat(ui): fuzzy-match the Create SLO metric/label typeahead Plain substring filtering meant typing an abbreviated fragment like envoy_rx never surfaced envoy_http_downstream_rq_xx, even though it's clearly what's being typed towards. Port Prometheus' own subsequence scorer (util/strutil/subsequence.go, the same lineage as the @nexucis/fuzzy lib Prometheus' own web UI uses) so the dropdown ranks by fuzzy subsequence match instead of requiring a literal substring. * fix(ui): recompute typeahead context from the live keystroke MetricInput's onChange deferred suggestion refresh through requestAnimationFrame, reading the (stale-by-one-render) value prop alongside the DOM ref's already-current caret position. Typing {, =, or " landed a mismatched (old text, new caret) pair depending on whether React's re-render beat the rAF callback, so LabelNames/ LabelValues suggestions triggered inconsistently on exactly the characters that flip suggestion context. Derive the suggestion synchronously from the change event's own value/selectionStart instead, removing the race entirely. * feat(ui): show total and errors in the grouping chooser table Availability alone doesn't say whether a label set has enough traffic to trust the percentage. The per-row total/errors were already computed for the availability calculation — just surface them as their own columns, matching the Errors/Total convention already used by the Detail page's AvailabilityTile. * fix(ui): guard the typeahead's blur timeout against a fast refocus MetricInput/GroupingInput close their dropdown via setTimeout(120ms) on blur, so a click on a suggestion (which blurs the input via mousedown) still has time to apply() first. But the timeout cleared focus/open unconditionally, so any blur immediately followed by a refocus within that window left the state permanently stuck closed — nothing else ever re-opens it once the input already holds DOM focus. Check document.activeElement before clearing, matching the pattern's actual intent: only close if focus genuinely left. * fix(ui): reopen the typeahead after picking a suggestion or Escape apply() and Escape close the dropdown via setFocused(false) without a real blur (picking a suggestion calls preventDefault() on mousedown specifically so the input never loses focus), so nothing was left to flip focused back to true — onFocus only fires on a genuine blur/ focus cycle, which no longer happens. Typing "handler" from the dropdown, then continuing with ="read for the value, silently never showed suggestions again after the first pick. Re-assert focus in refreshFrom, which every real interaction (typing, clicking) already funnels through. * fix(ui): satisfy strict-boolean-expressions in the fuzzy-match sort The sort comparator relied on 0 being falsy to fall through from the score delta to the alphabetical tiebreak, which ESLint's strict-boolean-expressions rejects (a number isn't a boolean, even in a logical-OR). Compute the delta once and check it explicitly.

Commit:636c29a
Author:Matthias Loibl
Committer:Matthias Loibl

proto: add PreviewGraphDuration RPC The duration graph is the last panel the Create SLO preview can't render. GraphDuration resolves its objective by expr, which only works once the SLO is stored, so a draft has no way in. PreviewGraphDuration takes the editor's YAML instead, mirroring how Preview already materializes an objective. Generated stubs regenerated with make proto.

Commit:4116d93
Author:Matthias Loibl
Committer:Matthias Loibl

feat(ui): load metric/label/value suggestions live from Prometheus The Create SLO editor's autocomplete was backed by a small static catalog of demo metrics, so it suggested the wrong (and far too few) names against a real cluster. Add LabelNames/LabelValues RPCs to PrometheusService, surfacing the label discovery already available in the underlying Prometheus client but previously narrowed away by Pyrra's prometheusAPI wrappers. The editor now queries these live and unbounded (no start/end), matching how Prometheus' own UI drives its typeahead — metric names, then label names inside {}, then label values after an operator, scoped to the metric/label currently typed. The dropdown itself scrolls rather than truncating results.

Commit:9f0bcd4
Author:Matthias Loibl
Committer:GitHub

feat(api): add the Preview RPC for the Create SLO editor (#1900) * feat(api): add Preview RPC for the Create SLO editor The editor's live Detail preview needs a draft SLO materialized into an Objective without persisting it. Preview parses the submitted YAML through the same path a stored config takes and fills in the queries like List, entirely in the API layer with no backend round-trip, so the editor can render the detail page against real Prometheus data. The frontend's previewObjective now calls this RPC instead of failing closed. * feat(slo): add raw query variants for the Create SLO preview The Preview endpoint materializes an SLO that doesn't exist yet, so none of its recording rules (`:increase`, `:burnrate`, ...) have been generated. Querying those would return no data. Add QueryTotalRaw/QueryErrorsRaw/QueryErrorBudgetRaw that compute the total, errors and error budget directly from the underlying metrics with increase()/count_over_time() over the window, and switch the Preview handler to use them. The raw matchers omit the recording-rule-only `slo` label and the latency `le` disambiguation. Results are ungrouped so the preview tiles show a single overall availability number. Covered by tests asserting no raw query references a recording rule across all indicator types. * feat(ui): add grouping chooser to the SLO Create preview When the draft SLO declares grouping labels, Preview now shows a table of all matching label sets — pills per row, current availability — instead of going straight to the Detail view. Clicking a row re-materialises the objective scoped to that single label set and renders its tiles and graphs. A "← Groupings" back link returns to the chooser. Backend: added PreviewRequest.grouping (proto + codegen); the Preview handler folds those matchers into the indicator to scope raw queries to one series. QueryTotalRaw/QueryErrorsRaw now emit `sum by (<grouping>) …` so the grouped preview returns one series per label set, giving the frontend enough data to build the chooser without an extra discovery round-trip.

Commit:fc46398
Author:Matthias Loibl
Committer:Matthias Loibl

feat(ui): add grouping chooser to the SLO Create preview When the draft SLO declares grouping labels, Preview now shows a table of all matching label sets — pills per row, current availability — instead of going straight to the Detail view. Clicking a row re-materialises the objective scoped to that single label set and renders its tiles and graphs. A "← Groupings" back link returns to the chooser. Backend: added PreviewRequest.grouping (proto + codegen); the Preview handler folds those matchers into the indicator to scope raw queries to one series. QueryTotalRaw/QueryErrorsRaw now emit `sum by (<grouping>) …` so the grouped preview returns one series per label set, giving the frontend enough data to build the chooser without an extra discovery round-trip.

Commit:f0ceaf9
Author:Matthias Loibl
Committer:Matthias Loibl

feat(api): add Preview RPC for the Create SLO editor The editor's live Detail preview needs a draft SLO materialized into an Objective without persisting it. Preview parses the submitted YAML through the same path a stored config takes and fills in the queries like List, entirely in the API layer with no backend round-trip, so the editor can render the detail page against real Prometheus data. The frontend's previewObjective now calls this RPC instead of failing closed.

Commit:edd3ba2
Author:Matthias Loibl
Committer:Matthias Loibl

proto: add PreviewGraphDuration RPC The duration graph is the last panel the Create SLO preview can't render. GraphDuration resolves its objective by expr, which only works once the SLO is stored, so a draft has no way in. PreviewGraphDuration takes the editor's YAML instead, mirroring how Preview already materializes an objective. Generated stubs regenerated with make proto.

Commit:3e36673
Author:Matthias Loibl
Committer:Matthias Loibl

feat(ui): load metric/label/value suggestions live from Prometheus The Create SLO editor's autocomplete was backed by a small static catalog of demo metrics, so it suggested the wrong (and far too few) names against a real cluster. Add LabelNames/LabelValues RPCs to PrometheusService, surfacing the label discovery already available in the underlying Prometheus client but previously narrowed away by Pyrra's prometheusAPI wrappers. The editor now queries these live and unbounded (no start/end), matching how Prometheus' own UI drives its typeahead — metric names, then label names inside {}, then label values after an operator, scoped to the metric/label currently typed. The dropdown itself scrolls rather than truncating results.

Commit:354c7fb
Author:Matthias Loibl
Committer:Matthias Loibl

feat(ui): add grouping chooser to the SLO Create preview When the draft SLO declares grouping labels, Preview now shows a table of all matching label sets — pills per row, current availability — instead of going straight to the Detail view. Clicking a row re-materialises the objective scoped to that single label set and renders its tiles and graphs. A "← Groupings" back link returns to the chooser. Backend: added PreviewRequest.grouping (proto + codegen); the Preview handler folds those matchers into the indicator to scope raw queries to one series. QueryTotalRaw/QueryErrorsRaw now emit `sum by (<grouping>) …` so the grouped preview returns one series per label set, giving the frontend enough data to build the chooser without an extra discovery round-trip.

Commit:230d0ee
Author:Matthias Loibl
Committer:Matthias Loibl

feat(api): add Preview RPC for the Create SLO editor The editor's live Detail preview needs a draft SLO materialized into an Objective without persisting it. Preview parses the submitted YAML through the same path a stored config takes and fills in the queries like List, entirely in the API layer with no backend round-trip, so the editor can render the detail page against real Prometheus data. The frontend's previewObjective now calls this RPC instead of failing closed.

Commit:eb991cf
Author:Matthias Loibl

proto: add PreviewGraphDuration RPC The duration graph is the last panel the Create SLO preview can't render. GraphDuration resolves its objective by expr, which only works once the SLO is stored, so a draft has no way in. PreviewGraphDuration takes the editor's YAML instead, mirroring how Preview already materializes an objective. Generated stubs regenerated with make proto.

Commit:3cf351f
Author:Matthias Loibl

feat(ui): load metric/label/value suggestions live from Prometheus The Create SLO editor's autocomplete was backed by a small static catalog of demo metrics, so it suggested the wrong (and far too few) names against a real cluster. Add LabelNames/LabelValues RPCs to PrometheusService, surfacing the label discovery already available in the underlying Prometheus client but previously narrowed away by Pyrra's prometheusAPI wrappers. The editor now queries these live and unbounded (no start/end), matching how Prometheus' own UI drives its typeahead — metric names, then label names inside {}, then label values after an operator, scoped to the metric/label currently typed. The dropdown itself scrolls rather than truncating results.

Commit:f663acf
Author:Matthias Loibl

feat(ui): add grouping chooser to the SLO Create preview When the draft SLO declares grouping labels, Preview now shows a table of all matching label sets — pills per row, current availability — instead of going straight to the Detail view. Clicking a row re-materialises the objective scoped to that single label set and renders its tiles and graphs. A "← Groupings" back link returns to the chooser. Backend: added PreviewRequest.grouping (proto + codegen); the Preview handler folds those matchers into the indicator to scope raw queries to one series. QueryTotalRaw/QueryErrorsRaw now emit `sum by (<grouping>) …` so the grouped preview returns one series per label set, giving the frontend enough data to build the chooser without an extra discovery round-trip.

Commit:e1411ef
Author:Matthias Loibl

feat(api): add Preview RPC for the Create SLO editor The editor's live Detail preview needs a draft SLO materialized into an Objective without persisting it. Preview parses the submitted YAML through the same path a stored config takes and fills in the queries like List, entirely in the API layer with no backend round-trip, so the editor can render the detail page against real Prometheus data. The frontend's previewObjective now calls this RPC instead of failing closed.

Commit:911e98c
Author:Matthias Loibl

Fix rebasing boolGauge

The documentation is generated from this commit.

Commit:0ec1af2
Author:Matthias Loibl

Continue adding native histograms support

Commit:9dbb502
Author:Matthias Loibl
Committer:Matthias Loibl

Create an interactive editor

Commit:48cb2d9
Author:Julien Pivotto
Committer:Julien Pivotto

Add support for a new type of indicator called "GaugeBool" GaugeBool is specifically designed for gauges that range from 0 to 1, such as the `up` or `probe_success` gauges commonly found in Prometheus ecosystems. These gauges represent the availability or success of a system and are important indicators of the overall health of the system. Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>

Commit:351830d
Author:Matthias Loibl
Committer:Matthias Loibl

Use react-query to query objectives and prometheus service

Commit:6dc0e36
Author:Matthias Loibl

ui: Create a duration histogram graph for latency SLOs

Commit:8cf9044
Author:Matthias Loibl

Bring back GetStatus time parameter after rebase

Commit:b514730
Author:Matthias Loibl
Committer:Matthias Loibl

Generate all missing API calls

Commit:a82ae73
Author:Matthias Loibl
Committer:Matthias Loibl

Add connect-web and try adding prometheus proto as dep

Commit:9b57101
Author:Matthias Loibl
Committer:Matthias Loibl

Start adding connect-go for the API and backend API