package
1.19.0
Repository: https://github.com/cortexproject/cortex.git
Documentation: pkg.go.dev

# Packages

# Functions

AddSourceIPsToIncomingContext adds the given source to the GRPC context.
AddSourceIPsToOutgoingContext adds the given source to the GRPC context.
DeleteMatchingLabels removes metric with labels matching the filter.
DiffConfig utility function that returns the diff between two config map objects.
DurationWithJitter returns random duration from "input - input*variance" to "input + input*variance" interval.
DurationWithPositiveJitter returns random duration from "input" to "input + input*variance" interval.
DynamicShardSize returns the shard size as a percentage of numInstances if the value is < 1.
Event is the log-like API for event sampling.
FindMinMaxTime returns the time in milliseconds of the earliest and latest point in time the statement will try to process.
FormatTimeMillis returns a human readable version of the input time (in milliseconds).
FormatTimeModel returns a human readable version of the input time.
FromLabelPairsToLabels converts dto.LabelPair into labels.Labels.
GetFirstAddressOf returns the first IPv4 address of the supplied interface names, omitting any 169.254.x.x automatic private IPs if possible.
GetLabels returns list of label combinations used by this collector at the time of call.
GetSourceIPsFromIncomingCtx extracts the source field from the GRPC context.
GetSourceIPsFromOutgoingCtx extracts the source field from the GRPC context.
GetSumOfHistogramSampleCount returns the sum of samples count of histograms matching the provided metric name and optional label matchers.
HashFP simply moves entropy from the most significant 48 bits of the fingerprint into the least significant 16 bits (by XORing) so that a simple MOD on the result can be used to pick a mutex while still making use of changes in more significant bits of the fingerprint.
InitEvents initializes event sampling, with the given frequency.
IsRequestBodyTooLarge returns true if the error is "http: request body too large".
LabelMatchersToString returns a string representing the input label matchers.
LabelsToMetric converts a Labels to Metric Don't do this on any performance sensitive paths.
MergeMetricFamilies - Capable of merging summaries, histograms, and counters.
MergeSlicesParallel merge sorted slices in parallel using the MergeSortedSlices function.
MergeSortedSlices merges a set of sorted string slices into a single ones while removing all duplicates.
NewAllowedTenants builds new allowed tenants based on enabled and disabled tenants.
NewDisableableTicker essentially wraps NewTicker but allows the ticker to be disabled by passing zero duration as the interval.
NewDNSWatcher creates a new DNS watcher and returns a service that is wrapping it.
NewHistogramDataCollector creates new histogram data collector.
NewLruInterner returns a new Interner to be used to intern strings.
NewMetricFamilyMap sorts output from Gatherer.Gather method into a map.
NewPriorityQueue makes a new priority queue.
NewUserRegistries makes new UserRegistries.
ParseProtoReader parses a compressed proto from an io.Reader.
ParseTime parses the string into an int64, milliseconds since epoch.
ParseTimeParam parses the time request parameter into an int64, milliseconds since epoch.
PositiveJitter returns random duration from "0" to "input*variance" interval.
RenderHTTPResponse either responds with json or a rendered html page using the passed in template by checking the Accepts header.
SerializeProtoResponse serializes a protobuf response into an HTTP response.
ShuffleShardExpectedInstances returns the total number of instances that should be selected for a given tenant.
ShuffleShardExpectedInstancesPerZone returns the number of instances that should be selected for each zone when zone-aware replication is enabled.
ShuffleShardSeed returns seed for random number generator, computed from provided identifier.
StreamWriteYAMLResponse stream writes data as http response using yaml v2 library.
StreamWriteYAMLV3Response stream writes data as http response using yaml v3 library.
StringsClone returns a copy input s see: https://github.com/golang/go/blob/master/src/strings/clone.go.
StringsContain returns true if the search value is within the list of input values.
StringsMap returns a map where keys are input values.
TimeFromMillis is a helper to turn milliseconds -> time.Time.
Sends message as text/html response with 200 status code.
WriteJSONResponse writes some JSON as a HTTP response.
Sends message as text/plain response with 200 status code.
WriteYAMLResponse writes some YAML as a HTTP response.
YAMLMarshalUnmarshal utility function that converts a YAML interface in a map doing marshal and unmarshal of the parameter.

# Constants

CheckContextEveryNIterations is used in some tight loops to check if the context is done.
Compaction strategies.
Values for CompressionType.
Values for CompressionType.
Values for CompressionType.
Sharding strategies.

# Variables

# Structs

ActiveUsers keeps track of latest user's activity timestamp, and allows purging users that are no longer active.
ActiveUsersCleanupService tracks active users, and periodically purges inactive ones while running.
AllowedTenants that can answer whether tenant is allowed or not based on configuration.
BasicAuth configures basic authentication for HTTP clients.
HistogramData keeps data required to build histogram Metric.
HistogramDataCollector combines histogram data, with prometheus descriptor.
PriorityQueue is a priority queue.
SummaryData keeps all data needed to create summary metric.
UserRegistries holds Prometheus registries for multiple users, guaranteeing multi-thread safety and stable ordering.
UserRegistry holds a Prometheus registry associated to a specific user.

# Interfaces

CollectorVec is a collector that can delete metrics by labels.
Notifications about address resolution.
PriorityOp is an operation on the priority queue.

# Type aliases

CompressionType for encoding and decoding requests and responses.
MetricFamiliesPerUser is a collection of metrics gathered via calling Gatherer.Gather() method on different gatherers, one per user.
MetricFamilyMap is a map of metric names to their family (metrics with same name, but different labels) Keeping map of metric name to its family makes it easier to do searches later.
SlotInfoFunc returns the slot number and the total number of slots.