Documentation
¶
Index ¶
- Constants
- Variables
- func AddConfigLinks(frame data.Frame, dl string, title *string) data.Frame
- func AddCustomDataLink(frame data.Frame, dataLink data.DataLink, singleField bool) data.Frame
- func ConvertTime(timeStamp string) (time.Time, error)
- func GetDataVolumeRawQuery(table string) string
- func ParseResultFormat(queryResultFormat *dataquery.ResultFormat, queryType dataquery.AzureQueryType) dataquery.ResultFormat
- func ResponseTableToFrame(table *types.AzureResponseTable, refID string, executedQuery string, ...) (*data.Frame, error)
- type AzureCorrelationAPIResponse
- type AzureCorrelationAPIResponseProperties
- type AzureLogAnalyticsAPIError
- type AzureLogAnalyticsAPIErrorBase
- type AzureLogAnalyticsDatasource
- func (e *AzureLogAnalyticsDatasource) ExecuteTimeSeriesQuery(ctx context.Context, originalQueries []backend.DataQuery, ...) (*backend.QueryDataResponse, error)
- func (e *AzureLogAnalyticsDatasource) GetBasicLogsUsage(ctx context.Context, url string, client *http.Client, rw http.ResponseWriter, ...) (http.ResponseWriter, error)
- func (e *AzureLogAnalyticsDatasource) ResourceRequest(rw http.ResponseWriter, req *http.Request, cli *http.Client) (http.ResponseWriter, error)
- type AzureLogAnalyticsInnerError
- type AzureLogAnalyticsQuery
- type AzureLogAnalyticsResponse
- type AzureLogAnalyticsURLResource
- type AzureLogAnalyticsURLResources
- type BasicLogsUsagePayload
- type KeyValue
- type LogAnalyticsMeta
- type TraceQueries
Constants ¶
const MultiField bool = false
const SingleField bool = true
Variables ¶
var AttributesOmit = map[string]string{"operationId": "operationId", "duration": "duration", "id": "id", "name": "name", "problemId": "problemId", "operation_ParentId": "operation_ParentId", "timestamp": "timestamp", "customDimensions": "customDimensions", "operation_Name": "operation_Name"}
AttributesOmit - Properties to omit when generating the attributes bag
var AvailabilityResultsSchema = copyCommonProperties(map[string]string{
"location": "Location",
"message": "Message",
"size": "Size",
}, emptyMap)
var CommonProperties = map[string]string{
"appId": "ResourceGUID",
"application_Version": "AppVersion",
"appName": "_ResourceId",
"client_Browser": "ClientBrowser",
"client_City": "ClientCity",
"client_CountryOrRegion": "ClientCountryOrRegion",
"client_IP": "ClientIP",
"client_Model": "ClientModel",
"client_OS": "ClientOS",
"client_StateOrProvince": "ClientStateOrProvince",
"client_Type": "ClientType",
"cloud_RoleInstance": "AppRoleInstance",
"cloud_RoleName": "AppRoleName",
"customDimensions": "Properties",
"customMeasurements": "Measurements",
"duration": "DurationMs",
"id": "Id",
"iKey": "IKey",
"itemCount": "ItemCount",
"itemId": "_ItemId",
"itemType": "Type",
"name": "Name",
"operation_Id": "OperationId",
"operation_Name": "OperationName",
"operation_ParentId": "OperationParentId",
"operation_SyntheticSource": "OperationSyntheticSource",
"performanceBucket": "PerformanceBucket",
"sdkVersion": "SDKVersion",
"session_Id": "SessionId",
"success": "Success",
"timestamp": "TimeGenerated",
"user_AccountId": "UserAccountId",
"user_AuthenticatedId": "UserAuthenticatedId",
"user_Id": "UserId",
}
CommonProperties - common resource centric properties mapped to legacy property names
var DependenciesSchema = copyCommonProperties(map[string]string{
"data": "Data",
"resultCode": "ResultCode",
"target": "Target",
"type": "DependencyType",
}, emptyMap)
var EventsSchema = copyCommonProperties(map[string]string{}, map[string]string{"duration": "duration", "id": "id", "success": "success", "performanceBucket": "performanceBucket"})
var ExceptionsSchema = copyCommonProperties(map[string]string{ "assembly": "Assembly", "details": "Details", "handledAt": "HandledAt", "innermostAssembly": "InnermostAssembly", "innermostMessage": "InnermostMessage", "innermostMethod": "InnermostMethod", "innermostType": "InnermostType", "message": "Message", "method": "Method", "outerAssembly": "OuterAssembly", "outerMessage": "OuterMessage", "outerMethod": "OuterMethod", "outerType": "OuterType", "problemId": "ProblemId", "severityLevel": "SeverityLevel", "type": "ExceptionType", "error": "error", }, map[string]string{"duration": "duration", "id": "id", "name": "name", "performanceBucket": "performanceBucket", "success": "success"})
var MaxHoursBasicLogs = 192 // 8 days in hours
var PageViewsSchema = copyCommonProperties(map[string]string{"url": "Url"}, map[string]string{"success": "success"})
var RequestsSchema = copyCommonProperties(map[string]string{"resultCode": "ResultCode", "source": "Source", "url": "Url"}, map[string]string{})
var Tables = []string{"availabilityResults", "dependencies", "customEvents", "exceptions", "pageViews", "requests", "traces"}
var TablesSchema = map[string]map[string]string{ "availabilityResults": AvailabilityResultsSchema, "dependencies": DependenciesSchema, "customEvents": EventsSchema, "exceptions": ExceptionsSchema, "pageViews": PageViewsSchema, "requests": RequestsSchema, "traces": TracesSchema, }
var TracesSchema = copyCommonProperties(map[string]string{ "message": "Message", "severityLevel": "SeverityLevel", }, map[string]string{"duration": "duration", "id": "id", "name": "name", "performanceBucket": "performanceBucket", "success": "success"})
Functions ¶
func AddCustomDataLink ¶
func GetDataVolumeRawQuery ¶
func ParseResultFormat ¶
func ParseResultFormat(queryResultFormat *dataquery.ResultFormat, queryType dataquery.AzureQueryType) dataquery.ResultFormat
This function should be part of migration function
func ResponseTableToFrame ¶
func ResponseTableToFrame(table *types.AzureResponseTable, refID string, executedQuery string, queryType dataquery.AzureQueryType, resultFormat dataquery.ResultFormat, logLimitDisabled bool) (*data.Frame, error)
ResponseTableToFrame converts an AzureResponseTable to a data.Frame.
Types ¶
type AzureCorrelationAPIResponse ¶
type AzureCorrelationAPIResponse struct {
ID string `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
Properties AzureCorrelationAPIResponseProperties `json:"properties"`
Error *AzureLogAnalyticsAPIError `json:"error,omitempty"`
}
type AzureLogAnalyticsAPIError ¶
type AzureLogAnalyticsAPIError struct {
Details *[]AzureLogAnalyticsAPIErrorBase `json:"details,omitempty"`
Code *string `json:"code,omitempty"`
Message *string `json:"message,omitempty"`
}
Error definition has been inferred from real data and other model definitions like https://github.com/Azure/azure-sdk-for-go/blob/3640559afddbad452d265b54fb1c20b30be0b062/services/preview/virtualmachineimagebuilder/mgmt/2019-05-01-preview/virtualmachineimagebuilder/models.go
type AzureLogAnalyticsAPIErrorBase ¶
type AzureLogAnalyticsAPIErrorBase struct {
Code *string `json:"code,omitempty"`
Message *string `json:"message,omitempty"`
Innererror *AzureLogAnalyticsInnerError `json:"innererror,omitempty"`
}
type AzureLogAnalyticsDatasource ¶
type AzureLogAnalyticsDatasource struct {
Proxy types.ServiceProxy
Logger log.Logger
}
AzureLogAnalyticsDatasource calls the Azure Log Analytics API's
func (*AzureLogAnalyticsDatasource) ExecuteTimeSeriesQuery ¶
func (e *AzureLogAnalyticsDatasource) ExecuteTimeSeriesQuery(ctx context.Context, originalQueries []backend.DataQuery, dsInfo types.DatasourceInfo, client *http.Client, url string, fromAlert bool) (*backend.QueryDataResponse, error)
executeTimeSeriesQuery does the following: 1. build the AzureMonitor url and querystring for each query 2. executes each query by calling the Azure Monitor API 3. parses the responses for each query into data frames
func (*AzureLogAnalyticsDatasource) GetBasicLogsUsage ¶
func (e *AzureLogAnalyticsDatasource) GetBasicLogsUsage(ctx context.Context, url string, client *http.Client, rw http.ResponseWriter, reqBody io.ReadCloser) (http.ResponseWriter, error)
builds and executes a new query request that will get the data ingeted for the given table in the basic logs query
func (*AzureLogAnalyticsDatasource) ResourceRequest ¶
func (e *AzureLogAnalyticsDatasource) ResourceRequest(rw http.ResponseWriter, req *http.Request, cli *http.Client) (http.ResponseWriter, error)
type AzureLogAnalyticsQuery ¶
type AzureLogAnalyticsQuery struct {
RefID string
ResultFormat dataquery.ResultFormat
URL string
TraceExploreQuery string
TraceParentExploreQuery string
TraceLogsExploreQuery string
JSON json.RawMessage
TimeRange backend.TimeRange
Query string
Resources []string
QueryType dataquery.AzureQueryType
AppInsightsQuery bool
DashboardTime bool
TimeColumn string
BasicLogs bool
}
AzureLogAnalyticsQuery is the query request that is built from the saved values for from the UI
type AzureLogAnalyticsResponse ¶
type AzureLogAnalyticsResponse struct {
Tables []types.AzureResponseTable `json:"tables"`
Error *AzureLogAnalyticsAPIError `json:"error,omitempty"`
}
AzureLogAnalyticsResponse is the json response object from the Azure Log Analytics API.
func (*AzureLogAnalyticsResponse) GetPrimaryResultTable ¶
func (ar *AzureLogAnalyticsResponse) GetPrimaryResultTable() (*types.AzureResponseTable, error)
GetPrimaryResultTable returns the first table in the response named "PrimaryResult", or an error if there is no table by that name.
type AzureLogAnalyticsURLResource ¶
type AzureLogAnalyticsURLResource struct {
ResourceID string `json:"resourceId"`
}
type AzureLogAnalyticsURLResources ¶
type AzureLogAnalyticsURLResources struct {
Resources []AzureLogAnalyticsURLResource `json:"resources"`
}
type BasicLogsUsagePayload ¶
type BasicLogsUsagePayload struct {
Table string `json:"table"`
Resource string `json:"resource"`
QueryType string `json:"queryType"`
From string `json:"from"`
To string `json:"to"`
}
BasicLogsUsagePayload is the payload that the frontend resourcerequest will send to the backend to calculate the basic logs query usage
type LogAnalyticsMeta ¶
type LogAnalyticsMeta struct {
ColumnTypes []string `json:"azureColumnTypes"`
AzurePortalLink string `json:"azurePortalLink,omitempty"`
}
LogAnalyticsMeta is a type for the a Frame's Meta's Custom property.