Azure: Add support for custom namespace and custom metrics variable queries (#99279)
* Add custom metric namespace and metric name queries * Fix outdated type * Support specifying custom - Add custom support to getMetricNamespaces - Ensure the customNamespace is specified in getMetricNames calls * Update data source tests * Support custom namespace/metrics variable queries - Add tests * Add fields to variable editor - Update tests - Update docs - Update selectors * Remove unneeded Promise.resolve * Add comment * Don't mutate expected path * Lint * Update docs/sources/datasources/azure-monitor/template-variables/index.md Co-authored-by: Larissa Wandzura <126723338+lwandz13@users.noreply.github.com> * Update docs/sources/datasources/azure-monitor/template-variables/index.md Co-authored-by: Larissa Wandzura <126723338+lwandz13@users.noreply.github.com> * Update docs * Update conditionals * Lint --------- Co-authored-by: Larissa Wandzura <126723338+lwandz13@users.noreply.github.com>
This commit is contained in:
co-authored by
Larissa Wandzura
parent
c6ba0910b4
commit
e01d8ad5b5
@@ -28,6 +28,7 @@ type AzureMonitorQuery struct {
|
||||
// TODO make this required and give it a default
|
||||
QueryType *string `json:"queryType,omitempty"`
|
||||
// Azure subscription containing the resource(s) to be queried.
|
||||
// Also used for template variable queries
|
||||
Subscription *string `json:"subscription,omitempty"`
|
||||
// Subscriptions to be queried via Azure Resource Graph.
|
||||
Subscriptions []string `json:"subscriptions,omitempty"`
|
||||
@@ -41,11 +42,16 @@ type AzureMonitorQuery struct {
|
||||
AzureTraces *AzureTracesQuery `json:"azureTraces,omitempty"`
|
||||
// @deprecated Legacy template variable support.
|
||||
GrafanaTemplateVariableFn *GrafanaTemplateVariableQuery `json:"grafanaTemplateVariableFn,omitempty"`
|
||||
// Template variables params. These exist for backwards compatiblity with legacy template variables.
|
||||
// Resource group used in template variable queries
|
||||
ResourceGroup *string `json:"resourceGroup,omitempty"`
|
||||
Namespace *string `json:"namespace,omitempty"`
|
||||
Resource *string `json:"resource,omitempty"`
|
||||
Region *string `json:"region,omitempty"`
|
||||
// Namespace used in template variable queries
|
||||
Namespace *string `json:"namespace,omitempty"`
|
||||
// Resource used in template variable queries
|
||||
Resource *string `json:"resource,omitempty"`
|
||||
// Region used in template variable queries
|
||||
Region *string `json:"region,omitempty"`
|
||||
// Custom namespace used in template variable queries
|
||||
CustomNamespace *string `json:"customNamespace,omitempty"`
|
||||
// For mixed data sources the selected datasource is on the query level.
|
||||
// For non mixed scenarios this is undefined.
|
||||
// TODO find a better way to do this ^ that's friendly to schema
|
||||
@@ -77,6 +83,8 @@ const (
|
||||
AzureQueryTypeLocationsQuery AzureQueryType = "Azure Regions"
|
||||
AzureQueryTypeGrafanaTemplateVariableFn AzureQueryType = "Grafana Template Variable Function"
|
||||
AzureQueryTypeTraceExemplar AzureQueryType = "traceql"
|
||||
AzureQueryTypeCustomNamespacesQuery AzureQueryType = "Azure Custom Namespaces"
|
||||
AzureQueryTypeCustomMetricNamesQuery AzureQueryType = "Azure Custom Metric Names"
|
||||
)
|
||||
|
||||
type AzureMetricQuery struct {
|
||||
|
||||
Reference in New Issue
Block a user