Documentation ¶
Index ¶
- Constants
- Variables
- type AccountsProvider
- type CloudWatchLogsAPIProvider
- type CloudWatchMetricsAPIProvider
- type CloudWatchQuery
- func (q *CloudWatchQuery) BuildDeepLink(startTime time.Time, endTime time.Time) (string, error)
- func (q *CloudWatchQuery) GetGetMetricDataAPIMode() GMDApiMode
- func (q *CloudWatchQuery) IsInferredSearchExpression() bool
- func (q *CloudWatchQuery) IsMathExpression() bool
- func (q *CloudWatchQuery) IsMultiValuedDimensionExpression() bool
- func (q *CloudWatchQuery) IsUserDefinedSearchExpression() bool
- type CloudWatchSettings
- type EC2APIProvider
- type GMDApiMode
- type HttpError
- type ListMetricsProvider
- type LogGroupsProvider
- type LogsQuery
- type MetricEditorMode
- type MetricQueryType
- type MetricsClientProvider
- type OAMAPIProvider
- type QueryError
- type QueryRowResponse
- type RequestContext
- type RequestContextFactoryFunc
- type RouteHandlerFunc
Constants ¶
View Source
const ( MetricEditorModeBuilder = dataquery.MetricEditorModeN0 MetricEditorModeRaw = dataquery.MetricEditorModeN1 )
View Source
const ( MetricQueryTypeSearch = dataquery.MetricQueryTypeN0 MetricQueryTypeQuery = dataquery.MetricQueryTypeN1 )
View Source
const ( MaxMetricsExceeded = "MaxMetricsExceeded" MaxQueryTimeRangeExceeded = "MaxQueryTimeRangeExceeded" MaxQueryResultsExceeded = "MaxQueryResultsExceeded" MaxMatchingResultsExceeded = "MaxMatchingResultsExceeded" )
Variables ¶
View Source
var ErrorMessages = map[string]string{ MaxMetricsExceeded: "Maximum number of allowed metrics exceeded. Your search may have been limited", MaxQueryTimeRangeExceeded: "Max time window exceeded for query", MaxQueryResultsExceeded: "Only the first 500 time series can be returned by a query.", MaxMatchingResultsExceeded: "The query matched more than 10.000 metrics, results might not be accurate.", }
Functions ¶
This section is empty.
Types ¶
type AccountsProvider ¶
type AccountsProvider interface {
GetAccountsForCurrentUserOrRole() ([]resources.ResourceResponse[resources.Account], error)
}
type CloudWatchLogsAPIProvider ¶
type CloudWatchLogsAPIProvider interface { DescribeLogGroups(*cloudwatchlogs.DescribeLogGroupsInput) (*cloudwatchlogs.DescribeLogGroupsOutput, error) GetLogGroupFields(*cloudwatchlogs.GetLogGroupFieldsInput) (*cloudwatchlogs.GetLogGroupFieldsOutput, error) }
type CloudWatchMetricsAPIProvider ¶
type CloudWatchMetricsAPIProvider interface {
ListMetricsPages(*cloudwatch.ListMetricsInput, func(*cloudwatch.ListMetricsOutput, bool) bool) error
}
APIs - instead of using the API defined in the services within the aws-sdk-go directly, specify a subset of the API with methods that are actually used in a service or a client
type CloudWatchQuery ¶
type CloudWatchQuery struct { RefId string Region string Id string Namespace string MetricName string Statistic string Expression string SqlExpression string ReturnData bool Dimensions map[string][]string Period int Label string MatchExact bool UsedExpression string TimezoneUTCOffset string MetricQueryType dataquery.MetricQueryType MetricEditorMode dataquery.MetricEditorMode AccountId *string // contains filtered or unexported fields }
func ParseMetricDataQueries ¶
func ParseMetricDataQueries(dataQueries []backend.DataQuery, startTime time.Time, endTime time.Time, defaultRegion string, logger log.Logger, crossAccountQueryingEnabled bool) ([]*CloudWatchQuery, error)
ParseMetricDataQueries decodes the metric data queries json, validates, sets default values and returns an array of CloudWatchQueries. The CloudWatchQuery has a 1 to 1 mapping to a query editor row
func (*CloudWatchQuery) BuildDeepLink ¶
func (*CloudWatchQuery) GetGetMetricDataAPIMode ¶
func (q *CloudWatchQuery) GetGetMetricDataAPIMode() GMDApiMode
func (*CloudWatchQuery) IsInferredSearchExpression ¶
func (q *CloudWatchQuery) IsInferredSearchExpression() bool
func (*CloudWatchQuery) IsMathExpression ¶
func (q *CloudWatchQuery) IsMathExpression() bool
func (*CloudWatchQuery) IsMultiValuedDimensionExpression ¶
func (q *CloudWatchQuery) IsMultiValuedDimensionExpression() bool
func (*CloudWatchQuery) IsUserDefinedSearchExpression ¶
func (q *CloudWatchQuery) IsUserDefinedSearchExpression() bool
type CloudWatchSettings ¶
type CloudWatchSettings struct { awsds.AWSDatasourceSettings Namespace string `json:"customMetricsNamespaces"` SecureSocksProxyEnabled bool `json:"enableSecureSocksProxy"` // this can be removed when https://github.com/grafana/grafana/issues/39089 is implemented }
func LoadCloudWatchSettings ¶
func LoadCloudWatchSettings(config backend.DataSourceInstanceSettings) (CloudWatchSettings, error)
type EC2APIProvider ¶
type EC2APIProvider interface { DescribeRegions(in *ec2.DescribeRegionsInput) (*ec2.DescribeRegionsOutput, error) DescribeInstancesPages(in *ec2.DescribeInstancesInput, fn func(*ec2.DescribeInstancesOutput, bool) bool) error }
type GMDApiMode ¶
type GMDApiMode uint32
const ( GMDApiModeMetricStat GMDApiMode = iota GMDApiModeInferredSearchExpression GMDApiModeMathExpression GMDApiModeSQLExpression )
type ListMetricsProvider ¶
type ListMetricsProvider interface { GetDimensionKeysByDimensionFilter(resources.DimensionKeysRequest) ([]resources.ResourceResponse[string], error) GetDimensionValuesByDimensionFilter(resources.DimensionValuesRequest) ([]resources.ResourceResponse[string], error) GetMetricsByNamespace(r resources.MetricsRequest) ([]resources.ResourceResponse[resources.Metric], error) }
Services
type LogGroupsProvider ¶
type LogGroupsProvider interface { GetLogGroups(request resources.LogGroupsRequest) ([]resources.ResourceResponse[resources.LogGroup], error) GetLogGroupFields(request resources.LogGroupFieldsRequest) ([]resources.ResourceResponse[resources.LogGroupField], error) }
type MetricEditorMode ¶
type MetricEditorMode dataquery.MetricEditorMode
type MetricQueryType ¶
type MetricQueryType dataquery.MetricQueryType
type MetricsClientProvider ¶
type MetricsClientProvider interface {
ListMetricsWithPageLimit(params *cloudwatch.ListMetricsInput) ([]resources.MetricResponse, error)
}
Clients
type OAMAPIProvider ¶
type OAMAPIProvider interface { ListSinks(*oam.ListSinksInput) (*oam.ListSinksOutput, error) ListAttachedLinks(*oam.ListAttachedLinksInput) (*oam.ListAttachedLinksOutput, error) }
type QueryError ¶
func (*QueryError) Error ¶
func (e *QueryError) Error() string
type QueryRowResponse ¶
type QueryRowResponse struct { ErrorCodes map[string]bool HasArithmeticError bool ArithmeticErrorMessage string Metrics []*cloudwatch.MetricDataResult StatusCode string // contains filtered or unexported fields }
queryRowResponse represents the GetMetricData response for a query row in the query editor.
func NewQueryRowResponse ¶
func NewQueryRowResponse(errors map[string]bool) QueryRowResponse
func (*QueryRowResponse) AddArithmeticError ¶
func (q *QueryRowResponse) AddArithmeticError(message *string)
func (*QueryRowResponse) AddMetricDataResult ¶
func (q *QueryRowResponse) AddMetricDataResult(mdr *cloudwatch.MetricDataResult)
type RequestContext ¶
type RequestContext struct { MetricsClientProvider MetricsClientProvider LogsAPIProvider CloudWatchLogsAPIProvider OAMAPIProvider OAMAPIProvider Settings CloudWatchSettings Features featuremgmt.FeatureToggles }
type RequestContextFactoryFunc ¶
type RequestContextFactoryFunc func(ctx context.Context, pluginCtx backend.PluginContext, region string) (reqCtx RequestContext, err error)
type RouteHandlerFunc ¶
type RouteHandlerFunc func(ctx context.Context, pluginCtx backend.PluginContext, reqContextFactory RequestContextFactoryFunc, parameters url.Values) ([]byte, *HttpError)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.