azuremonitor

package
v6.1.0-beta1-empolis+i... Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2019 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAzureMonitorExecutor

func NewAzureMonitorExecutor(dsInfo *models.DataSource) (tsdb.TsdbQueryEndpoint, error)

NewAzureMonitorExecutor initializes a http client

Types

type ApplicationInsightsResponse

type ApplicationInsightsResponse struct {
	Tables []struct {
		TableName string `json:"TableName"`
		Columns   []struct {
			ColumnName string `json:"ColumnName"`
			DataType   string `json:"DataType"`
			ColumnType string `json:"ColumnType"`
		} `json:"Columns"`
		Rows [][]interface{} `json:"Rows"`
	} `json:"Tables"`
}

ApplicationInsightsResponse is the json response from the Application Insights API

type AzureLogAnalyticsResponse

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

AzureLogAnalyticsResponse is the json response object from the Azure Log Analytics API.

type AzureMonitorDatasource

type AzureMonitorDatasource struct {
	// contains filtered or unexported fields
}

AzureMonitorDatasource calls the Azure Monitor API - one of the four API's supported

type AzureMonitorExecutor

type AzureMonitorExecutor struct {
	// contains filtered or unexported fields
}

AzureMonitorExecutor executes queries for the Azure Monitor datasource - all four services

func (*AzureMonitorExecutor) Query

func (e *AzureMonitorExecutor) Query(ctx context.Context, dsInfo *models.DataSource, tsdbQuery *tsdb.TsdbQuery) (*tsdb.Response, error)

Query takes in the frontend queries, parses them into the query format expected by chosen Azure Monitor service (Azure Monitor, App Insights etc.) executes the queries against the API and parses the response into the right format

type AzureMonitorQuery

type AzureMonitorQuery struct {
	URL           string
	UrlComponents map[string]string
	Target        string
	Params        url.Values
	RefID         string
	Alias         string
}

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

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 TimeGrain

type TimeGrain struct{}

TimeGrain handles convertions between the ISO 8601 Duration format (PT1H), Kbn units (1h) and Time Grains (1 hour) Also handles using the automatic Grafana interval to calculate a ISO 8601 Duration.

Jump to

Keyboard shortcuts

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