loganalytics

package
v0.0.0-...-fb7f86c Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: AGPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

View Source
var AvailabilityResultsSchema = copyCommonProperties(map[string]string{
	"location": "Location",
	"message":  "Message",
	"size":     "Size",
}, emptyMap)
View Source
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

View Source
var DependenciesSchema = copyCommonProperties(map[string]string{
	"data":       "Data",
	"resultCode": "ResultCode",
	"target":     "Target",
	"type":       "DependencyType",
}, emptyMap)
View Source
var EventsSchema = copyCommonProperties(map[string]string{}, map[string]string{"duration": "duration", "id": "id", "success": "success", "performanceBucket": "performanceBucket"})
View Source
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"})
View Source
var PageViewsSchema = copyCommonProperties(map[string]string{"url": "Url"}, map[string]string{"success": "success"})
View Source
var RequestsSchema = copyCommonProperties(map[string]string{"resultCode": "ResultCode",
	"source": "Source",
	"url":    "Url"}, map[string]string{})
View Source
var Tables = []string{"availabilityResults", "dependencies", "customEvents", "exceptions", "pageViews", "requests", "traces"}
View Source
var TablesSchema = map[string]map[string]string{
	"availabilityResults": AvailabilityResultsSchema,
	"dependencies":        DependenciesSchema,
	"customEvents":        EventsSchema,
	"exceptions":          ExceptionsSchema,
	"pageViews":           PageViewsSchema,
	"requests":            RequestsSchema,
	"traces":              TracesSchema,
}
View Source
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 AddConfigLinks(frame data.Frame, dl string, title *string) data.Frame
func AddCustomDataLink(frame data.Frame, dataLink data.DataLink) data.Frame

func GetAzurePortalUrl

func GetAzurePortalUrl(azureCloud string) (string, error)

func ResponseTableToFrame

func ResponseTableToFrame(table *types.AzureResponseTable, refID string, executedQuery string, queryType dataquery.AzureQueryType, resultFormat dataquery.ResultFormat) (*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 AzureCorrelationAPIResponseProperties

type AzureCorrelationAPIResponseProperties struct {
	Resources []string `json:"resources"`
	NextLink  *string  `json:"nextLink,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
}

AzureLogAnalyticsDatasource calls the Azure Log Analytics API's

func (*AzureLogAnalyticsDatasource) ExecuteTimeSeriesQuery

func (e *AzureLogAnalyticsDatasource) ExecuteTimeSeriesQuery(ctx context.Context, logger log.Logger, originalQueries []backend.DataQuery, dsInfo types.DatasourceInfo, client *http.Client, url string, tracer tracing.Tracer) (*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) ResourceRequest

func (e *AzureLogAnalyticsDatasource) ResourceRequest(rw http.ResponseWriter, req *http.Request, cli *http.Client)

type AzureLogAnalyticsInnerError

type AzureLogAnalyticsInnerError struct {
	Code         *string `json:"code,omitempty"`
	Message      *string `json:"message,omitempty"`
	Severity     *int    `json:"severity,omitempty"`
	SeverityName *string `json:"severityName,omitempty"`
}

type AzureLogAnalyticsQuery

type AzureLogAnalyticsQuery struct {
	RefID                   string
	ResultFormat            string
	URL                     string
	TraceExploreQuery       string
	TraceParentExploreQuery string
	TraceLogsExploreQuery   string
	JSON                    json.RawMessage
	TimeRange               backend.TimeRange
	Query                   string
	Resources               []string
	QueryType               string
	AppInsightsQuery        bool
	IntersectTime           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 KeyValue

type KeyValue struct {
	Value interface{} `json:"value"`
	Key   string      `json:"key"`
}

type LogAnalyticsMeta

type LogAnalyticsMeta struct {
	ColumnTypes []string `json:"azureColumnTypes"`
}

LogAnalyticsMeta is a type for the a Frame's Meta's Custom property.

Jump to

Keyboard shortcuts

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