agent

package
v2.4.1-0...-301bce2 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ShardingStrategy

type ShardingStrategy struct {
	// Configures the number of series needed to add a new shard. Computation is number of series / ScaleUpSeriesCount
	ScaleUpSeriesCount float64
	// Percentage of needed series based on ScaleUpSeriesCount to scale down agents
	ScaleDownPercentage float64
}

ShardingStrategy is a struct that holds the configuration on how to scale prometheus agent shards up and down. It is used to compute the number of shards needed based on the number of time series. It works as follow:

ScaleUpSeriesCount = 1_000_000
ScaleDownPercentage = 0.20

time series = 1_000_000           => 1 shard
time series increase to 1_000_001 => 2 shards
time series decrease to 800_001   => 2 shards
time series decrease to 800_000   => 1 shard

func (ShardingStrategy) ComputeShards

func (pass ShardingStrategy) ComputeShards(currentShardCount int, timeSeries float64) int

We want to start with 1 prometheus-agent for each 1M time series with a scale down 20% threshold.

func (ShardingStrategy) Merge

Jump to

Keyboard shortcuts

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