types

package
v0.0.0-kmdagger1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 8, 2023 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TimeSeries = "time_series"
	Table      = "table"
	Trace      = "trace"
)

Variables

View Source
var ErrorAzureHealthCheck = errors.New("health check failed")
View Source
var (
	LegendKeyFormat = regexp.MustCompile(`\{\{\s*(.+?)\s*\}\}`)
)

Functions

This section is empty.

Types

type AzRoute

type AzRoute struct {
	URL     string
	Scopes  []string
	Headers map[string]string
}

type AzureClientSettings

type AzureClientSettings struct {
	AzureAuthType string
	CloudName     string
	TenantId      string
	ClientId      string
}

type AzureMonitorCustomizedCloudSettings

type AzureMonitorCustomizedCloudSettings struct {
	CustomizedRoutes map[string]AzRoute `json:"customizedRoutes"`
}

AzureMonitorCustomizedCloudSettings is the extended Azure Monitor settings for customized cloud

type AzureMonitorDimensionFilter

type AzureMonitorDimensionFilter struct {
	Dimension string   `json:"dimension"`
	Operator  string   `json:"operator"`
	Filters   []string `json:"filters,omitempty"`
	// Deprecated: To support multiselection, filters are passed in a slice now. Also migrated in frontend.
	Filter *string `json:"filter,omitempty"`
}

AzureMonitorDimensionFilter is the model for the frontend sent for azureMonitor metric queries like "BlobType", "eq", "*"

func (AzureMonitorDimensionFilter) ConstructFiltersString

func (a AzureMonitorDimensionFilter) ConstructFiltersString() string

type AzureMonitorDimensionFilterBackend

type AzureMonitorDimensionFilterBackend struct {
	Key      string   `json:"key"`
	Operator int      `json:"operator"`
	Values   []string `json:"values"`
}

type AzureMonitorJSONQuery

type AzureMonitorJSONQuery struct {
	AzureMonitor struct {
		ResourceURI string `json:"resourceUri"`
		// These are used to reconstruct a resource URI
		MetricNamespace string                 `json:"metricNamespace"`
		CustomNamespace string                 `json:"customNamespace"`
		MetricName      string                 `json:"metricName"`
		Region          string                 `json:"region"`
		Resources       []AzureMonitorResource `json:"resources"`

		Aggregation      string                        `json:"aggregation"`
		Alias            string                        `json:"alias"`
		DimensionFilters []AzureMonitorDimensionFilter `json:"dimensionFilters"` // new model
		TimeGrain        string                        `json:"timeGrain"`
		Top              string                        `json:"top"`

		AllowedTimeGrainsMs []int64 `json:"allowedTimeGrainsMs"`
		Dimension           string  `json:"dimension"`       // old model
		DimensionFilter     string  `json:"dimensionFilter"` // old model
		Format              string  `json:"format"`

		// Deprecated, MetricNamespace should be used instead
		MetricDefinition string `json:"metricDefinition"`
		// Deprecated: Use Resources with a single element instead
		AzureMonitorResource
	} `json:"azureMonitor"`
	Subscription string `json:"subscription"`
}

AzureMonitorJSONQuery is the frontend JSON query model for an Azure Monitor query.

type AzureMonitorQuery

type AzureMonitorQuery struct {
	URL          string
	Target       string
	Params       url.Values
	RefID        string
	Alias        string
	TimeRange    backend.TimeRange
	BodyFilter   string
	Dimensions   []AzureMonitorDimensionFilter
	Resources    map[string]AzureMonitorResource
	Subscription string
}

AzureMonitorQuery is the query for all the services as they have similar queries with a url, a querystring and an alias field

type AzureMonitorResource

type AzureMonitorResource struct {
	ResourceGroup string `json:"resourceGroup"`
	ResourceName  string `json:"resourceName"`
}

type AzureMonitorResponse

type AzureMonitorResponse struct {
	Cost     int    `json:"cost"`
	Timespan string `json:"timespan"`
	Interval string `json:"interval"`
	Value    []struct {
		ID   string `json:"id"`
		Type string `json:"type"`
		Name struct {
			Value          string `json:"value"`
			LocalizedValue string `json:"localizedValue"`
		} `json:"name"`
		Unit       string `json:"unit"`
		Timeseries []struct {
			Metadatavalues []struct {
				Name struct {
					Value          string `json:"value"`
					LocalizedValue string `json:"localizedValue"`
				} `json:"name"`
				Value string `json:"value"`
			} `json:"metadatavalues"`
			Data []struct {
				TimeStamp time.Time `json:"timeStamp"`
				Average   *float64  `json:"average,omitempty"`
				Total     *float64  `json:"total,omitempty"`
				Count     *float64  `json:"count,omitempty"`
				Maximum   *float64  `json:"maximum,omitempty"`
				Minimum   *float64  `json:"minimum,omitempty"`
			} `json:"data"`
		} `json:"timeseries"`
	} `json:"value"`
	Namespace      string `json:"namespace"`
	Resourceregion string `json:"resourceregion"`
}

AzureMonitorResponse is the json response from the Azure Monitor API

type AzureMonitorSettings

type AzureMonitorSettings struct {
	SubscriptionId               string `json:"subscriptionId"`
	LogAnalyticsDefaultWorkspace string `json:"logAnalyticsDefaultWorkspace"`
	AppInsightsAppId             string `json:"appInsightsAppId"`
}

type AzureResponseTable

type AzureResponseTable struct {
	Name    string `json:"name"`
	Columns []struct {
		Name string `json:"name"`
		Type string `json:"type"`
	} `json:"columns"`
	Rows [][]interface{} `json:"rows"`
}

AzureResponseTable is the table format for Azure responses

type AzureSettings

type AzureSettings struct {
	AzureMonitorSettings
	AzureClientSettings
}

type DatasourceInfo

type DatasourceInfo struct {
	Cloud       string
	Credentials azcredentials.AzureCredentials
	Settings    AzureMonitorSettings
	Routes      map[string]AzRoute
	Services    map[string]DatasourceService

	JSONData                map[string]interface{}
	DecryptedSecureJSONData map[string]string
	DatasourceID            int64
	OrgID                   int64

	DatasourceName string
	DatasourceUID  string
}

type DatasourceService

type DatasourceService struct {
	URL        string
	HTTPClient *http.Client
}

type LogAnalyticsWorkspaceFeatures

type LogAnalyticsWorkspaceFeatures struct {
	EnableLogAccessUsingOnlyResourcePermissions bool `json:"enableLogAccessUsingOnlyResourcePermissions"`
	Legacy                                      int  `json:"legacy"`
	SearchVersion                               int  `json:"searchVersion"`
}

type LogAnalyticsWorkspaceProperties

type LogAnalyticsWorkspaceProperties struct {
	CreatedDate string                        `json:"createdDate"`
	CustomerId  string                        `json:"customerId"`
	Features    LogAnalyticsWorkspaceFeatures `json:"features"`
}

type LogAnalyticsWorkspaceResponse

type LogAnalyticsWorkspaceResponse struct {
	Id                              string                          `json:"id"`
	Location                        string                          `json:"location"`
	Name                            string                          `json:"name"`
	Properties                      LogAnalyticsWorkspaceProperties `json:"properties"`
	ProvisioningState               string                          `json:"provisioningState"`
	PublicNetworkAccessForIngestion string                          `json:"publicNetworkAccessForIngestion"`
	PublicNetworkAccessForQuery     string                          `json:"publicNetworkAccessForQuery"`
	RetentionInDays                 int                             `json:"retentionInDays"`
}

type LogJSONQuery

type LogJSONQuery struct {
	AzureLogAnalytics struct {
		Query        string   `json:"query"`
		ResultFormat string   `json:"resultFormat"`
		Resources    []string `json:"resources"`
		OperationId  string   `json:"operationId"`

		// Deprecated: Queries should be migrated to use Resource instead
		Workspace string `json:"workspace"`
		// Deprecated: Use Resources instead
		Resource string `json:"resource"`
	} `json:"azureLogAnalytics"`
}

LogJSONQuery is the frontend JSON query model for an Azure Log Analytics query.

type MetricChartDefinition

type MetricChartDefinition struct {
	ResourceMetadata    map[string]string   `json:"resourceMetadata"`
	Name                string              `json:"name"`
	AggregationType     int                 `json:"aggregationType"`
	Namespace           string              `json:"namespace"`
	MetricVisualization MetricVisualization `json:"metricVisualization"`
}

MetricChartDefinition is the JSON model for a metrics chart definition

type MetricVisualization

type MetricVisualization struct {
	DisplayName         string `json:"displayName"`
	ResourceDisplayName string `json:"resourceDisplayName"`
}

MetricVisualization is the JSON model for the visualization field of a metricChartDefinition

type ServiceProxy

type ServiceProxy interface {
	Do(rw http.ResponseWriter, req *http.Request, cli *http.Client) http.ResponseWriter
}

type SubscriptionsResponse

type SubscriptionsResponse struct {
	ID             string `json:"id"`
	SubscriptionID string `json:"subscriptionId"`
	TenantID       string `json:"tenantId"`
	DisplayName    string `json:"displayName"`
}

type TracesFilters

type TracesFilters 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"`
}

type TracesJSONQuery

type TracesJSONQuery struct {
	AzureTraces struct {
		// Filters for property values.
		Filters []TracesFilters `json:"filters"`

		// Operation ID. Used only for Traces queries.
		OperationId *string `json:"operationId"`

		// KQL query to be executed.
		Query *string `json:"query"`

		// Array of resource URIs to be queried.
		Resources []string `json:"resources"`

		// Specifies the format results should be returned as.
		ResultFormat *string `json:"resultFormat"`

		// Types of events to filter by.
		TraceTypes []string `json:"traceTypes"`
	} `json:"azureTraces"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL