Skip to content

Add queryOptions.Inreval that may be used by interval/range vars#1957

Merged
chudilka1 merged 2 commits intomainfrom
CRE-2315-grafana
Apr 2, 2026
Merged

Add queryOptions.Inreval that may be used by interval/range vars#1957
chudilka1 merged 2 commits intomainfrom
CRE-2315-grafana

Conversation

@chudilka1
Copy link
Copy Markdown
Contributor

Added an ability to override/set default interval for panels, which may be used by $__range/interval variables. Earlier, some panels that used those failed due to a default min interval of 15s, which was too short for those vars to provide data, compared to hardcoded time windows [3m up to 15m].
image

@chudilka1 chudilka1 requested a review from a team as a code owner April 2, 2026 13:19
Copilot AI review requested due to automatic review settings April 2, 2026 13:19
@chudilka1 chudilka1 requested review from Atrax1 and jmank88 April 2, 2026 13:20
@chudilka1 chudilka1 changed the title Add query options Inreval to that may be used by interval/range vars Add queryOptions.Inreval that may be used by interval/range vars Apr 2, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2026

✅ API Diff Results - github.com/smartcontractkit/chainlink-common/observability-lib

✅ Compatible Changes (1)

grafana.Query (1)
  • Interval — ➕ Added

📄 View full apidiff report

Atrax1
Atrax1 previously approved these changes Apr 2, 2026
jmank88
jmank88 previously approved these changes Apr 2, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR extends the Grafana dashboard/panel builder library to better control query interval behavior (to support $__interval-driven PromQL) and adds a small row-building enhancement, while also updating the Grafana Foundation SDK dependency.

Changes:

  • Add per-query Interval support for Prometheus targets (via Query.IntervalDataqueryBuilder.Interval).
  • Add FieldMinMax to PanelOptions and wire it into multiple panel constructors.
  • Enhance Builder.AddRow to optionally create collapsed rows; update SDK version pin in go.mod/go.sum.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
observability-lib/grafana/panels.go Adds query-level interval support, duration validation helper, and propagates FieldMinMax into panel builders.
observability-lib/grafana/builder.go Extends AddRow with optional collapsed behavior.
observability-lib/grafana/builder_test.go Adds a test ensuring collapsed rows are set correctly.
observability-lib/go.mod Updates Grafana Foundation SDK dependency to v0.0.12.
observability-lib/go.sum Updates checksums for the new Grafana Foundation SDK version.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chudilka1 chudilka1 dismissed stale reviews from Atrax1 and jmank88 via fa62eff April 2, 2026 13:32
@chudilka1 chudilka1 deployed to integration April 2, 2026 13:32 — with GitHub Actions Active
@chudilka1 chudilka1 requested a review from Atrax1 April 2, 2026 14:22
@chudilka1 chudilka1 added this pull request to the merge queue Apr 2, 2026
Merged via the queue into main with commit 55813cb Apr 2, 2026
33 of 34 checks passed
@chudilka1 chudilka1 deleted the CRE-2315-grafana branch April 2, 2026 14:36
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.

4 participants