deprecated

package
v0.0.85-test Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	AppInsights       = "Application Insights"
	InsightsAnalytics = "Insights Analytics"
)

Azure cloud query types

Variables

View Source
var AzAppInsights = types.AzRoute{
	URL:     "https://api.applicationinsights.io",
	Scopes:  []string{},
	Headers: map[string]string{"x-ms-app": "Grafana"},
}
View Source
var AzChinaAppInsights = types.AzRoute{
	URL:     "https://api.applicationinsights.azure.cn",
	Scopes:  []string{},
	Headers: map[string]string{"x-ms-app": "Grafana"},
}

Functions

func GetAppInsightsMiddleware

func GetAppInsightsMiddleware(url, appInsightsApiKey string) httpclient.Middleware

func InsightsMetricsResultToFrame

func InsightsMetricsResultToFrame(mr MetricsResult, metric, agg string, dimensions []string) (*data.Frame, error)

InsightsMetricsResultToFrame converts a MetricsResult (an Application Insights metrics query response) to a dataframe. Due to the dynamic nature of the MetricsResult object, the name of the metric, aggregation, and requested dimensions are used to determine the expected shape of the object. This builds all series into a single data.Frame with one time index (a wide formatted time series frame).

Types

type ApplicationInsightsDatasource

type ApplicationInsightsDatasource struct {
	Proxy types.ServiceProxy
}

ApplicationInsightsDatasource calls the application insights query API.

func (*ApplicationInsightsDatasource) ExecuteTimeSeriesQuery

func (e *ApplicationInsightsDatasource) ExecuteTimeSeriesQuery(ctx context.Context,
	originalQueries []backend.DataQuery, dsInfo types.DatasourceInfo, client *http.Client,
	url string, tracer tracing.Tracer) (*backend.QueryDataResponse, error)

func (*ApplicationInsightsDatasource) ResourceRequest

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

type ApplicationInsightsQuery

type ApplicationInsightsQuery struct {
	RefID     string
	TimeRange backend.TimeRange

	// Text based raw query options.
	ApiURL string
	Params url.Values
	Alias  string
	Target string
	// contains filtered or unexported fields
}

ApplicationInsightsQuery is the model that holds the information needed to make a metrics query to Application Insights, and the information used to parse the response.

type InsightsAnalyticsDatasource

type InsightsAnalyticsDatasource struct {
	Proxy types.ServiceProxy
}

func (*InsightsAnalyticsDatasource) ExecuteTimeSeriesQuery

func (e *InsightsAnalyticsDatasource) ExecuteTimeSeriesQuery(ctx context.Context,
	originalQueries []backend.DataQuery, dsInfo types.DatasourceInfo, client *http.Client,
	url string, tracer tracing.Tracer) (*backend.QueryDataResponse, error)

func (*InsightsAnalyticsDatasource) ResourceRequest

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

type InsightsAnalyticsQuery

type InsightsAnalyticsQuery struct {
	RefID string

	RawQuery          string
	InterpolatedQuery string

	ResultFormat string

	Params url.Values
	Target string
}

type InsightsDimensions

type InsightsDimensions []string

InsightsDimensions will unmarshal from a JSON string, or an array of strings, into a string array. This exists to support an older query format which is updated when a user saves the query or it is sent from the front end, but may not be when alerting fetches the model.

func (*InsightsDimensions) UnmarshalJSON

func (s *InsightsDimensions) UnmarshalJSON(data []byte) error

UnmarshalJSON fulfills the json.Unmarshaler interface type.

type MetricsResult

type MetricsResult struct {
	Value *MetricsResultInfo `json:"value,omitempty"`
}

MetricsResult a metric result. This is copied from azure-sdk-for-go/services/preview/appinsights/v1/insights.

type MetricsResultInfo

type MetricsResultInfo struct {
	// AdditionalProperties - Unmatched properties from the message are deserialized this collection
	AdditionalProperties map[string]interface{} `json:""`
	// Start - Start time of the metric.
	Start time.Time `json:"start,omitempty"`
	// End - Start time of the metric.
	End time.Time `json:"end,omitempty"`
	// Interval - The interval used to segment the metric data.
	Interval *string `json:"interval,omitempty"`
	// Segments - Segmented metric data (if segmented).
	Segments *[]MetricsSegmentInfo `json:"segments,omitempty"`
}

MetricsResultInfo a metric result data. This is copied from azure-sdk-for-go/services/preview/appinsights/v1/insights (except time Type is changed).

func (*MetricsResultInfo) UnmarshalJSON

func (mri *MetricsResultInfo) UnmarshalJSON(body []byte) error

UnmarshalJSON is the custom unmarshaler for MetricsResultInfo struct. This is copied from azure-sdk-for-go/services/preview/appinsights/v1/insights (except time Type is changed).

type MetricsSegmentInfo

type MetricsSegmentInfo struct {
	// AdditionalProperties - Unmatched properties from the message are deserialized this collection
	AdditionalProperties map[string]interface{} `json:""`
	// Start - Start time of the metric segment (only when an interval was specified).
	Start time.Time `json:"start,omitempty"`
	// End - Start time of the metric segment (only when an interval was specified).
	End time.Time `json:"end,omitempty"`
	// Segments - Segmented metric data (if further segmented).
	Segments *[]MetricsSegmentInfo `json:"segments,omitempty"`
}

MetricsSegmentInfo is a metric segment. This is copied from azure-sdk-for-go/services/preview/appinsights/v1/insights (except time Type is changed).

func (*MetricsSegmentInfo) UnmarshalJSON

func (mri *MetricsSegmentInfo) UnmarshalJSON(body []byte) error

UnmarshalJSON is the custom unmarshaler for MetricsSegmentInfo struct. This is copied from azure-sdk-for-go/services/preview/appinsights/v1/insights (except time Type is changed).

Jump to

Keyboard shortcuts

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