-
Notifications
You must be signed in to change notification settings - Fork 11.7k
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
Conversation
There was a problem hiding this 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'>>; |
There was a problem hiding this comment.
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.
type ScopeSpec struct { | ||
Name string `json:"name"` // This is the identifier from metadata.name of the scope model. |
There was a problem hiding this comment.
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 ?
* 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>
* 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>
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: