CustomVariable: support values with multiple properties (json values format) (#113844)

* update Scenes libraries

---------

Co-authored-by: idastambuk <ida.stambuk@grafana.com>
This commit is contained in:
Marc M.
2026-01-07 11:01:03 +01:00
committed by GitHub
co-authored by idastambuk
parent 05681efee3
commit be734e970e
48 changed files with 1480 additions and 450 deletions
+10
View File
@@ -837,6 +837,8 @@ type VariableModel struct {
// Optional field, if you want to extract part of a series name or metric node segment.
// Named capture groups can be used to separate the display text and value.
Regex *string `json:"regex,omitempty"`
// Optional, indicates whether a custom type variable uses CSV or JSON to define its values
ValuesFormat *VariableModelValuesFormat `json:"valuesFormat,omitempty"`
// Determine whether regex applies to variable value or display text
RegexApplyTo *VariableRegexApplyTo `json:"regexApplyTo,omitempty"`
// Additional static options for query variable
@@ -852,6 +854,7 @@ func NewVariableModel() *VariableModel {
Multi: (func(input bool) *bool { return &input })(false),
AllowCustomValue: (func(input bool) *bool { return &input })(true),
IncludeAll: (func(input bool) *bool { return &input })(false),
ValuesFormat: (func(input VariableModelValuesFormat) *VariableModelValuesFormat { return &input })(VariableModelValuesFormatCsv),
}
}
@@ -1191,6 +1194,13 @@ const (
DataTransformerConfigTopicAlertStates DataTransformerConfigTopic = "alertStates"
)
type VariableModelValuesFormat string
const (
VariableModelValuesFormatCsv VariableModelValuesFormat = "csv"
VariableModelValuesFormatJson VariableModelValuesFormat = "json"
)
type VariableModelStaticOptionsOrder string
const (
@@ -1786,6 +1786,13 @@
"skipUrlSync": {
"type": "boolean",
"default": false
},
"valuesFormat": {
"enum": [
"csv",
"json"
],
"type": "string"
}
},
"additionalProperties": false
@@ -1801,6 +1801,13 @@
"skipUrlSync": {
"type": "boolean",
"default": false
},
"valuesFormat": {
"type": "string",
"enum": [
"csv",
"json"
]
}
},
"additionalProperties": false