Documentation
¶
Overview ¶
Package amp emulates Amazon Managed Service for Prometheus: the control plane and the Prometheus remote-write and HTTP query data plane.
Index ¶
- type AnomalyDetector
- type ClusterResolver
- type ConfigInput
- type CreateWorkspaceInput
- type Destination
- type DetectorInput
- type Doc
- type Handler
- func (h *Handler) ChaosOperations() []string
- func (h *Handler) ChaosRegions() []string
- func (h *Handler) ChaosServiceName() string
- func (h *Handler) ExtractOperation(c *echo.Context) string
- func (h *Handler) ExtractResource(c *echo.Context) string
- func (h *Handler) GetSupportedOperations() []string
- func (h *Handler) Handler() echo.HandlerFunc
- func (h *Handler) MatchPriority() int
- func (h *Handler) Name() string
- func (h *Handler) Reset()
- func (h *Handler) Restore(ctx context.Context, data []byte) error
- func (h *Handler) RouteMatcher() service.Matcher
- func (h *Handler) Snapshot(ctx context.Context) []byte
- type IgnoreNear
- type InMemoryBackend
- func (b *InMemoryBackend) CreateAlertManagerDefinition(ctx context.Context, wsID, token string, data []byte) (wStatus, error)
- func (b *InMemoryBackend) CreateAnomalyDetector(ctx context.Context, in DetectorInput) (wDetector, error)
- func (b *InMemoryBackend) CreateLoggingConfiguration(ctx context.Context, wsID, token, logGroup string) (wStatus, error)
- func (b *InMemoryBackend) CreateQueryLoggingConfiguration(ctx context.Context, wsID, token string, dests []LoggingDestination) (wStatus, error)
- func (b *InMemoryBackend) CreateRuleGroupsNamespace(ctx context.Context, in NamespaceInput) (wNamespace, error)
- func (b *InMemoryBackend) CreateScraper(ctx context.Context, in ScraperInput) (wScraper, error)
- func (b *InMemoryBackend) CreateWorkspace(ctx context.Context, in CreateWorkspaceInput) (wWorkspace, error)
- func (b *InMemoryBackend) DeleteAlertManagerDefinition(ctx context.Context, wsID string) error
- func (b *InMemoryBackend) DeleteAnomalyDetector(ctx context.Context, wsID, id string) error
- func (b *InMemoryBackend) DeleteLoggingConfiguration(ctx context.Context, wsID string) error
- func (b *InMemoryBackend) DeleteQueryLoggingConfiguration(ctx context.Context, wsID string) error
- func (b *InMemoryBackend) DeleteResourcePolicy(ctx context.Context, wsID, revision string) error
- func (b *InMemoryBackend) DeleteRuleGroupsNamespace(ctx context.Context, wsID, name string) error
- func (b *InMemoryBackend) DeleteScraper(ctx context.Context, id string) (string, error)
- func (b *InMemoryBackend) DeleteScraperLoggingConfiguration(ctx context.Context, id string) error
- func (b *InMemoryBackend) DeleteWorkspace(ctx context.Context, id string) error
- func (b *InMemoryBackend) DescribeAlertManagerDefinition(ctx context.Context, wsID string) (wAlertManager, error)
- func (b *InMemoryBackend) DescribeAnomalyDetector(ctx context.Context, wsID, id string) (wDetector, error)
- func (b *InMemoryBackend) DescribeLoggingConfiguration(ctx context.Context, wsID string) (wLogging, error)
- func (b *InMemoryBackend) DescribeQueryLoggingConfiguration(ctx context.Context, wsID string) (wQueryLogging, error)
- func (b *InMemoryBackend) DescribeResourcePolicy(ctx context.Context, wsID string) (PolicyResult, error)
- func (b *InMemoryBackend) DescribeRuleGroupsNamespace(ctx context.Context, wsID, name string) (wNamespace, error)
- func (b *InMemoryBackend) DescribeScraper(ctx context.Context, id string) (wScraper, error)
- func (b *InMemoryBackend) DescribeScraperLoggingConfiguration(ctx context.Context, id string) (wScraperLogging, error)
- func (b *InMemoryBackend) DescribeWorkspace(ctx context.Context, id string) (wWorkspace, error)
- func (b *InMemoryBackend) DescribeWorkspaceConfiguration(ctx context.Context, wsID string) (wWorkspaceConfig, error)
- func (b *InMemoryBackend) Ingest(ctx context.Context, wsID string, series []writeSeries) (IngestResult, error)
- func (b *InMemoryBackend) ListAnomalyDetectors(ctx context.Context, wsID, alias, token string, maxResults int) (page.Page[wDetector], error)
- func (b *InMemoryBackend) ListRuleGroupsNamespaces(ctx context.Context, wsID, prefix, token string, maxResults int) (page.Page[wNamespace], error)
- func (b *InMemoryBackend) ListScrapers(ctx context.Context, filters map[string][]string, token string, maxResults int) (page.Page[wScraper], error)
- func (b *InMemoryBackend) ListTagsForResource(ctx context.Context, resourceARN string) (map[string]string, error)
- func (b *InMemoryBackend) ListWorkspaces(ctx context.Context, alias, token string, maxResults int) (page.Page[wWorkspace], error)
- func (b *InMemoryBackend) PutAlertManagerDefinition(ctx context.Context, wsID string, data []byte) (wStatus, error)
- func (b *InMemoryBackend) PutAnomalyDetector(ctx context.Context, in DetectorInput) (wDetector, error)
- func (b *InMemoryBackend) PutResourcePolicy(ctx context.Context, wsID, doc, revision string) (PolicyResult, error)
- func (b *InMemoryBackend) PutRuleGroupsNamespace(ctx context.Context, in NamespaceInput) (wNamespace, error)
- func (b *InMemoryBackend) Region() string
- func (b *InMemoryBackend) Reset()
- func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
- func (b *InMemoryBackend) SeriesLabels(ctx context.Context, wsID string, selectors [][]*promql.Matcher, ...) ([]promql.Labels, error)
- func (b *InMemoryBackend) SetClusterResolver(r ClusterResolver)
- func (b *InMemoryBackend) SetLifecycleDelay(d time.Duration)
- func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
- func (b *InMemoryBackend) TagResource(ctx context.Context, resourceARN string, add map[string]string) error
- func (b *InMemoryBackend) UntagResource(ctx context.Context, resourceARN string, keys []string) error
- func (b *InMemoryBackend) UpdateLoggingConfiguration(ctx context.Context, wsID, logGroup string) (wStatus, error)
- func (b *InMemoryBackend) UpdateQueryLoggingConfiguration(ctx context.Context, wsID string, dests []LoggingDestination) (wStatus, error)
- func (b *InMemoryBackend) UpdateScraper(ctx context.Context, in ScraperInput) (wScraper, error)
- func (b *InMemoryBackend) UpdateScraperLoggingConfiguration(ctx context.Context, in ScraperLoggingInput) (wStatus, error)
- func (b *InMemoryBackend) UpdateWorkspaceAlias(ctx context.Context, id, alias string) error
- func (b *InMemoryBackend) UpdateWorkspaceConfiguration(ctx context.Context, wsID string, in ConfigInput) (wStatus, error)
- type IngestResult
- type LabelSetLimit
- type LoggingConfig
- type LoggingDestination
- type NamespaceInput
- type Pending
- type PolicyResult
- type Provider
- type QueryLoggingConfig
- type ResourcePolicy
- type RuleGroupsNamespace
- type Scraper
- type ScraperComponent
- type ScraperInput
- type ScraperLogging
- type ScraperLoggingInput
- type SeriesRecord
- type Source
- type Workspace
- type WorkspaceConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnomalyDetector ¶
type AnomalyDetector struct {
ModifiedAt time.Time `json:"modifiedAt"`
CreatedAt time.Time `json:"createdAt"`
IgnoreAbove *IgnoreNear `json:"ignoreAbove,omitempty"`
Tags map[string]string `json:"tags,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
IgnoreBelow *IgnoreNear `json:"ignoreBelow,omitempty"`
Pending Pending `json:"pending"`
ARN string `json:"arn"`
Alias string `json:"alias"`
Query string `json:"query"`
MissingDataAction string `json:"missingDataAction,omitempty"`
ID string `json:"id"`
WorkspaceID string `json:"workspaceId"`
EvaluationIntervalInSeconds int32 `json:"evaluationIntervalInSeconds"`
ShingleSize int32 `json:"shingleSize"`
SampleSize int32 `json:"sampleSize"`
}
AnomalyDetector is a Random Cut Forest anomaly detector.
type ClusterResolver ¶
ClusterResolver reports whether an EKS cluster exists, for scraper source validation.
type ConfigInput ¶
type ConfigInput struct {
RetentionPeriodInDays *int32
OutOfOrderTimeWindowInSeconds *int32
RuleQueryOffsetInSeconds *int32
LimitsPerLabelSet []LabelSetLimit
ReplaceLimits bool
}
ConfigInput holds UpdateWorkspaceConfiguration parameters; nil fields are unchanged.
type CreateWorkspaceInput ¶
type CreateWorkspaceInput struct {
Tags map[string]string
Alias string
ClientToken string
KMSKeyARN string
}
CreateWorkspaceInput holds CreateWorkspace parameters.
type Destination ¶
type Destination struct {
WorkspaceARN string `json:"workspaceArn,omitempty"`
DatasetARN string `json:"datasetArn,omitempty"`
}
Destination is where a scraper sends metrics; exactly one field is set.
type DetectorInput ¶
type DetectorInput struct {
Tags map[string]string
Labels map[string]string
IgnoreAbove *IgnoreNear
IgnoreBelow *IgnoreNear
EvalInterval *int32
ShingleSize *int32
SampleSize *int32
WorkspaceID string
ID string
Alias string
ClientToken string
Query string
MissingDataAction string
}
DetectorInput holds Create/PutAnomalyDetector parameters.
type Doc ¶
type Doc struct {
CreatedAt time.Time `json:"createdAt"`
ModifiedAt time.Time `json:"modifiedAt"`
Pending Pending `json:"pending"`
Data []byte `json:"data"`
}
Doc is a base64-on-the-wire YAML or JSON document with its lifecycle.
type Handler ¶
type Handler struct {
Backend *InMemoryBackend
// contains filtered or unexported fields
}
Handler serves the Amazon Managed Service for Prometheus REST-JSON API and Prometheus data plane.
func (*Handler) ChaosOperations ¶
ChaosOperations lists the fault-injectable operations.
func (*Handler) ChaosRegions ¶
ChaosRegions lists the regions this handler serves.
func (*Handler) ChaosServiceName ¶
ChaosServiceName returns the lowercase service name for fault rules.
func (*Handler) ExtractOperation ¶
ExtractOperation returns the operation name for metrics.
func (*Handler) ExtractResource ¶
ExtractResource returns the workspace, scraper or ARN label for metrics.
func (*Handler) GetSupportedOperations ¶
GetSupportedOperations lists the control-plane operations of the SDK client.
func (*Handler) Handler ¶
func (h *Handler) Handler() echo.HandlerFunc
Handler returns the Echo handler.
func (*Handler) MatchPriority ¶
MatchPriority returns the routing priority.
func (*Handler) RouteMatcher ¶
RouteMatcher matches signed "aps" requests (or the SDK user agent) with a known path shape. Unsigned requests only match the Prometheus data-plane paths.
type IgnoreNear ¶
type IgnoreNear struct {
Amount *float64 `json:"amount,omitempty"`
Ratio *float64 `json:"ratio,omitempty"`
}
IgnoreNear is an amount or ratio tolerance around the expected value.
type InMemoryBackend ¶
type InMemoryBackend struct {
// contains filtered or unexported fields
}
InMemoryBackend is the AMP state; one coarse lock guards every table.
func NewInMemoryBackend ¶
func NewInMemoryBackend(accountID, region string) *InMemoryBackend
NewInMemoryBackend creates an empty backend.
func (*InMemoryBackend) CreateAlertManagerDefinition ¶
func (b *InMemoryBackend) CreateAlertManagerDefinition( ctx context.Context, wsID, token string, data []byte, ) (wStatus, error)
CreateAlertManagerDefinition stores the workspace's alert manager configuration.
func (*InMemoryBackend) CreateAnomalyDetector ¶
func (b *InMemoryBackend) CreateAnomalyDetector(ctx context.Context, in DetectorInput) (wDetector, error)
CreateAnomalyDetector creates a detector in CREATING state.
func (*InMemoryBackend) CreateLoggingConfiguration ¶
func (b *InMemoryBackend) CreateLoggingConfiguration( ctx context.Context, wsID, token, logGroup string, ) (wStatus, error)
CreateLoggingConfiguration enables rules and alerting log delivery.
func (*InMemoryBackend) CreateQueryLoggingConfiguration ¶
func (b *InMemoryBackend) CreateQueryLoggingConfiguration( ctx context.Context, wsID, token string, dests []LoggingDestination, ) (wStatus, error)
CreateQueryLoggingConfiguration enables query log delivery.
func (*InMemoryBackend) CreateRuleGroupsNamespace ¶
func (b *InMemoryBackend) CreateRuleGroupsNamespace(ctx context.Context, in NamespaceInput) (wNamespace, error)
CreateRuleGroupsNamespace validates and stores a rules file.
func (*InMemoryBackend) CreateScraper ¶
func (b *InMemoryBackend) CreateScraper(ctx context.Context, in ScraperInput) (wScraper, error)
CreateScraper creates a collector in CREATING state.
func (*InMemoryBackend) CreateWorkspace ¶
func (b *InMemoryBackend) CreateWorkspace(ctx context.Context, in CreateWorkspaceInput) (wWorkspace, error)
CreateWorkspace creates a workspace in CREATING state.
func (*InMemoryBackend) DeleteAlertManagerDefinition ¶
func (b *InMemoryBackend) DeleteAlertManagerDefinition(ctx context.Context, wsID string) error
DeleteAlertManagerDefinition starts deletion of the alert manager configuration.
func (*InMemoryBackend) DeleteAnomalyDetector ¶
func (b *InMemoryBackend) DeleteAnomalyDetector(ctx context.Context, wsID, id string) error
DeleteAnomalyDetector starts detector deletion.
func (*InMemoryBackend) DeleteLoggingConfiguration ¶
func (b *InMemoryBackend) DeleteLoggingConfiguration(ctx context.Context, wsID string) error
DeleteLoggingConfiguration starts deletion of the logging configuration.
func (*InMemoryBackend) DeleteQueryLoggingConfiguration ¶
func (b *InMemoryBackend) DeleteQueryLoggingConfiguration(ctx context.Context, wsID string) error
DeleteQueryLoggingConfiguration starts deletion of the query logging configuration.
func (*InMemoryBackend) DeleteResourcePolicy ¶
func (b *InMemoryBackend) DeleteResourcePolicy(ctx context.Context, wsID, revision string) error
DeleteResourcePolicy starts deletion of the workspace resource policy.
func (*InMemoryBackend) DeleteRuleGroupsNamespace ¶
func (b *InMemoryBackend) DeleteRuleGroupsNamespace(ctx context.Context, wsID, name string) error
DeleteRuleGroupsNamespace starts namespace deletion.
func (*InMemoryBackend) DeleteScraper ¶
DeleteScraper starts scraper deletion.
func (*InMemoryBackend) DeleteScraperLoggingConfiguration ¶
func (b *InMemoryBackend) DeleteScraperLoggingConfiguration(ctx context.Context, id string) error
DeleteScraperLoggingConfiguration starts deletion of a scraper's log delivery.
func (*InMemoryBackend) DeleteWorkspace ¶
func (b *InMemoryBackend) DeleteWorkspace(ctx context.Context, id string) error
DeleteWorkspace starts workspace deletion; children and samples go with it.
func (*InMemoryBackend) DescribeAlertManagerDefinition ¶
func (b *InMemoryBackend) DescribeAlertManagerDefinition(ctx context.Context, wsID string) (wAlertManager, error)
DescribeAlertManagerDefinition returns the alert manager configuration.
func (*InMemoryBackend) DescribeAnomalyDetector ¶
func (b *InMemoryBackend) DescribeAnomalyDetector(ctx context.Context, wsID, id string) (wDetector, error)
DescribeAnomalyDetector returns a detector with its configuration.
func (*InMemoryBackend) DescribeLoggingConfiguration ¶
func (b *InMemoryBackend) DescribeLoggingConfiguration(ctx context.Context, wsID string) (wLogging, error)
DescribeLoggingConfiguration returns the logging configuration.
func (*InMemoryBackend) DescribeQueryLoggingConfiguration ¶
func (b *InMemoryBackend) DescribeQueryLoggingConfiguration(ctx context.Context, wsID string) (wQueryLogging, error)
DescribeQueryLoggingConfiguration returns the query logging configuration.
func (*InMemoryBackend) DescribeResourcePolicy ¶
func (b *InMemoryBackend) DescribeResourcePolicy(ctx context.Context, wsID string) (PolicyResult, error)
DescribeResourcePolicy returns the workspace resource policy.
func (*InMemoryBackend) DescribeRuleGroupsNamespace ¶
func (b *InMemoryBackend) DescribeRuleGroupsNamespace(ctx context.Context, wsID, name string) (wNamespace, error)
DescribeRuleGroupsNamespace returns a namespace with its data.
func (*InMemoryBackend) DescribeScraper ¶
func (b *InMemoryBackend) DescribeScraper(ctx context.Context, id string) (wScraper, error)
DescribeScraper returns a scraper.
func (*InMemoryBackend) DescribeScraperLoggingConfiguration ¶
func (b *InMemoryBackend) DescribeScraperLoggingConfiguration(ctx context.Context, id string) (wScraperLogging, error)
DescribeScraperLoggingConfiguration returns a scraper's log delivery.
func (*InMemoryBackend) DescribeWorkspace ¶
func (b *InMemoryBackend) DescribeWorkspace(ctx context.Context, id string) (wWorkspace, error)
DescribeWorkspace returns a workspace.
func (*InMemoryBackend) DescribeWorkspaceConfiguration ¶
func (b *InMemoryBackend) DescribeWorkspaceConfiguration(ctx context.Context, wsID string) (wWorkspaceConfig, error)
DescribeWorkspaceConfiguration returns the workspace settings.
func (*InMemoryBackend) Ingest ¶
func (b *InMemoryBackend) Ingest(ctx context.Context, wsID string, series []writeSeries) (IngestResult, error)
Ingest stores remote-write samples. Non-finite values (including stale markers) are dropped.
func (*InMemoryBackend) ListAnomalyDetectors ¶
func (b *InMemoryBackend) ListAnomalyDetectors( ctx context.Context, wsID, alias, token string, maxResults int, ) (page.Page[wDetector], error)
ListAnomalyDetectors lists detectors, optionally by exact alias.
func (*InMemoryBackend) ListRuleGroupsNamespaces ¶
func (b *InMemoryBackend) ListRuleGroupsNamespaces( ctx context.Context, wsID, prefix, token string, maxResults int, ) (page.Page[wNamespace], error)
ListRuleGroupsNamespaces lists namespaces, optionally by name prefix.
func (*InMemoryBackend) ListScrapers ¶
func (b *InMemoryBackend) ListScrapers( ctx context.Context, filters map[string][]string, token string, maxResults int, ) (page.Page[wScraper], error)
ListScrapers lists scrapers matching filters (alias, status, sourceArn, destinationArn).
func (*InMemoryBackend) ListTagsForResource ¶
func (b *InMemoryBackend) ListTagsForResource(ctx context.Context, resourceARN string) (map[string]string, error)
ListTagsForResource returns a resource's tags.
func (*InMemoryBackend) ListWorkspaces ¶
func (b *InMemoryBackend) ListWorkspaces( ctx context.Context, alias, token string, maxResults int, ) (page.Page[wWorkspace], error)
ListWorkspaces lists workspaces, optionally by alias prefix.
func (*InMemoryBackend) PutAlertManagerDefinition ¶
func (b *InMemoryBackend) PutAlertManagerDefinition(ctx context.Context, wsID string, data []byte) (wStatus, error)
PutAlertManagerDefinition replaces the alert manager configuration.
func (*InMemoryBackend) PutAnomalyDetector ¶
func (b *InMemoryBackend) PutAnomalyDetector(ctx context.Context, in DetectorInput) (wDetector, error)
PutAnomalyDetector replaces a detector's configuration.
func (*InMemoryBackend) PutResourcePolicy ¶
func (b *InMemoryBackend) PutResourcePolicy( ctx context.Context, wsID, doc, revision string, ) (PolicyResult, error)
PutResourcePolicy attaches or replaces the workspace resource policy.
func (*InMemoryBackend) PutRuleGroupsNamespace ¶
func (b *InMemoryBackend) PutRuleGroupsNamespace(ctx context.Context, in NamespaceInput) (wNamespace, error)
PutRuleGroupsNamespace replaces a rules file.
func (*InMemoryBackend) Region ¶
func (b *InMemoryBackend) Region() string
Region returns the default region.
func (*InMemoryBackend) Restore ¶
func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
Restore loads a snapshot; an incompatible version is discarded.
func (*InMemoryBackend) SeriesLabels ¶
func (b *InMemoryBackend) SeriesLabels( ctx context.Context, wsID string, selectors [][]*promql.Matcher, minT, maxT int64, ) ([]promql.Labels, error)
SeriesLabels returns the label sets of series matching any selector with a sample in [minT, maxT].
func (*InMemoryBackend) SetClusterResolver ¶
func (b *InMemoryBackend) SetClusterResolver(r ClusterResolver)
SetClusterResolver wires the EKS lookup used to validate scraper sources.
func (*InMemoryBackend) SetLifecycleDelay ¶
func (b *InMemoryBackend) SetLifecycleDelay(d time.Duration)
SetLifecycleDelay overrides the CREATING/UPDATING/DELETING window.
func (*InMemoryBackend) Snapshot ¶
func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
Snapshot serialises the backend state, samples included.
func (*InMemoryBackend) TagResource ¶
func (b *InMemoryBackend) TagResource(ctx context.Context, resourceARN string, add map[string]string) error
TagResource adds or replaces tags.
func (*InMemoryBackend) UntagResource ¶
func (b *InMemoryBackend) UntagResource(ctx context.Context, resourceARN string, keys []string) error
UntagResource removes tags by key.
func (*InMemoryBackend) UpdateLoggingConfiguration ¶
func (b *InMemoryBackend) UpdateLoggingConfiguration(ctx context.Context, wsID, logGroup string) (wStatus, error)
UpdateLoggingConfiguration changes the log group.
func (*InMemoryBackend) UpdateQueryLoggingConfiguration ¶
func (b *InMemoryBackend) UpdateQueryLoggingConfiguration( ctx context.Context, wsID string, dests []LoggingDestination, ) (wStatus, error)
UpdateQueryLoggingConfiguration replaces the query log destinations.
func (*InMemoryBackend) UpdateScraper ¶
func (b *InMemoryBackend) UpdateScraper(ctx context.Context, in ScraperInput) (wScraper, error)
UpdateScraper changes a scraper's alias, configuration, destination, exporters or role configuration.
func (*InMemoryBackend) UpdateScraperLoggingConfiguration ¶
func (b *InMemoryBackend) UpdateScraperLoggingConfiguration( ctx context.Context, in ScraperLoggingInput, ) (wStatus, error)
UpdateScraperLoggingConfiguration sets a scraper's log delivery.
func (*InMemoryBackend) UpdateWorkspaceAlias ¶
func (b *InMemoryBackend) UpdateWorkspaceAlias(ctx context.Context, id, alias string) error
UpdateWorkspaceAlias sets or clears a workspace alias.
func (*InMemoryBackend) UpdateWorkspaceConfiguration ¶
func (b *InMemoryBackend) UpdateWorkspaceConfiguration( ctx context.Context, wsID string, in ConfigInput, ) (wStatus, error)
UpdateWorkspaceConfiguration changes retention, out-of-order window, rule offset and label-set limits.
type IngestResult ¶
IngestResult counts what a remote-write request stored.
type LabelSetLimit ¶
type LabelSetLimit struct {
LabelSet map[string]string `json:"labelSet"`
MaxSeries *int64 `json:"maxSeries,omitempty"`
}
LabelSetLimit caps the active series matching a label set.
type LoggingConfig ¶
type LoggingConfig struct {
CreatedAt time.Time `json:"createdAt"`
ModifiedAt time.Time `json:"modifiedAt"`
Pending Pending `json:"pending"`
LogGroupARN string `json:"logGroupArn"`
}
LoggingConfig is a workspace's rules-and-alerting log delivery.
type LoggingDestination ¶
type LoggingDestination struct {
LogGroupARN string `json:"logGroupArn"`
QspThreshold int64 `json:"qspThreshold"`
}
LoggingDestination is one query-logging destination.
type NamespaceInput ¶
type NamespaceInput struct {
Tags map[string]string
WorkspaceID string
Name string
ClientToken string
Data []byte
}
NamespaceInput holds Create/PutRuleGroupsNamespace parameters.
type Pending ¶
Pending is a transitional state that lasts until Until; a deleting resource is gone after it.
type PolicyResult ¶
PolicyResult is the outcome of a resource-policy operation.
type Provider ¶
type Provider struct{}
Provider implements service.Provider for Amazon Managed Service for Prometheus.
func (*Provider) Init ¶
func (p *Provider) Init(ctx *service.AppContext) (service.Registerable, error)
Init builds the backend and handler.
type QueryLoggingConfig ¶
type QueryLoggingConfig struct {
CreatedAt time.Time `json:"createdAt"`
ModifiedAt time.Time `json:"modifiedAt"`
Pending Pending `json:"pending"`
Destinations []LoggingDestination `json:"destinations"`
}
QueryLoggingConfig is a workspace's query log delivery.
type ResourcePolicy ¶
type ResourcePolicy struct {
Pending Pending `json:"pending"`
Document string `json:"document"`
RevisionID string `json:"revisionId"`
}
ResourcePolicy is a workspace's resource-based policy.
type RuleGroupsNamespace ¶
type RuleGroupsNamespace struct {
Tags map[string]string `json:"tags,omitempty"`
WorkspaceID string `json:"workspaceId"`
Name string `json:"name"`
ARN string `json:"arn"`
Doc Doc `json:"doc"`
}
RuleGroupsNamespace is a Prometheus rules file inside a workspace.
type Scraper ¶
type Scraper struct {
CreatedAt time.Time `json:"createdAt"`
LastModifiedAt time.Time `json:"lastModifiedAt"`
Tags map[string]string `json:"tags,omitempty"`
Logging *ScraperLogging `json:"logging,omitempty"`
Pending Pending `json:"pending"`
Destination Destination `json:"destination"`
ARN string `json:"arn"`
AccountID string `json:"accountId"`
Region string `json:"region"`
Alias string `json:"alias,omitempty"`
RoleARN string `json:"roleArn"`
ID string `json:"id"`
SourceRole string `json:"sourceRoleArn,omitempty"`
TargetRole string `json:"targetRoleArn,omitempty"`
ScrapeConfig []byte `json:"scrapeConfig"`
Exporters []string `json:"exporters,omitempty"`
Source Source `json:"source"`
}
Scraper is an AWS-managed Prometheus collector.
type ScraperComponent ¶
type ScraperComponent struct {
Options map[string]string `json:"options,omitempty"`
Type string `json:"type"`
}
ScraperComponent selects one component for scraper logging.
type ScraperInput ¶
type ScraperInput struct {
Tags map[string]string
Destination Destination
ID string
Alias string
ClientToken string
SourceRole string
TargetRole string
ScrapeConfig []byte
Exporters []string
Source Source
HasExporters bool
HasRoles bool
}
ScraperInput holds Create/UpdateScraper parameters; empty fields are unchanged on update.
type ScraperLogging ¶
type ScraperLogging struct {
ModifiedAt time.Time `json:"modifiedAt"`
Pending Pending `json:"pending"`
LogGroupARN string `json:"logGroupArn"`
Components []ScraperComponent `json:"components"`
}
ScraperLogging is a scraper's log delivery configuration.
type ScraperLoggingInput ¶
type ScraperLoggingInput struct {
ID string
LogGroupARN string
Components []ScraperComponent
}
ScraperLoggingInput holds UpdateScraperLoggingConfiguration parameters.
type SeriesRecord ¶
type SeriesRecord struct {
Labels promql.Labels `json:"labels"`
Key string `json:"key"`
WorkspaceID string `json:"workspaceId"`
Samples []promql.Sample `json:"samples"`
}
SeriesRecord is the stored samples of one series in a workspace.
type Source ¶
type Source struct {
ClusterARN string `json:"clusterArn,omitempty"`
SubnetIDs []string `json:"subnetIds"`
SecurityGroupIDs []string `json:"securityGroupIds,omitempty"`
VPC bool `json:"vpc,omitempty"`
}
Source is what a scraper collects from; EKS or VPC.
type Workspace ¶
type Workspace struct {
CreatedAt time.Time `json:"createdAt"`
Tags map[string]string `json:"tags,omitempty"`
AlertManager *Doc `json:"alertManager,omitempty"`
Logging *LoggingConfig `json:"logging,omitempty"`
QueryLogging *QueryLoggingConfig `json:"queryLogging,omitempty"`
Policy *ResourcePolicy `json:"policy,omitempty"`
Pending Pending `json:"pending"`
ID string `json:"id"`
AccountID string `json:"accountId"`
Region string `json:"region"`
Alias string `json:"alias,omitempty"`
KMSKeyARN string `json:"kmsKeyArn,omitempty"`
ARN string `json:"arn"`
Config WorkspaceConfig `json:"config"`
}
Workspace is an AMP workspace with its singleton sub-resources.
type WorkspaceConfig ¶
type WorkspaceConfig struct {
Pending Pending `json:"pending"`
LimitsPerLabelSet []LabelSetLimit `json:"limitsPerLabelSet,omitempty"`
RetentionPeriodInDays int32 `json:"retentionPeriodInDays"`
OutOfOrderTimeWindowInSeconds int32 `json:"outOfOrderTimeWindowInSeconds"`
RuleQueryOffsetInSeconds int32 `json:"ruleQueryOffsetInSeconds"`
OutOfOrderSet bool `json:"outOfOrderSet,omitempty"`
RuleQueryOffsetSet bool `json:"ruleQueryOffsetSet,omitempty"`
}
WorkspaceConfig holds the tunable workspace settings.