[ENHANCEMENT] TimeSeriesChart: add query name support for query settings#585
Conversation
… for query settings Signed-off-by: Guillaume LADORME <Gladorme@users.noreply.github.com>
Signed-off-by: Guillaume LADORME <Gladorme@users.noreply.github.com>
cc39a7d to
f6d19a8
Compare
| seriesIndex: 0, | ||
| querySettings: { | ||
| queryIndex: 0, | ||
| queryName: defaultQueryName(0), |
There was a problem hiding this comment.
that's a massive breaking change. This will break every dashboard created without dashboard as code or by migrating from Grafana.
There was a problem hiding this comment.
Yeah, I will check if I can keep old data model
There was a problem hiding this comment.
Ok, I remember why I did this change. We can't keep index, because it will cause issue when re-ordering queries with query settings. I will rename queryName to queryIndex, but result will be the same => they will need to update queryIndex.
There was a problem hiding this comment.
not sure why we are dropping the queryIndex, the index could be 0 and the name could be whatever. If name is a new field for better UX, queryIndex can be kept as it is.
There was a problem hiding this comment.
@jgbernalp Yes, queryIndex is not more dropped, but set as optional
There was a problem hiding this comment.
I wonder why it should be optional. Using the name to index might not be a good strategy, IIUC the index defines the order (functional) and the name is for display (cosmetic).
There was a problem hiding this comment.
Now that query can have name, I thought it was a nice idea to be based on it. But the more I think about it, the more I think it's better to stick to index for now and keep name only for cosmetic purpose.
The only drawback for query settings is: if you remove a query, it will change querysettings selector display. But it's already the case today, so I guess it's okay.
I will rollback to use queryIndex for functional purpose
Signed-off-by: Guillaume LADORME <Gladorme@users.noreply.github.com>
Signed-off-by: Guillaume LADORME <Gladorme@users.noreply.github.com>
Signed-off-by: Guillaume LADORME <Gladorme@users.noreply.github.com>
|
Should be good now @jgbernalp / @shahrokni. Btw, I think there a bug with query settings (already existing), if there are more than 1 series retuned by the query, the color is not applied (other styles are applied) or it's working as intended? 🤔 |
I will take a look. |
Description
Depends on: perses/shared#69
Add support for query name in query settings + deprecating queryIndex.
Migration guide:
Via the UI:
Go the dashboard, edit timeserieschart panel, go to query settings, update any value and save (it will migrate all query settings of the panel to queryName)
Manually:
Replace
queryIndexbyqueryName.Replace number by string
Query #<index + 1>or use helperdefaultQueryName.Example:
queryIndex: 0becomequeryName: 'Query #1'.Screenshots
Queries:

Query settings:

Checklist
[<catalog_entry>] <commit message>naming convention using one of thefollowing
catalog_entryvalues:FEATURE,ENHANCEMENT,BUGFIX,BREAKINGCHANGE,DOC,IGNORE.UI Changes