Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scopes: Select scope even without data retrieval #87988

Merged
merged 4 commits into from
May 29, 2024

Conversation

bfmatei
Copy link
Contributor

@bfmatei bfmatei commented May 16, 2024

What is this feature?

This PR allows a scope selection even if the scope details endpoint is not returning anything.

Why do we need this feature?

Sometimes there might not be details about a specific scope.

Who is this feature for?

Which issue(s) does this PR fix?:

Special notes for your reviewer:

Please check that:

  • It works as expected from a user's perspective.
  • If this is a pre-GA feature, it is behind a feature toggle.
  • The docs are updated, and if this is a notable improvement, it's added to our What's New doc.

@bfmatei bfmatei added area/dashboard no-changelog Skip including change in changelog/release notes team/grafana-dashboards Dashboards squad area/scopes scopes feature labels May 16, 2024
@bfmatei bfmatei self-assigned this May 16, 2024
@bfmatei bfmatei requested a review from a team as a code owner May 16, 2024 14:45
@bfmatei bfmatei requested review from ivanortegaalba and removed request for a team May 16, 2024 14:45
@grafana-delivery-bot grafana-delivery-bot bot added this to the 11.1.x milestone May 16, 2024
@bfmatei bfmatei requested a review from a team as a code owner May 16, 2024 14:54
Copy link
Member

@dprokop dprokop left a comment

Choose a reason for hiding this comment

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

Works as advertised :)

@@ -43,7 +43,7 @@ export interface Prometheus extends common.DataQuery {
* Returns a Range vector, comprised of a set of time series containing a range of data points over time for each time series
*/
range?: boolean;
scopes?: ScopeSpec[];
scopes?: Array<ScopeSpec & Pick<Scope['metadata'], 'name'>>;
Copy link
Member

Choose a reason for hiding this comment

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

I wonder- why not passing Scope[] here, but plain spec with picked metadata.name? Scope is pretty much the same thing, but structured.

Comment on lines 80 to +81
type ScopeSpec struct {
Name string `json:"name"` // This is the identifier from metadata.name of the scope model.
Copy link
Member

Choose a reason for hiding this comment

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

Similar comment to the one above - I would expect promlib to utilise the apis' scope spec struct rather than re-writing the type. Is there a reason for that @kylebrandt / @bergquist ?

@bfmatei bfmatei merged commit 55ea077 into main May 29, 2024
23 checks passed
@bfmatei bfmatei deleted the bogdan/scopes-use-without-filters branch May 29, 2024 17:09
miguelmolina95 pushed a commit to miguelmolina95/grafana that referenced this pull request Jun 3, 2024
* Scopes: Select scope even without data retrieval

* Pass entire scope and not only the spec to Prometheus

* Enrich ScopeSpec that is sent to Prometheus

* add name to BE

---------

Co-authored-by: Kyle Brandt <kyle@grafana.com>
kminehart pushed a commit that referenced this pull request Jun 10, 2024
* Scopes: Select scope even without data retrieval

* Pass entire scope and not only the spec to Prometheus

* Enrich ScopeSpec that is sent to Prometheus

* add name to BE

---------

Co-authored-by: Kyle Brandt <kyle@grafana.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/backend area/dashboard area/frontend area/scopes scopes feature no-changelog Skip including change in changelog/release notes team/grafana-dashboards Dashboards squad
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants