amp

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 33 Imported by: 0

README

Amp

Parity grade: B · SDK aws-sdk-go-v2/service/amp@v1.54.5 · last audited 2026-10-18 (c1af87ba3)

Coverage

Metric Value
PARITY entries audited 44 (44 ok)
Feature families 8 (8 ok)
Known gaps 11
Structural gaps (can't be emulated) 2
Deferred items 0
Resource leaks clean
Known gaps
  • PromQL: subqueries, the @ modifier, histogram_quantile and other histogram functions, label_replace, label_join, group_left and group_right matching, count_values, predict_linear, deriv, holt_winters and the date and time functions are not implemented (a parse error is returned)
  • RuleGroupsNamespace: rules are validated and stored but never evaluated, so recording rules produce no series and alerts never fire; rule expressions get only a balanced-bracket check, not a full parse
  • AlertManagerDefinition: validated and stored; no alert manager runs and no notification is sent
  • Scraper: stored with a real ACTIVE lifecycle but nothing scrapes the EKS or VPC source
  • WorkspaceConfiguration: retentionPeriodInDays, outOfOrderTimeWindowInSeconds, ruleQueryOffsetInSeconds and limitsPerLabelSet are stored and returned but not enforced on ingest or query
  • RemoteWrite: out-of-order samples are always accepted, native histograms and exemplars in the request are ignored, per-workspace ingestion limits and throttling do not exist
  • Query: query_exemplars, metadata, targets, rules, alerts and status endpoints are not served; the query timeout parameter is ignored
  • LoggingConfiguration: the CloudWatch Logs log group ARN is checked for shape only, never looked up, and no log is delivered
  • Authorization: SigV4 signatures and resource policies are not evaluated on the data plane
  • CreateWorkspace: the 25 workspaces per Region quota and KMS key existence are not enforced
  • ResourceGroupsTaggingAPI: AMP tags are not exposed through the tagging API
Structural gaps

These do not block an A grade — no implementation could produce real data here because the underlying data source cannot exist in an emulator.

  • No ingestion at scale or durable storage: samples live in process memory (and the persistence snapshot), there is no compaction, replication or long-term object storage.
  • The default scraper configuration document returned by GetDefaultScraperConfiguration is AWS-authored text; the emulator serves an equivalent Kubernetes service-discovery configuration.

More

Documentation

Overview

Package amp emulates Amazon Managed Service for Prometheus: the control plane and the Prometheus remote-write and HTTP query data plane.

Index

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

type ClusterResolver interface {
	ClusterExists(region, name string) bool
}

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 NewHandler

func NewHandler(backend *InMemoryBackend) *Handler

NewHandler wraps a backend.

func (*Handler) ChaosOperations

func (h *Handler) ChaosOperations() []string

ChaosOperations lists the fault-injectable operations.

func (*Handler) ChaosRegions

func (h *Handler) ChaosRegions() []string

ChaosRegions lists the regions this handler serves.

func (*Handler) ChaosServiceName

func (h *Handler) ChaosServiceName() string

ChaosServiceName returns the lowercase service name for fault rules.

func (*Handler) ExtractOperation

func (h *Handler) ExtractOperation(c *echo.Context) string

ExtractOperation returns the operation name for metrics.

func (*Handler) ExtractResource

func (h *Handler) ExtractResource(c *echo.Context) string

ExtractResource returns the workspace, scraper or ARN label for metrics.

func (*Handler) GetSupportedOperations

func (h *Handler) GetSupportedOperations() []string

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

func (h *Handler) MatchPriority() int

MatchPriority returns the routing priority.

func (*Handler) Name

func (h *Handler) Name() string

Name returns the service name.

func (*Handler) Reset

func (h *Handler) Reset()

Reset clears all state.

func (*Handler) Restore

func (h *Handler) Restore(ctx context.Context, data []byte) error

Restore implements persistence.Persistable.

func (*Handler) RouteMatcher

func (h *Handler) RouteMatcher() service.Matcher

RouteMatcher matches signed "aps" requests (or the SDK user agent) with a known path shape. Unsigned requests only match the Prometheus data-plane paths.

func (*Handler) Snapshot

func (h *Handler) Snapshot(ctx context.Context) []byte

Snapshot implements persistence.Persistable.

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

func (b *InMemoryBackend) DeleteScraper(ctx context.Context, id string) (string, error)

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) Reset

func (b *InMemoryBackend) Reset()

Reset clears every table.

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

type IngestResult struct {
	Samples   int
	Duplicate int
	Dropped   int
}

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

type Pending struct {
	Until time.Time `json:"until"`
	Kind  string    `json:"kind"`
}

Pending is a transitional state that lasts until Until; a deleting resource is gone after it.

type PolicyResult

type PolicyResult struct {
	Document   string
	RevisionID string
	Status     string
}

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

Init builds the backend and handler.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the provider name.

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.

Directories

Path Synopsis
Package promql implements a PromQL subset: selectors, range functions, aggregations and binary operators.
Package promql implements a PromQL subset: selectors, range functions, aggregations and binary operators.

Jump to

Keyboard shortcuts

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