Documentation ¶
Index ¶
- Constants
- Variables
- func GetAppInsightsMiddleware(url, appInsightsApiKey string) httpclient.Middleware
- func InsightsMetricsResultToFrame(mr MetricsResult, metric, agg string, dimensions []string) (*data.Frame, error)
- type ApplicationInsightsDatasource
- type ApplicationInsightsQuery
- type InsightsAnalyticsDatasource
- type InsightsAnalyticsQuery
- type InsightsDimensions
- type MetricsResult
- type MetricsResultInfo
- type MetricsSegmentInfo
Constants ¶
const ( AppInsights = "Application Insights" InsightsAnalytics = "Insights Analytics" )
Azure cloud query types
Variables ¶
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 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).