config

package
Version: v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: Apache-2.0 Imports: 22 Imported by: 22

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TagOptionsFromConfig added in v0.4.8

func TagOptionsFromConfig(cfg TagOptionsConfiguration) (models.TagOptions, error)

TagOptionsFromConfig translates tag option configuration into tag options.

Types

type BackendStorageType added in v0.4.4

type BackendStorageType string

BackendStorageType is an enum for different backends.

const (
	// GRPCStorageType is for backends which only support grpc endpoints.
	GRPCStorageType BackendStorageType = "grpc"
	// M3DBStorageType is for m3db backend.
	M3DBStorageType BackendStorageType = "m3db"
	// NoopEtcdStorageType is for a noop backend which returns empty results for
	// any query and blackholes any writes, but requires that a valid etcd cluster
	// is defined and can be connected to. Primarily used for standalone
	// coordinators used only to serve m3admin APIs.
	NoopEtcdStorageType BackendStorageType = "noop-etcd"

	// PromRemoteStorageType is a type of storage that is backed by Prometheus Remote Write compatible API.
	PromRemoteStorageType BackendStorageType = "prom-remote"
)

type CarbonConfiguration added in v0.5.0

type CarbonConfiguration struct {
	// Ingester if set defines an ingester to run for carbon.
	Ingester *CarbonIngesterConfiguration `yaml:"ingester"`
	// LimitsFind sets the limits configuration for find queries.
	LimitsFind *LimitsConfiguration `yaml:"limitsFind"`
	// LimitsRender sets the limits configuration for render queries.
	LimitsRender *LimitsConfiguration `yaml:"limitsRender"`
	// AggregateNamespacesAllData configures whether all aggregate
	// namespaces contain entire copies of the data set.
	// This affects whether queries can be optimized or not, if false
	// they cannot be since it's unclear if data matching an expression
	// sits in one or many or none of the aggregate namespaces so all
	// must be queried, but if true then it can be determined based
	// on the query range whether a single namespace can fulfill the
	// entire query and if so to only fetch from that one aggregated namespace.
	AggregateNamespacesAllData bool `yaml:"aggregateNamespacesAllData"`
	// ShiftTimeStart sets a constant time to shift start by.
	ShiftTimeStart time.Duration `yaml:"shiftTimeStart"`
	// ShiftTimeEnd sets a constant time to shift end by.
	ShiftTimeEnd time.Duration `yaml:"shiftTimeEnd"`
	// ShiftStepsStart sets a constant set of steps to shift start by.
	ShiftStepsStart int `yaml:"shiftStepsStart"`
	// ShiftStepsEnd sets a constant set of steps to shift end by.
	ShiftStepsEnd int `yaml:"shiftStepsEnd"`
	// ShiftStepsStartWhenAtResolutionBoundary sets a constant set of steps to
	// shift start by if and only if the start is an exact match to the
	// resolution boundary of a query.
	ShiftStepsStartWhenAtResolutionBoundary *int `yaml:"shiftStepsStartWhenAtResolutionBoundary"`
	// ShiftStepsEndWhenAtResolutionBoundary sets a constant set of steps to
	// shift end by if and only if the end is an exact match to the
	// resolution boundary of a query.
	ShiftStepsEndWhenAtResolutionBoundary *int `yaml:"shiftStepsEndWhenAtResolutionBoundary"`
	// ShiftStepsStartWhenEndAtResolutionBoundary sets a constant set of steps to
	// shift start by if and only if the end is an exact match to the resolution boundary
	// of a query AND the start is not an exact match to the resolution boundary.
	ShiftStepsStartWhenEndAtResolutionBoundary *int `yaml:"shiftStepsStartWhenEndAtResolutionBoundary"`
	// ShiftStepsEndWhenStartAtResolutionBoundary sets a constant set of steps to
	// shift end by if and only if the start is an exact match to the resolution boundary
	// of a query AND the end is not an exact match to the resolution boundary.
	ShiftStepsEndWhenStartAtResolutionBoundary *int `yaml:"shiftStepsEndWhenStartAtResolutionBoundary"`
	// RenderPartialStart sets whether to render partial datapoints when
	// the start time is between a datapoint's resolution step size.
	RenderPartialStart bool `yaml:"renderPartialStart"`
	// RenderPartialEnd sets whether to render partial datapoints when
	// the end time is between a datapoint's resolution step size.
	RenderPartialEnd bool `yaml:"renderPartialEnd"`
	// RenderSeriesAllNaNs will render series that have only NaNs for entire
	// output instead of returning an empty array of datapoints.
	RenderSeriesAllNaNs bool `yaml:"renderSeriesAllNaNs"`
	// CompileEscapeAllNotOnlyQuotes will escape all characters when using a backslash
	// in a quoted string rather than just reserving for escaping quotes.
	CompileEscapeAllNotOnlyQuotes bool `yaml:"compileEscapeAllNotOnlyQuotes"`
	// FindResultsIncludeBothExpandableAndLeaf will include both an expandable
	// node and a leaf node if there is a duplicate path node that is both an
	// expandable node and a leaf node.
	FindResultsIncludeBothExpandableAndLeaf bool `yaml:"findResultsIncludeBothExpandableAndLeaf"`
}

CarbonConfiguration is the configuration for the carbon server.

type CarbonIngesterAggregationConfiguration added in v0.5.0

type CarbonIngesterAggregationConfiguration struct {
	Enabled *bool             `yaml:"enabled"`
	Type    *aggregation.Type `yaml:"type"`
}

CarbonIngesterAggregationConfiguration is the configuration struct for the aggregation for a carbon ingest rule's storage policy.

func (*CarbonIngesterAggregationConfiguration) EnabledOrDefault added in v0.5.0

func (c *CarbonIngesterAggregationConfiguration) EnabledOrDefault() bool

EnabledOrDefault returns whether aggregation should be enabled based on the provided configuration, or a default value otherwise.

func (*CarbonIngesterAggregationConfiguration) TypeOrDefault added in v0.5.0

TypeOrDefault returns the aggregation type that should be used based on the provided configuration, or a default value otherwise.

type CarbonIngesterConfiguration added in v0.5.0

type CarbonIngesterConfiguration struct {
	ListenAddress  string                             `yaml:"listenAddress"`
	MaxConcurrency int                                `yaml:"maxConcurrency"`
	Rewrite        CarbonIngesterRewriteConfiguration `yaml:"rewrite"`
	Rules          []CarbonIngesterRuleConfiguration  `yaml:"rules"`
}

CarbonIngesterConfiguration is the configuration struct for carbon ingestion.

func (*CarbonIngesterConfiguration) ListenAddressOrDefault added in v0.6.0

func (c *CarbonIngesterConfiguration) ListenAddressOrDefault() string

ListenAddressOrDefault returns the specified carbon ingester listen address if provided, or the default value if not.

func (*CarbonIngesterConfiguration) RulesOrDefault added in v0.5.0

RulesOrDefault returns the specified carbon ingester rules if provided, or generates reasonable defaults using the provided aggregated namespaces if not.

type CarbonIngesterRewriteConfiguration added in v1.0.1

type CarbonIngesterRewriteConfiguration struct {
	// Cleanup will perform:
	// - Trailing/leading dot elimination.
	// - Double dot elimination.
	// - Irregular char replacement with underscores (_), currently irregular
	//   is defined as not being in [0-9a-zA-Z-_:#].
	Cleanup bool `yaml:"cleanup"`
}

CarbonIngesterRewriteConfiguration is the configuration for rewriting metrics at ingestion.

type CarbonIngesterRuleConfiguration added in v0.5.0

type CarbonIngesterRuleConfiguration struct {
	Pattern     string                                     `yaml:"pattern"`
	Contains    string                                     `yaml:"contains"`
	Continue    bool                                       `yaml:"continue"`
	Aggregation CarbonIngesterAggregationConfiguration     `yaml:"aggregation"`
	Policies    []CarbonIngesterStoragePolicyConfiguration `yaml:"policies"`
}

CarbonIngesterRuleConfiguration is the configuration struct for a carbon ingestion rule.

type CarbonIngesterStoragePolicyConfiguration added in v0.5.0

type CarbonIngesterStoragePolicyConfiguration struct {
	Resolution time.Duration `yaml:"resolution" validate:"nonzero"`
	Retention  time.Duration `yaml:"retention" validate:"nonzero"`
}

CarbonIngesterStoragePolicyConfiguration is the configuration struct for a carbon rule's storage policies.

type ClusterManagementConfiguration

type ClusterManagementConfiguration struct {
	// Etcd is the client configuration for etcd.
	Etcd *etcdclient.Configuration `yaml:"etcd"`

	// Placement is the cluster placement configuration.
	Placement placement.Configuration `yaml:"placement"`
}

ClusterManagementConfiguration is configuration for the placement, namespaces and database management endpoints (optional).

type Configuration

type Configuration struct {
	// Metrics configuration.
	Metrics *instrument.MetricsConfiguration `yaml:"metrics"`

	// Logging configuration.
	Logging *xlog.Configuration `yaml:"logging"`

	// Tracing configures opentracing. If not provided, tracing is disabled.
	Tracing opentracing.TracingConfiguration `yaml:"tracing"`

	// Clusters is the DB cluster configurations for read, write and
	// query endpoints.
	Clusters m3.ClustersStaticConfiguration `yaml:"clusters"`

	// LocalConfiguration is the local embedded configuration if running
	// coordinator embedded in the DB.
	Local *LocalConfiguration `yaml:"local"`

	// ClusterManagement for placement, namespaces and database management
	// endpoints.
	ClusterManagement ClusterManagementConfiguration `yaml:"clusterManagement"`

	// PrometheusRemoteBackend configures prometheus remote write backend.
	// Used only when backend property is "prom-remote"
	PrometheusRemoteBackend *PrometheusRemoteBackendConfiguration `yaml:"prometheusRemoteBackend"`

	// ListenAddress is the server listen address.
	ListenAddress *string `yaml:"listenAddress"`

	// Filter is the read/write/complete tags filter configuration.
	Filter FilterConfiguration `yaml:"filter"`

	// RPC is the RPC configuration.
	RPC *RPCConfiguration `yaml:"rpc"`

	// HTTP is the HTTP configuration.
	HTTP HTTPConfiguration `yaml:"http"`

	// Backend is the backend store for query service.
	Backend BackendStorageType `yaml:"backend"`

	// TagOptions is the tag configuration options.
	TagOptions TagOptionsConfiguration `yaml:"tagOptions"`

	// ReadWorkerPool is the worker pool policy for read requests.
	ReadWorkerPool xconfig.WorkerPoolPolicy `yaml:"readWorkerPoolPolicy"`

	// WriteWorkerPool is the worker pool policy for write requests.
	WriteWorkerPool *xconfig.WorkerPoolPolicy `yaml:"writeWorkerPoolPolicy"`

	// WriteForwarding is the write forwarding options.
	WriteForwarding WriteForwardingConfiguration `yaml:"writeForwarding"`

	// Downsample configures how the metrics should be downsampled.
	Downsample downsample.Configuration `yaml:"downsample"`

	// Ingest is the ingest server.
	Ingest *IngestConfiguration `yaml:"ingest"`

	// Carbon is the carbon configuration.
	Carbon *CarbonConfiguration `yaml:"carbon"`

	// Middleware is middleware-specific configuration.
	Middleware MiddlewareConfiguration `yaml:"middleware"`

	// Query is the query configuration.
	Query QueryConfiguration `yaml:"query"`

	// Limits specifies limits on per-query resource usage.
	Limits LimitsConfiguration `yaml:"limits"`

	// LookbackDuration determines the lookback duration for queries
	LookbackDuration *time.Duration `yaml:"lookbackDuration"`

	// ResultOptions are the results options for query.
	ResultOptions ResultOptions `yaml:"resultOptions"`

	// DeprecatedExperimental is the configuration for the experimental API group. It is not used anymore
	// and only kept for backwards-support with older configuration files.
	DeprecatedExperimental ExperimentalAPIConfiguration `yaml:"experimental"`

	// StoreMetricsType controls if metrics type is stored or not.
	StoreMetricsType *bool `yaml:"storeMetricsType"`

	// MultiProcess is the multi-process configuration.
	MultiProcess MultiProcessConfiguration `yaml:"multiProcess"`

	// Debug configuration.
	Debug config.DebugConfiguration `yaml:"debug"`
}

Configuration is the configuration for the query service.

func (*Configuration) ListenAddressOrDefault added in v1.0.0

func (c *Configuration) ListenAddressOrDefault() string

ListenAddressOrDefault returns the listen address or default.

func (*Configuration) LoggingOrDefault added in v1.0.0

func (c *Configuration) LoggingOrDefault() xlog.Configuration

LoggingOrDefault returns the logging config or default.

func (Configuration) LookbackDurationOrDefault added in v0.5.0

func (c Configuration) LookbackDurationOrDefault() (time.Duration, error)

LookbackDurationOrDefault validates the LookbackDuration

func (*Configuration) MetricsOrDefault added in v1.0.0

func (c *Configuration) MetricsOrDefault() *instrument.MetricsConfiguration

MetricsOrDefault returns the metrics config or default.

func (*Configuration) WriteWorkerPoolOrDefault added in v1.0.0

func (c *Configuration) WriteWorkerPoolOrDefault() xconfig.WorkerPoolPolicy

WriteWorkerPoolOrDefault returns the write worker pool config or default.

type ConsolidationConfiguration added in v0.15.2

type ConsolidationConfiguration struct {
	// MatchType determines the options by which series should match.
	MatchType consolidators.MatchType `yaml:"matchType"`
}

ConsolidationConfiguration are configs for consolidating fetched queries.

type ExperimentalAPIConfiguration added in v0.15.0

type ExperimentalAPIConfiguration struct {
	Enabled bool `yaml:"enabled"`
}

ExperimentalAPIConfiguration is the configuration for the experimental API group.

type Filter added in v0.5.0

type Filter string

Filter is a query filter type.

const (
	// FilterLocalOnly is a filter that specifies local only storage should be used.
	FilterLocalOnly Filter = "local_only"
	// FilterRemoteOnly is a filter that specifies remote only storage should be used.
	FilterRemoteOnly Filter = "remote_only"
	// FilterAllowAll is a filter that specifies all storages should be used.
	FilterAllowAll Filter = "allow_all"
	// FilterAllowNone is a filter that specifies no storages should be used.
	FilterAllowNone Filter = "allow_none"
)

type FilterConfiguration added in v0.5.0

type FilterConfiguration struct {
	Read         Filter `yaml:"read"`
	Write        Filter `yaml:"write"`
	CompleteTags Filter `yaml:"completeTags"`
}

FilterConfiguration is the filters for write/read/complete tags storage filters.

type HTTPConfiguration added in v1.2.0

type HTTPConfiguration struct {
	// EnableH2C enables support for the HTTP/2 cleartext protocol. H2C
	// enables the use of HTTP/2 without requiring TLS.
	EnableH2C bool `yaml:"enableH2C"`
}

HTTPConfiguration is the HTTP configuration for configuring the HTTP server used by the coordinator to serve incoming requests.

type IngestConfiguration added in v0.4.7

type IngestConfiguration struct {
	// Ingester is the configuration for storage based ingester.
	Ingester ingestm3msg.Configuration `yaml:"ingester"`

	// M3Msg is the configuration for m3msg server.
	M3Msg m3msg.Configuration `yaml:"m3msg"`
}

IngestConfiguration is the configuration for ingestion server.

type LimitsConfiguration added in v0.4.8

type LimitsConfiguration struct {
	// PerQuery configures limits which apply to each query individually.
	PerQuery PerQueryLimitsConfiguration `yaml:"perQuery"`
}

LimitsConfiguration represents limitations on resource usage in the query instance. Limits are split between per-query and global limits.

type LocalConfiguration

type LocalConfiguration struct {
	// Namespaces is the list of namespaces that the local embedded DB has.
	Namespaces []m3.ClusterStaticNamespaceConfiguration `yaml:"namespaces"`
}

LocalConfiguration is the local embedded configuration if running coordinator embedded in the DB.

type LoggingMiddlewareConfiguration added in v1.2.0

type LoggingMiddlewareConfiguration struct {
	// Threshold defines the latency threshold for logging the response. If zero, the default of 1s is used. To disable
	// response logging set Disabled.
	Threshold time.Duration
	// Disabled turns off response logging by default for endpoints.
	Disabled bool
}

LoggingMiddlewareConfiguration configures the logging middleware.

type MetricsMiddlewareConfiguration added in v1.2.0

type MetricsMiddlewareConfiguration struct {
	// QueryEndpointsClassification contains the configuration for sizing queries to
	// the query and query_range Prometheus endpoints.
	QueryEndpointsClassification QueryClassificationConfig `yaml:"queryEndpointsClassification"`
	// LabelEndpointsClassification contains the configuration for sizing queries to
	// the label names and label values Prometheus endpoints.
	LabelEndpointsClassification QueryClassificationConfig `yaml:"labelEndpointsClassification"`
	// AddStatusToLatencies will add a tag with the query's response code to
	// middleware latency metrics.
	// NB: Setting this to true will increase cardinality by the number of
	// expected response codes (likely around ~10).
	AddStatusToLatencies bool `yaml:"addStatusToLatencies"`
}

MetricsMiddlewareConfiguration configures the metrics middleware.

type MiddlewareConfiguration added in v1.2.0

type MiddlewareConfiguration struct {
	// Logging configures the logging middleware.
	Logging LoggingMiddlewareConfiguration `yaml:"logging"`
	// Metrics configures the metrics middleware.
	Metrics MetricsMiddlewareConfiguration `yaml:"metrics"`
	// Prometheus configures prometheus-related middleware.
	Prometheus PrometheusMiddlewareConfiguration `yaml:"prometheus"`
}

MiddlewareConfiguration is middleware-specific configuration.

type MultiProcessConfiguration added in v0.15.0

type MultiProcessConfiguration struct {
	// Enabled is whether to enable multi-process execution.
	Enabled bool `yaml:"enabled"`
	// Count is the number of sub-processes to run, leave zero
	// to auto-detect based on number of CPUs.
	Count int `yaml:"count" validate:"min=0"`
	// PerCPU is the factor of processes to run per CPU, leave
	// zero to use the default of 0.5 per CPU (i.e. one process for
	// every two CPUs).
	PerCPU float64 `yaml:"perCPU" validate:"min=0.0, max=1.0"`
	// GoMaxProcs if set will explicitly set the child GOMAXPROCs env var.
	GoMaxProcs int `yaml:"goMaxProcs"`
}

MultiProcessConfiguration is the multi-process configuration which allows running multiple sub-processes of an instance reusing the same listen ports.

type PerQueryLimitsConfiguration added in v0.7.1

type PerQueryLimitsConfiguration struct {
	// MaxFetchedSeries limits the number of time series returned for any given
	// individual storage node per query, before returning result to query
	// service.
	MaxFetchedSeries int `yaml:"maxFetchedSeries"`

	// InstanceMultiple increases the per database instance series limit.
	// The series limit per database instance is calculated as:
	//
	// InstanceSeriesLimit = MaxFetchesSeries / (instances per replica) * InstanceMultiple.
	//
	// A value > 1 allows a buffer in case data is not uniformly sharded across instances in a replica.
	// If set to 0 the feature is disabled and the MaxFetchedSeries is used as the limit for database instance.
	// For large clusters, enabling this feature can dramatically decrease the amount of wasted series read from a
	// single database instance.
	InstanceMultiple float32 `yaml:"instanceMultiple"`

	// MaxFetchedDocs limits the number of index documents matched for any given
	// individual storage node per query, before returning result to query
	// service.
	MaxFetchedDocs int `yaml:"maxFetchedDocs"`

	// MaxFetchedRange limits the time range of index documents matched for any given
	// individual storage node per query, before returning result to query
	// service.
	MaxFetchedRange time.Duration `yaml:"maxFetchedRange"`

	// RequireExhaustive results in an error if the query exceeds any limit.
	RequireExhaustive *bool `yaml:"requireExhaustive"`

	// MaxMetricMetadataStats limits the number of metric metadata stats to return
	// as a response header after a query. If unset, defaults to 4. If set to zero,
	// no metric metadata stats will be returned as a response header.
	MaxMetricMetadataStats *int `yaml:"maxMetricMetadataStats"`
}

PerQueryLimitsConfiguration represents limits on resource usage within a single query. Zero or negative values imply no limit.

func (*PerQueryLimitsConfiguration) AsFetchOptionsBuilderLimitsOptions added in v0.15.4

func (l *PerQueryLimitsConfiguration) AsFetchOptionsBuilderLimitsOptions() handleroptions.FetchOptionsBuilderLimitsOptions

AsFetchOptionsBuilderLimitsOptions converts this configuration to handleroptions.FetchOptionsBuilderLimitsOptions.

type PrometheusConvertConfiguration added in v1.4.0

type PrometheusConvertConfiguration struct {
	// ResolutionThresholdForCounterNormalization sets the resolution threshold starting from which
	// Prometheus counter normalization is performed in order to avoid Prometheus counter
	// extrapolation artifacts.
	ResolutionThresholdForCounterNormalization *time.Duration `yaml:"resolutionThresholdForCounterNormalization"`

	// ValueDecreaseTolerance allows for setting a specific amount of tolerance
	// to avoid returning a decrease if it's below a certain tolerance.
	// This is useful for applications that have precision issues emitting
	// monotonic increasing data and will accidentally make it seem like the
	// counter value decreases when it hasn't changed.
	ValueDecreaseTolerance float64 `yaml:"valueDecreaseTolerance"`

	// ValueDecreaseToleranceUntil allows for setting a time threshold on
	// which to apply the conditional value decrease threshold.
	ValueDecreaseToleranceUntil *time.Time `yaml:"valueDecreaseToleranceUntil"`
}

PrometheusConvertConfiguration configures Prometheus time series conversions.

type PrometheusMiddlewareConfiguration added in v1.2.0

type PrometheusMiddlewareConfiguration struct {
	// ResolutionMultiplier is the multiple that will be applied to the range if it's determined
	// that it needs to be updated. If this value is greater than 0, the range in a query will be
	// updated if the namespaces used to service the request have resolution(s)
	// that are greater than the range. The range will be updated to the largest resolution
	// of the namespaces to service the request * the multiplier specified here. If this multiplier
	// is 0, then this feature is disabled.
	ResolutionMultiplier int `yaml:"resolutionMultiplier"`
}

PrometheusMiddlewareConfiguration configures the range rewriting middleware.

type PrometheusQueryConfiguration added in v0.15.0

type PrometheusQueryConfiguration struct {
	// MaxSamplesPerQuery is the limit on fetched samples per query.
	MaxSamplesPerQuery *int `yaml:"maxSamplesPerQuery"`

	// Convert configures Prometheus time series conversions.
	Convert *PrometheusConvertConfiguration `yaml:"convert"`
}

PrometheusQueryConfiguration is the prometheus query engine configuration.

func (PrometheusQueryConfiguration) ConvertOptionsOrDefault added in v1.4.0

func (c PrometheusQueryConfiguration) ConvertOptionsOrDefault() storage.PromConvertOptions

ConvertOptionsOrDefault creates storage.PromConvertOptions based on the given configuration.

func (PrometheusQueryConfiguration) MaxSamplesPerQueryOrDefault added in v0.15.0

func (c PrometheusQueryConfiguration) MaxSamplesPerQueryOrDefault() int

MaxSamplesPerQueryOrDefault returns the max samples per query or default.

type PrometheusRemoteBackendConfiguration added in v1.3.0

type PrometheusRemoteBackendConfiguration struct {
	Endpoints       []PrometheusRemoteBackendEndpointConfiguration `yaml:"endpoints"`
	RequestTimeout  *time.Duration                                 `yaml:"requestTimeout"`
	ConnectTimeout  *time.Duration                                 `yaml:"connectTimeout"`
	KeepAlive       *time.Duration                                 `yaml:"keepAlive"`
	IdleConnTimeout *time.Duration                                 `yaml:"idleConnTimeout"`
	MaxIdleConns    *int                                           `yaml:"maxIdleConns"`
}

PrometheusRemoteBackendConfiguration configures prometheus remote write backend.

type PrometheusRemoteBackendEndpointConfiguration added in v1.3.0

type PrometheusRemoteBackendEndpointConfiguration struct {
	Name    string `yaml:"name"`
	Address string `yaml:"address"`
	// When nil all unaggregated data will be sent to this endpoint.
	StoragePolicy *PrometheusRemoteBackendStoragePolicyConfiguration `yaml:"storagePolicy"`
}

PrometheusRemoteBackendEndpointConfiguration configures single endpoint.

type PrometheusRemoteBackendStoragePolicyConfiguration added in v1.3.0

type PrometheusRemoteBackendStoragePolicyConfiguration struct {
	Resolution time.Duration `yaml:"resolution" validate:"nonzero"`
	Retention  time.Duration `yaml:"retention" validate:"nonzero"`

	// Downsample is downsampling options to be used with this storage policy.
	Downsample *m3.DownsampleClusterStaticNamespaceConfiguration `yaml:"downsample"`
}

PrometheusRemoteBackendStoragePolicyConfiguration configures storage policy for single endpoint.

type QueryClassificationConfig added in v1.2.0

type QueryClassificationConfig struct {
	// ResultsBuckets contains the buckets to be compared with the number of results (e.g. number of
	// time series or labels) returned by a specific endpoint.
	ResultsBuckets []int `yaml:"resultsBuckets"`
	// DurationBuckets contains the buckets to be compared with time range of a query for a
	// specific endpoint.
	DurationBuckets []time.Duration `yaml:"durationBuckets"`
}

QueryClassificationConfig contains the buckets used to group a query into a bucket for the sake of understanding the size of the query based on a specific dimension. Currently, we have two sets of buckets: results and duration. The results buckets help us understand the size of the query based on the number of results returned whereas the duration buckets help us understand the size of the query based on the time range of the query. Dimension values are rounded down to the nearest bucket. If the value is smaller than all buckets, then it is allocated to the first bucket. Buckets are expected to be ordered in ascending order.

func (*QueryClassificationConfig) Enabled added in v1.2.0

func (q *QueryClassificationConfig) Enabled() bool

Enabled returns true if classification buckets were specified.

type QueryConfiguration added in v0.14.3

type QueryConfiguration struct {
	// Timeout is the query timeout.
	Timeout *time.Duration `yaml:"timeout"`
	// DefaultEngine is the default query engine.
	DefaultEngine string `yaml:"defaultEngine"`
	// ConsolidationConfiguration are configs for consolidating fetched queries.
	ConsolidationConfiguration ConsolidationConfiguration `yaml:"consolidation"`
	// Prometheus is prometheus client configuration.
	Prometheus PrometheusQueryConfiguration `yaml:"prometheus"`
	// RestrictTags is an optional configuration that can be set to restrict
	// all queries with certain tags by.
	RestrictTags *RestrictTagsConfiguration `yaml:"restrictTags"`
	// RequireLabelsEndpointStartEndTime requires requests to /label(s) endpoints
	// to specify a start and end time to prevent unbounded queries.
	RequireLabelsEndpointStartEndTime bool `yaml:"requireLabelsEndpointStartEndTime"`
	// RequireSeriesEndpointStartEndTime requires requests to /series endpoint
	// to specify a start and end time to prevent unbounded queries.
	RequireSeriesEndpointStartEndTime bool `yaml:"requireSeriesEndpointStartEndTime"`
}

QueryConfiguration is the query configuration.

func (QueryConfiguration) RestrictTagsAsStorageRestrictByTag added in v0.15.4

func (c QueryConfiguration) RestrictTagsAsStorageRestrictByTag() (*storage.RestrictByTag, bool, error)

RestrictTagsAsStorageRestrictByTag returns restrict tags as storage options to restrict all queries by default.

func (QueryConfiguration) TimeoutOrDefault added in v0.14.3

func (c QueryConfiguration) TimeoutOrDefault() time.Duration

TimeoutOrDefault returns the configured timeout or default value.

type RPCConfiguration

type RPCConfiguration struct {
	// Enabled determines if coordinator RPC is enabled for remote calls.
	//
	// NB: this is no longer necessary to set to true if RPC is desired; enabled
	// status is inferred based on which other options are provided;
	// this remains for back-compat, and for disabling any existing RPC options.
	Enabled *bool `yaml:"enabled"`

	// ListenAddress is the RPC server listen address.
	ListenAddress string `yaml:"listenAddress"`

	// Remotes are the configuration settings for remote coordinator zones.
	Remotes RemoteConfigurations `yaml:"remotes"`

	// RemoteListenAddresses is the remote listen addresses to call for
	// remote coordinator calls.
	//
	// NB: this is deprecated in favor of using RemoteZones, as setting
	// RemoteListenAddresses will only allow for a single remote zone to be used.
	RemoteListenAddresses []string `yaml:"remoteListenAddresses"`

	// ErrorBehavior overrides the default error behavior for all rpc hosts.
	//
	// NB: defaults to warning on error.
	ErrorBehavior *storage.ErrorBehavior `yaml:"errorBehavior"`

	// ReflectionEnabled will enable reflection on the GRPC server, useful
	// for testing connectivity with grpcurl, etc.
	ReflectionEnabled bool `yaml:"reflectionEnabled"`
}

RPCConfiguration is the RPC configuration for the coordinator for the GRPC server used for remote coordinator to coordinator calls.

type Remote added in v0.10.0

type Remote struct {
	// ErrorBehavior describes what this remote client should do on error.
	ErrorBehavior storage.ErrorBehavior
	// Name is the name for this remote client.
	Name string
	// Addresses are the remote addresses for this client.
	Addresses []string
}

Remote is an option for remote storage.

type RemoteConfiguration added in v0.13.0

type RemoteConfiguration struct {
	// Name is the name for the remote zone.
	Name string `yaml:"name"`
	// RemoteListenAddresses is the remote listen addresses to call for remote
	// coordinator calls in the remote zone.
	RemoteListenAddresses []string `yaml:"remoteListenAddresses"`
	// ErrorBehavior overrides the default error behavior for this host.
	//
	// NB: defaults to warning on error.
	ErrorBehavior *storage.ErrorBehavior `yaml:"errorBehavior"`
}

RemoteConfiguration is the configuration for a single remote host.

type RemoteConfigurations added in v0.13.0

type RemoteConfigurations []RemoteConfiguration

RemoteConfigurations is a set of remote host configurations.

type RemoteOptions added in v0.13.0

type RemoteOptions interface {
	// ServeEnabled describes if this RPC should serve rpc requests.
	ServeEnabled() bool
	// ServeAddress describes the address this RPC server will listening on.
	ServeAddress() string
	// ListenEnabled describes if this RPC should connect to remote clients.
	ListenEnabled() bool
	// ReflectionEnabled describes if this RPC server should have reflection
	// enabled.
	ReflectionEnabled() bool
	// Remotes is a list of remote clients.
	Remotes() []Remote
}

RemoteOptions are the options for RPC configurations.

func RemoteOptionsFromConfig added in v0.13.0

func RemoteOptionsFromConfig(cfg *RPCConfiguration) RemoteOptions

RemoteOptionsFromConfig builds remote options given a set of configs.

type RestrictTagsConfiguration added in v0.15.4

type RestrictTagsConfiguration struct {
	Restrict []StringMatch `yaml:"match"`
	Strip    []string      `yaml:"strip"`
}

RestrictTagsConfiguration applies tag restriction to all queries.

type ResultOptions added in v0.7.1

type ResultOptions struct {
	// KeepNaNs keeps NaNs before returning query results.
	// The default is false, which matches Prometheus
	KeepNaNs bool `yaml:"keepNans"`
}

ResultOptions are the result options for query.

type StringMatch added in v0.15.4

type StringMatch struct {
	Name  string `yaml:"name"`
	Type  string `yaml:"type"`
	Value string `yaml:"value"`
}

StringMatch is an easy to use representation of models.Matcher.

type TagFilter added in v0.15.5

type TagFilter struct {
	// Values are the values to filter.
	//
	// NB:If this is unset, all series containing
	// a tag with given `Name` are filtered.
	Values []string `yaml:"values"`
	// Name is the tag name.
	Name string `yaml:"name"`
}

TagFilter is a tag filter.

type TagOptionsConfiguration added in v0.4.8

type TagOptionsConfiguration struct {
	// MetricName specifies the tag name that corresponds to the metric's name tag
	// If not provided, defaults to `__name__`.
	MetricName string `yaml:"metricName"`

	// BucketName specifies the tag name that corresponds to the metric's bucket.
	// If not provided, defaults to `le`.
	BucketName string `yaml:"bucketName"`

	// Scheme determines the default ID generation scheme. Defaults to TypeQuoted.
	Scheme models.IDSchemeType `yaml:"idScheme"`

	// Filters are optional tag filters, removing all series with tags
	// matching the filter from computations.
	Filters []TagFilter `yaml:"filters"`

	// AllowTagNameDuplicates allows for duplicate tags to appear on series.
	AllowTagNameDuplicates bool `yaml:"allowTagNameDuplicates"`

	// AllowTagValueEmpty allows for empty tags to appear on series.
	AllowTagValueEmpty bool `yaml:"allowTagValueEmpty"`
}

TagOptionsConfiguration is the configuration for shared tag options Currently only name, but can expand to cover deduplication settings, or other relevant options.

type WriteForwardingConfiguration added in v0.13.0

type WriteForwardingConfiguration struct {
	PromRemoteWrite handleroptions.PromWriteHandlerForwardingOptions `yaml:"promRemoteWrite"`
}

WriteForwardingConfiguration is the write forwarding configuration.

Jump to

Keyboard shortcuts

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