package
2.4.3
Repository: https://github.com/frelon/loki.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Package fakeauth provides middlewares thats injects a fake userID, so the rest of the code can continue to be multitenant.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Package marshal converts internal objects to loghttp model objects.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

CopyMap makes a copy of the given map.
No description provided by the author
DeleteMatchingLabels removes metric with labels matching the filter.
DurationWithJitter returns random duration from "input - input*variance" to "input + input*variance" interval.
DurationWithPositiveJitter returns random duration from "input" to "input + input*variance" interval.
Event is the log-like API for event sampling.
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.
GetLables returns list of label combinations used by this collector at the time of call.
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.
IsConnCanceled returns true, if error is from a closed gRPC connection.
IsInReplicationSet will query the provided ring for the provided key and see if the provided address is in the resulting ReplicationSet.
IsRequestBodyTooLarge returns true if the error is "http: request body too large".
LabelsToMetric converts a Labels to Metric Don't do this on any performance sensitive paths.
LogConfig takes a pointer to a config object, marshalls it to YAML and prints each line in REVERSE order The reverse order makes display in Grafana in easier which typically sorts newest entries at the top.
LogError logs any error returned by f; useful when deferring Close etc.
LogError logs any error returned by f; useful when deferring Close etc.
TODO(dannyk): remove once weaveworks/common updates to go-kit/log -> we can then revert to using Level.Gokit.
MapToModelLabelSet converts a map into a model.LabelSet.
MergeMaps merges the overlay map onto the base map, with overlay taking precedence NOTE: this treats the given base and overlay maps as immutable, and returns a copy.
MergeNSampleSets merges and dedupes n sets of already sorted sample pairs.
MergeSampleSets merges and dedupes two sets of already sorted sample pairs.
No description provided by the author
No description provided by the author
ModelLabelSetToMap convert a model.LabelSet to a map[string]string.
No description provided by the author
No description provided by the author
No description provided by the author
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.
No description provided by the author
NewHistogramDataCollector creates new histogram data collector.
No description provided by the author
NewMetricFamilyMap sorts output from Gatherer.Gather method into a map.
NewPriorityQueue makes a new priority queue.
No description provided by the author
NewRingWatcher creates a new Ring watcher and returns a service that is wrapping it.
NewSizeReader returns an io.Reader that will have the number of bytes read from r available.
NewUserRegistries makes new UserRegistries.
ParseProtoReader parses a compressed proto from an io.Reader.
ParseTime parses the string into an int64, milliseconds since epoch.
PrintConfig will takes a pointer to a config object, marshalls it to YAML and prints the result to the provided writer unlike LogConfig, PrintConfig prints the object in naturally ocurring order.
RenderHTTPResponse either responds with json or a rendered html page using the passed in template by checking the Accepts header.
RoundToMilliseconds returns milliseconds precision time from nanoseconds.
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.
SnakeCase converts given string `s` into `snake_case`.
SplitFiltersAndMatchers splits empty matchers off, which are treated as filters, see #220.
StreamWriteYAMLResponse stream writes data as http response.
No description provided by the author
StringsContain returns true if the search value is within the list of input values.
TimeFromMillis is a helper to turn milliseconds -> time.Time.
No description provided by the author
TokenFor generates a token used for finding ingesters from ring.
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.
No description provided by the author

# Constants

Values for CompressionType.
Values for CompressionType.
No description provided by the author
Sharding strategies.
No description provided by the author

# 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.
No description provided by the author
No description provided by the author
HistogramData keeps data required to build histogram Metric.
HistogramDataCollector combines histogram data, with prometheus descriptor.
No description provided by the author
PriorityQueue is a priority queue.
No description provided by the author
RingConfig masks the ring lifecycler config which contains many options not really required by the distributors ring.
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.
Op is an operation on the priority queue.
No description provided by the author
No description provided by the author

# 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.
The MultiError type implements the error interface, and contains the Errors used to construct it.