Documentation
¶
Index ¶
- type AppInsightsGroupByQuery
- type AppInsightsGroupByQueryKind
- type AppInsightsMetricNameQuery
- type AppInsightsMetricNameQueryKind
- type AzureLogsQuery
- type AzureMetricDimension
- type AzureMetricQuery
- type AzureMonitorDataQuery
- type AzureMonitorQuery
- type AzureMonitorResource
- type AzureQueryType
- type AzureResourceGraphQuery
- type AzureTracesFilter
- type AzureTracesQuery
- type BaseGrafanaTemplateVariableQuery
- type DataQuery
- type GrafanaTemplateVariableQueryType
- type MetricDefinitionsQuery
- type MetricDefinitionsQueryKind
- type MetricNamesQuery
- type MetricNamesQueryKind
- type MetricNamespaceQuery
- type MetricNamespaceQueryKind
- type ResourceGroupsQuery
- type ResourceGroupsQueryKind
- type ResourceNamesQuery
- type ResourceNamesQueryKind
- type ResultFormat
- type SubscriptionsQuery
- type SubscriptionsQueryKind
- type UnknownQuery
- type UnknownQueryKind
- type WorkspacesQuery
- type WorkspacesQueryKind
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppInsightsGroupByQuery ¶
type AppInsightsGroupByQuery struct {
BaseGrafanaTemplateVariableQuery
Kind AppInsightsGroupByQueryKind `json:"kind"`
MetricName string `json:"metricName"`
RawQuery *string `json:"rawQuery,omitempty"`
}
AppInsightsGroupByQuery defines model for AppInsightsGroupByQuery.
type AppInsightsGroupByQueryKind ¶
type AppInsightsGroupByQueryKind string
AppInsightsGroupByQueryKind defines model for AppInsightsGroupByQuery.Kind.
const (
AppInsightsGroupByQueryKindAppInsightsGroupByQuery AppInsightsGroupByQueryKind = "AppInsightsGroupByQuery"
)
Defines values for AppInsightsGroupByQueryKind.
type AppInsightsMetricNameQuery ¶
type AppInsightsMetricNameQuery struct {
BaseGrafanaTemplateVariableQuery
Kind AppInsightsMetricNameQueryKind `json:"kind"`
RawQuery *string `json:"rawQuery,omitempty"`
}
AppInsightsMetricNameQuery defines model for AppInsightsMetricNameQuery.
type AppInsightsMetricNameQueryKind ¶
type AppInsightsMetricNameQueryKind string
AppInsightsMetricNameQueryKind defines model for AppInsightsMetricNameQuery.Kind.
const (
AppInsightsMetricNameQueryKindAppInsightsMetricNameQuery AppInsightsMetricNameQueryKind = "AppInsightsMetricNameQuery"
)
Defines values for AppInsightsMetricNameQueryKind.
type AzureLogsQuery ¶
type AzureLogsQuery struct {
// If set to true the intersection of time ranges specified in the query and Grafana will be used. Otherwise the query time ranges will be used. Defaults to false
IntersectTime *bool `json:"intersectTime,omitempty"`
// KQL query to be executed.
Query *string `json:"query,omitempty"`
// @deprecated Use resources instead
Resource *string `json:"resource,omitempty"`
// Array of resource URIs to be queried.
Resources []string `json:"resources,omitempty"`
ResultFormat *ResultFormat `json:"resultFormat,omitempty"`
// Workspace ID. This was removed in Grafana 8, but remains for backwards compat
Workspace *string `json:"workspace,omitempty"`
}
Azure Monitor Logs sub-query properties
type AzureMetricDimension ¶
type AzureMetricDimension struct {
// Name of Dimension to be filtered on.
Dimension *string `json:"dimension,omitempty"`
// @deprecated filter is deprecated in favour of filters to support multiselect.
Filter *string `json:"filter,omitempty"`
// Values to match with the filter.
Filters []string `json:"filters,omitempty"`
// String denoting the filter operation. Supports 'eq' - equals,'ne' - not equals, 'sw' - starts with. Note that some dimensions may not support all operators.
Operator *string `json:"operator,omitempty"`
}
AzureMetricDimension defines model for AzureMetricDimension.
type AzureMetricQuery ¶
type AzureMetricQuery struct {
// The aggregation to be used within the query. Defaults to the primaryAggregationType defined by the metric.
Aggregation *string `json:"aggregation,omitempty"`
// Aliases can be set to modify the legend labels. e.g. {{ resourceGroup }}. See docs for more detail.
Alias *string `json:"alias,omitempty"`
// Time grains that are supported by the metric.
AllowedTimeGrainsMs []int64 `json:"allowedTimeGrainsMs,omitempty"`
// Used as the value for the metricNamespace property when it's different from the resource namespace.
CustomNamespace *string `json:"customNamespace,omitempty"`
// @deprecated This property was migrated to dimensionFilters and should only be accessed in the migration
Dimension *string `json:"dimension,omitempty"`
// @deprecated This property was migrated to dimensionFilters and should only be accessed in the migration
DimensionFilter *string `json:"dimensionFilter,omitempty"`
// Filters to reduce the set of data returned. Dimensions that can be filtered on are defined by the metric.
DimensionFilters []AzureMetricDimension `json:"dimensionFilters,omitempty"`
// @deprecated Use metricNamespace instead
MetricDefinition *string `json:"metricDefinition,omitempty"`
// The metric to query data for within the specified metricNamespace. e.g. UsedCapacity
MetricName *string `json:"metricName,omitempty"`
// metricNamespace is used as the resource type (or resource namespace).
// It's usually equal to the target metric namespace. e.g. microsoft.storage/storageaccounts
// Kept the name of the variable as metricNamespace to avoid backward incompatibility issues.
MetricNamespace *string `json:"metricNamespace,omitempty"`
// The Azure region containing the resource(s).
Region *string `json:"region,omitempty"`
// @deprecated Use resources instead
ResourceGroup *string `json:"resourceGroup,omitempty"`
// @deprecated Use resources instead
ResourceName *string `json:"resourceName,omitempty"`
// @deprecated Use resourceGroup, resourceName and metricNamespace instead
ResourceUri *string `json:"resourceUri,omitempty"`
// Array of resource URIs to be queried.
Resources []AzureMonitorResource `json:"resources,omitempty"`
// The granularity of data points to be queried. Defaults to auto.
TimeGrain *string `json:"timeGrain,omitempty"`
// TimeGrainUnit @deprecated
TimeGrainUnit *string `json:"timeGrainUnit,omitempty"`
// Maximum number of records to return. Defaults to 10.
Top *string `json:"top,omitempty"`
}
AzureMetricQuery defines model for AzureMetricQuery.
type AzureMonitorDataQuery ¶
AzureMonitorDataQuery defines model for AzureMonitorDataQuery.
type AzureMonitorQuery ¶
type AzureMonitorQuery struct {
// DataQuery These are the common properties available to all queries in all datasources.
// Specific implementations will *extend* this interface, adding the required
// properties for the given context.
DataQuery
// Azure Monitor Logs sub-query properties
AzureLogAnalytics *AzureLogsQuery `json:"azureLogAnalytics,omitempty"`
AzureMonitor *AzureMetricQuery `json:"azureMonitor,omitempty"`
AzureResourceGraph *AzureResourceGraphQuery `json:"azureResourceGraph,omitempty"`
// Application Insights Traces sub-query properties
AzureTraces *AzureTracesQuery `json:"azureTraces,omitempty"`
GrafanaTemplateVariableFn *any `json:"grafanaTemplateVariableFn,omitempty"`
Namespace *string `json:"namespace,omitempty"`
// Azure Monitor query type.
// queryType: #AzureQueryType
Region *string `json:"region,omitempty"`
Resource *string `json:"resource,omitempty"`
// Template variables params. These exist for backwards compatiblity with legacy template variables.
ResourceGroup *string `json:"resourceGroup,omitempty"`
// Azure subscription containing the resource(s) to be queried.
Subscription *string `json:"subscription,omitempty"`
// Subscriptions to be queried via Azure Resource Graph.
Subscriptions []string `json:"subscriptions,omitempty"`
}
AzureMonitorQuery defines model for AzureMonitorQuery.
type AzureMonitorResource ¶
type AzureMonitorResource struct {
MetricNamespace *string `json:"metricNamespace,omitempty"`
Region *string `json:"region,omitempty"`
ResourceGroup *string `json:"resourceGroup,omitempty"`
ResourceName *string `json:"resourceName,omitempty"`
Subscription *string `json:"subscription,omitempty"`
}
AzureMonitorResource defines model for AzureMonitorResource.
type AzureQueryType ¶
type AzureQueryType string
Defines the supported queryTypes. GrafanaTemplateVariableFn is deprecated
const ( AzureQueryTypeAzureLogAnalytics AzureQueryType = "Azure Log Analytics" AzureQueryTypeAzureMetricNames AzureQueryType = "Azure Metric Names" AzureQueryTypeAzureMonitor AzureQueryType = "Azure Monitor" AzureQueryTypeAzureNamespaces AzureQueryType = "Azure Namespaces" AzureQueryTypeAzureRegions AzureQueryType = "Azure Regions" AzureQueryTypeAzureResourceGraph AzureQueryType = "Azure Resource Graph" AzureQueryTypeAzureResourceGroups AzureQueryType = "Azure Resource Groups" AzureQueryTypeAzureResourceNames AzureQueryType = "Azure Resource Names" AzureQueryTypeAzureSubscriptions AzureQueryType = "Azure Subscriptions" AzureQueryTypeAzureTraces AzureQueryType = "Azure Traces" AzureQueryTypeAzureWorkspaces AzureQueryType = "Azure Workspaces" AzureQueryTypeGrafanaTemplateVariableFunction AzureQueryType = "Grafana Template Variable Function" )
Defines values for AzureQueryType.
type AzureResourceGraphQuery ¶
type AzureResourceGraphQuery struct {
// Azure Resource Graph KQL query to be executed.
Query *string `json:"query,omitempty"`
// Specifies the format results should be returned as. Defaults to table.
ResultFormat *string `json:"resultFormat,omitempty"`
}
AzureResourceGraphQuery defines model for AzureResourceGraphQuery.
type AzureTracesFilter ¶
type AzureTracesFilter struct {
// Values to filter by.
Filters []string `json:"filters"`
// Comparison operator to use. Either equals or not equals.
Operation string `json:"operation"`
// Property name, auto-populated based on available traces.
Property string `json:"property"`
}
AzureTracesFilter defines model for AzureTracesFilter.
type AzureTracesQuery ¶
type AzureTracesQuery struct {
// Filters for property values.
Filters []AzureTracesFilter `json:"filters,omitempty"`
// Operation ID. Used only for Traces queries.
OperationId *string `json:"operationId,omitempty"`
// KQL query to be executed.
Query *string `json:"query,omitempty"`
// Array of resource URIs to be queried.
Resources []string `json:"resources,omitempty"`
ResultFormat *ResultFormat `json:"resultFormat,omitempty"`
// Types of events to filter by.
TraceTypes []string `json:"traceTypes,omitempty"`
}
Application Insights Traces sub-query properties
type BaseGrafanaTemplateVariableQuery ¶
type BaseGrafanaTemplateVariableQuery struct {
RawQuery *string `json:"rawQuery,omitempty"`
}
BaseGrafanaTemplateVariableQuery defines model for BaseGrafanaTemplateVariableQuery.
type DataQuery ¶
type DataQuery struct {
// 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
// TODO this shouldn't be unknown but DataSourceRef | null
Datasource *any `json:"datasource,omitempty"`
// Hide true if query is disabled (ie should not be returned to the dashboard)
// Note this does not always imply that the query should not be executed since
// the results from a hidden query may be used as the input to other queries (SSE etc)
Hide *bool `json:"hide,omitempty"`
// Specify the query flavor
// TODO make this required and give it a default
QueryType *string `json:"queryType,omitempty"`
// A unique identifier for the query within the list of targets.
// In server side expressions, the refId is used as a variable name to identify results.
// By default, the UI will assign A->Z; however setting meaningful names may be useful.
RefId string `json:"refId"`
}
These are the common properties available to all queries in all datasources. Specific implementations will *extend* this interface, adding the required properties for the given context.
type GrafanaTemplateVariableQueryType ¶
type GrafanaTemplateVariableQueryType string
GrafanaTemplateVariableQueryType defines model for GrafanaTemplateVariableQueryType.
const ( GrafanaTemplateVariableQueryTypeAppInsightsGroupByQuery GrafanaTemplateVariableQueryType = "AppInsightsGroupByQuery" GrafanaTemplateVariableQueryTypeAppInsightsMetricNameQuery GrafanaTemplateVariableQueryType = "AppInsightsMetricNameQuery" GrafanaTemplateVariableQueryTypeMetricNamesQuery GrafanaTemplateVariableQueryType = "MetricNamesQuery" GrafanaTemplateVariableQueryTypeMetricNamespaceQuery GrafanaTemplateVariableQueryType = "MetricNamespaceQuery" GrafanaTemplateVariableQueryTypeResourceGroupsQuery GrafanaTemplateVariableQueryType = "ResourceGroupsQuery" GrafanaTemplateVariableQueryTypeResourceNamesQuery GrafanaTemplateVariableQueryType = "ResourceNamesQuery" GrafanaTemplateVariableQueryTypeSubscriptionsQuery GrafanaTemplateVariableQueryType = "SubscriptionsQuery" GrafanaTemplateVariableQueryTypeUnknownQuery GrafanaTemplateVariableQueryType = "UnknownQuery" GrafanaTemplateVariableQueryTypeWorkspacesQuery GrafanaTemplateVariableQueryType = "WorkspacesQuery" )
Defines values for GrafanaTemplateVariableQueryType.
type MetricDefinitionsQuery ¶
type MetricDefinitionsQuery struct {
BaseGrafanaTemplateVariableQuery
Kind MetricDefinitionsQueryKind `json:"kind"`
MetricNamespace *string `json:"metricNamespace,omitempty"`
RawQuery *string `json:"rawQuery,omitempty"`
ResourceGroup string `json:"resourceGroup"`
ResourceName *string `json:"resourceName,omitempty"`
Subscription string `json:"subscription"`
}
MetricDefinitionsQuery defines model for MetricDefinitionsQuery.
type MetricDefinitionsQueryKind ¶
type MetricDefinitionsQueryKind string
MetricDefinitionsQueryKind defines model for MetricDefinitionsQuery.Kind.
const (
MetricDefinitionsQueryKindMetricDefinitionsQuery MetricDefinitionsQueryKind = "MetricDefinitionsQuery"
)
Defines values for MetricDefinitionsQueryKind.
type MetricNamesQuery ¶
type MetricNamesQuery struct {
BaseGrafanaTemplateVariableQuery
Kind MetricNamesQueryKind `json:"kind"`
MetricNamespace string `json:"metricNamespace"`
RawQuery *string `json:"rawQuery,omitempty"`
ResourceGroup string `json:"resourceGroup"`
ResourceName string `json:"resourceName"`
Subscription string `json:"subscription"`
}
MetricNamesQuery defines model for MetricNamesQuery.
type MetricNamesQueryKind ¶
type MetricNamesQueryKind string
MetricNamesQueryKind defines model for MetricNamesQuery.Kind.
const (
MetricNamesQueryKindMetricNamesQuery MetricNamesQueryKind = "MetricNamesQuery"
)
Defines values for MetricNamesQueryKind.
type MetricNamespaceQuery ¶
type MetricNamespaceQuery struct {
BaseGrafanaTemplateVariableQuery
Kind MetricNamespaceQueryKind `json:"kind"`
MetricNamespace *string `json:"metricNamespace,omitempty"`
RawQuery *string `json:"rawQuery,omitempty"`
ResourceGroup string `json:"resourceGroup"`
ResourceName *string `json:"resourceName,omitempty"`
Subscription string `json:"subscription"`
}
MetricNamespaceQuery defines model for MetricNamespaceQuery.
type MetricNamespaceQueryKind ¶
type MetricNamespaceQueryKind string
MetricNamespaceQueryKind defines model for MetricNamespaceQuery.Kind.
const (
MetricNamespaceQueryKindMetricNamespaceQuery MetricNamespaceQueryKind = "MetricNamespaceQuery"
)
Defines values for MetricNamespaceQueryKind.
type ResourceGroupsQuery ¶
type ResourceGroupsQuery struct {
BaseGrafanaTemplateVariableQuery
Kind ResourceGroupsQueryKind `json:"kind"`
RawQuery *string `json:"rawQuery,omitempty"`
Subscription string `json:"subscription"`
}
ResourceGroupsQuery defines model for ResourceGroupsQuery.
type ResourceGroupsQueryKind ¶
type ResourceGroupsQueryKind string
ResourceGroupsQueryKind defines model for ResourceGroupsQuery.Kind.
const (
ResourceGroupsQueryKindResourceGroupsQuery ResourceGroupsQueryKind = "ResourceGroupsQuery"
)
Defines values for ResourceGroupsQueryKind.
type ResourceNamesQuery ¶
type ResourceNamesQuery struct {
BaseGrafanaTemplateVariableQuery
Kind ResourceNamesQueryKind `json:"kind"`
MetricNamespace string `json:"metricNamespace"`
RawQuery *string `json:"rawQuery,omitempty"`
ResourceGroup string `json:"resourceGroup"`
Subscription string `json:"subscription"`
}
ResourceNamesQuery defines model for ResourceNamesQuery.
type ResourceNamesQueryKind ¶
type ResourceNamesQueryKind string
ResourceNamesQueryKind defines model for ResourceNamesQuery.Kind.
const (
ResourceNamesQueryKindResourceNamesQuery ResourceNamesQueryKind = "ResourceNamesQuery"
)
Defines values for ResourceNamesQueryKind.
type ResultFormat ¶
type ResultFormat string
ResultFormat defines model for ResultFormat.
const ( ResultFormatTable ResultFormat = "table" ResultFormatTimeSeries ResultFormat = "time_series" ResultFormatTrace ResultFormat = "trace" )
Defines values for ResultFormat.
type SubscriptionsQuery ¶
type SubscriptionsQuery struct {
BaseGrafanaTemplateVariableQuery
Kind SubscriptionsQueryKind `json:"kind"`
RawQuery *string `json:"rawQuery,omitempty"`
}
SubscriptionsQuery defines model for SubscriptionsQuery.
type SubscriptionsQueryKind ¶
type SubscriptionsQueryKind string
SubscriptionsQueryKind defines model for SubscriptionsQuery.Kind.
const (
SubscriptionsQueryKindSubscriptionsQuery SubscriptionsQueryKind = "SubscriptionsQuery"
)
Defines values for SubscriptionsQueryKind.
type UnknownQuery ¶
type UnknownQuery struct {
BaseGrafanaTemplateVariableQuery
Kind UnknownQueryKind `json:"kind"`
RawQuery *string `json:"rawQuery,omitempty"`
}
UnknownQuery defines model for UnknownQuery.
type UnknownQueryKind ¶
type UnknownQueryKind string
UnknownQueryKind defines model for UnknownQuery.Kind.
const (
UnknownQueryKindUnknownQuery UnknownQueryKind = "UnknownQuery"
)
Defines values for UnknownQueryKind.
type WorkspacesQuery ¶
type WorkspacesQuery struct {
BaseGrafanaTemplateVariableQuery
Kind WorkspacesQueryKind `json:"kind"`
RawQuery *string `json:"rawQuery,omitempty"`
Subscription string `json:"subscription"`
}
WorkspacesQuery defines model for WorkspacesQuery.
type WorkspacesQueryKind ¶
type WorkspacesQueryKind string
WorkspacesQueryKind defines model for WorkspacesQuery.Kind.
const (
WorkspacesQueryKindWorkspacesQuery WorkspacesQueryKind = "WorkspacesQuery"
)
Defines values for WorkspacesQueryKind.