Versions in this module Expand all Collapse all v3 v3.0.1 Mar 21, 2022 v3.0.0 Mar 21, 2022 Changes in this version + const RingKeyOfLeader + const ShardingStrategyDefault + const ShardingStrategyShuffle + func CopyMap(m map[string]string) map[string]string + func DeleteMatchingLabels(c CollectorVec, filter map[string]string) error + func DurationWithJitter(input time.Duration, variancePerc float64) time.Duration + func DurationWithPositiveJitter(input time.Duration, variancePerc float64) time.Duration + func Event() log.Logger + func FormatTimeMillis(ms int64) string + func FormatTimeModel(t model.Time) string + func FromLabelPairsToLabels(pairs []*dto.LabelPair) labels.Labels + func GetFirstAddressOf(names []string) (string, error) + func GetLabels(c prometheus.Collector, filter map[string]string) ([]labels.Labels, error) + func GetSumOfHistogramSampleCount(families []*dto.MetricFamily, metricName string, matchers labels.Selector) uint64 + func HashFP(fp model.Fingerprint) uint32 + func InitEvents(freq int) + func IsConnCanceled(err error) bool + func IsInReplicationSet(r *ring.Ring, ringKey uint32, address string) (bool, error) + func IsRequestBodyTooLarge(err error) bool + func LabelsToMetric(ls labels.Labels) model.Metric + func LogConfig(cfg interface{}) error + func LogError(message string, f func() error) + func LogErrorWithContext(ctx context.Context, message string, f func() error) + func LogFilter(l string) level.Option + func MapToModelLabelSet(m map[string]string) model.LabelSet + func MergeMaps(base map[string]string, overlay map[string]string) map[string]string + func MergeNSampleSets(sampleSets ...[]model.SamplePair) []model.SamplePair + func MergeSampleSets(a, b []model.SamplePair) []model.SamplePair + func MergeStringLists(ss ...[]string) []string + func MergeStringPair(s1, s2 []string) []string + func ModelLabelSetToMap(m model.LabelSet) map[string]string + func NewDNSWatcher(address string, dnsLookupPeriod time.Duration, notifications DNSNotifications) (services.Service, error) + func NewDisableableTicker(interval time.Duration) (func(), <-chan time.Time) + func NewRingWatcher(log log.Logger, ring ring.ReadRing, lookupPeriod time.Duration, ...) (services.Service, error) + func ParseProtoReader(ctx context.Context, reader io.Reader, expectedSize, maxSize int, ...) error + func ParseTime(s string) (int64, error) + func PrintConfig(w io.Writer, config interface{}) error + func RenderHTTPResponse(w http.ResponseWriter, v interface{}, t *template.Template, r *http.Request) + func RoundToMilliseconds(from, through time.Time) (model.Time, model.Time) + func SerializeProtoResponse(w http.ResponseWriter, resp proto.Message, compression CompressionType) error + func ShuffleShardExpectedInstances(shardSize, numZones int) int + func ShuffleShardExpectedInstancesPerZone(shardSize, numZones int) int + func ShuffleShardSeed(identifier, zone string) int64 + func SnakeCase(s string) string + func SplitFiltersAndMatchers(allMatchers []*labels.Matcher) (filters, matchers []*labels.Matcher) + func StreamWriteYAMLResponse(w http.ResponseWriter, iter chan interface{}, logger log.Logger) + func StringRef(value string) *string + func StringsContain(values []string, search string) bool + func TimeFromMillis(ms int64) time.Time + func TimeToMillis(t time.Time) int64 + func TokenFor(userID, labels string) uint32 + func WriteHTMLResponse(w http.ResponseWriter, message string) + func WriteJSONResponse(w http.ResponseWriter, v interface{}) + func WriteTextResponse(w http.ResponseWriter, message string) + func WriteYAMLResponse(w http.ResponseWriter, v interface{}) + func YoloBuf(s string) []byte + type ActiveUsers struct + func NewActiveUsers() *ActiveUsers + func (m *ActiveUsers) PurgeInactiveUsers(deadline int64) []string + func (m *ActiveUsers) UpdateUserTimestamp(userID string, ts int64) + type ActiveUsersCleanupService struct + func NewActiveUsersCleanupService(cleanupInterval, inactiveTimeout time.Duration, cleanupFn func(string)) *ActiveUsersCleanupService + func NewActiveUsersCleanupWithDefaultValues(cleanupFn func(string)) *ActiveUsersCleanupService + func (s *ActiveUsersCleanupService) UpdateUserTimestamp(user string, now time.Time) + type AllowedTenants struct + func NewAllowedTenants(enabled []string, disabled []string) *AllowedTenants + func (a *AllowedTenants) IsAllowed(tenantID string) bool + type BasicAuth struct + Password string + Username string + func (b *BasicAuth) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet) + func (b BasicAuth) IsEnabled() bool + type CollectorVec interface + Delete func(labels prometheus.Labels) bool + type CompressionType int + const NoCompression + const RawSnappy + type DNSNotifications interface + AddressAdded func(address string) + AddressRemoved func(address string) + type EvictingQueue struct + func NewEvictingQueue(capacity int, onEvict func()) (*EvictingQueue, error) + func (q *EvictingQueue) Append(entry interface{}) + func (q *EvictingQueue) Capacity() int + func (q *EvictingQueue) Clear() + func (q *EvictingQueue) Entries() []interface{} + func (q *EvictingQueue) Length() int + func (q *EvictingQueue) SetCapacity(capacity int) error + type ExtendedMock struct + func (m *ExtendedMock) GetMockedCallsByMethod(method string) []mock.Call + type HistogramData struct + func (d *HistogramData) AddHistogram(histo *dto.Histogram) + func (d *HistogramData) AddHistogramData(histo HistogramData) + func (d *HistogramData) Copy() *HistogramData + func (d *HistogramData) Metric(desc *prometheus.Desc, labelValues ...string) prometheus.Metric + type HistogramDataCollector struct + func NewHistogramDataCollector(desc *prometheus.Desc) *HistogramDataCollector + func (h *HistogramDataCollector) Add(hd HistogramData) + func (h *HistogramDataCollector) Collect(out chan<- prometheus.Metric) + func (h *HistogramDataCollector) Describe(out chan<- *prometheus.Desc) + type LogAdapter struct + func NewLogAdapter(l log.Logger) LogAdapter + func (l LogAdapter) Fatal(v ...interface{}) + func (l LogAdapter) Fatalf(format string, v ...interface{}) + func (l LogAdapter) Fatalln(v ...interface{}) + func (l LogAdapter) Panic(v ...interface{}) + func (l LogAdapter) Panicf(format string, v ...interface{}) + func (l LogAdapter) Panicln(v ...interface{}) + func (l LogAdapter) Print(v ...interface{}) + func (l LogAdapter) Printf(format string, v ...interface{}) + func (l LogAdapter) Println(v ...interface{}) + type MetricFamiliesPerUser []struct + func (d MetricFamiliesPerUser) GetSumOfCounters(counter string) float64 + func (d MetricFamiliesPerUser) GetSumOfGauges(gauge string) float64 + func (d MetricFamiliesPerUser) SendMaxOfGauges(out chan<- prometheus.Metric, desc *prometheus.Desc, gauge string) + func (d MetricFamiliesPerUser) SendMaxOfGaugesPerUser(out chan<- prometheus.Metric, desc *prometheus.Desc, gauge string) + func (d MetricFamiliesPerUser) SendSumOfCounters(out chan<- prometheus.Metric, desc *prometheus.Desc, counter string) + func (d MetricFamiliesPerUser) SendSumOfCountersPerUser(out chan<- prometheus.Metric, desc *prometheus.Desc, counter string) + func (d MetricFamiliesPerUser) SendSumOfCountersPerUserWithLabels(out chan<- prometheus.Metric, desc *prometheus.Desc, metric string, ...) + func (d MetricFamiliesPerUser) SendSumOfCountersWithLabels(out chan<- prometheus.Metric, desc *prometheus.Desc, counter string, ...) + func (d MetricFamiliesPerUser) SendSumOfGauges(out chan<- prometheus.Metric, desc *prometheus.Desc, gauge string) + func (d MetricFamiliesPerUser) SendSumOfGaugesPerUser(out chan<- prometheus.Metric, desc *prometheus.Desc, gauge string) + func (d MetricFamiliesPerUser) SendSumOfGaugesPerUserWithLabels(out chan<- prometheus.Metric, desc *prometheus.Desc, metric string, ...) + func (d MetricFamiliesPerUser) SendSumOfGaugesWithLabels(out chan<- prometheus.Metric, desc *prometheus.Desc, gauge string, ...) + func (d MetricFamiliesPerUser) SendSumOfHistograms(out chan<- prometheus.Metric, desc *prometheus.Desc, histogramName string) + func (d MetricFamiliesPerUser) SendSumOfHistogramsWithLabels(out chan<- prometheus.Metric, desc *prometheus.Desc, histogramName string, ...) + func (d MetricFamiliesPerUser) SendSumOfSummaries(out chan<- prometheus.Metric, desc *prometheus.Desc, summaryName string) + func (d MetricFamiliesPerUser) SendSumOfSummariesPerUser(out chan<- prometheus.Metric, desc *prometheus.Desc, summaryName string) + func (d MetricFamiliesPerUser) SendSumOfSummariesWithLabels(out chan<- prometheus.Metric, desc *prometheus.Desc, summaryName string, ...) + type MetricFamilyMap map[string]*dto.MetricFamily + func NewMetricFamilyMap(metrics []*dto.MetricFamily) (MetricFamilyMap, error) + func (mfm MetricFamilyMap) MaxGauges(name string) float64 + func (mfm MetricFamilyMap) SumCounters(name string) float64 + func (mfm MetricFamilyMap) SumGauges(name string) float64 + func (mfm MetricFamilyMap) SumHistograms(name string) HistogramData + func (mfm MetricFamilyMap) SumHistogramsTo(name string, output *HistogramData) + func (mfm MetricFamilyMap) SumSummaries(name string) SummaryData + func (mfm MetricFamilyMap) SumSummariesTo(name string, output *SummaryData) + type MultiError []error + func (es *MultiError) Add(err error) + func (es MultiError) Err() error + func (es MultiError) Error() string + func (es MultiError) Is(target error) bool + func (es MultiError) IsDeadlineExceeded() bool + type Op interface + Key func() string + Priority func() int64 + type PriorityQueue struct + func NewPriorityQueue(lengthGauge prometheus.Gauge) *PriorityQueue + func (pq *PriorityQueue) Close() + func (pq *PriorityQueue) Dequeue() Op + func (pq *PriorityQueue) DiscardAndClose() + func (pq *PriorityQueue) Enqueue(op Op) bool + func (pq *PriorityQueue) Length() int + type QueryStringBuilder struct + func NewQueryStringBuilder() *QueryStringBuilder + func (b *QueryStringBuilder) Encode() string + func (b *QueryStringBuilder) SetFloat(name string, value float64) + func (b *QueryStringBuilder) SetFloat32(name string, value float32) + func (b *QueryStringBuilder) SetInt(name string, value int64) + func (b *QueryStringBuilder) SetInt32(name string, value int) + func (b *QueryStringBuilder) SetString(name, value string) + func (b *QueryStringBuilder) SetStringArray(name string, values []string) + type Queue interface + Append func(entry interface{}) + Clear func() + Entries func() []interface{} + Length func() int + type RingConfig struct + HeartbeatPeriod time.Duration + HeartbeatTimeout time.Duration + InstanceAddr string + InstanceID string + InstanceInterfaceNames []string + InstancePort int + InstanceZone string + KVStore kv.Config + ListenPort int + ObservePeriod time.Duration + TokensFilePath string + ZoneAwarenessEnabled bool + func CortexLifecyclerConfigToRingConfig(cfg ring.LifecyclerConfig) RingConfig + func (cfg *RingConfig) RegisterFlagsWithPrefix(flagsPrefix, storePrefix string, f *flag.FlagSet) + func (cfg *RingConfig) ToLifecyclerConfig(numTokens int, logger log.Logger) (ring.BasicLifecyclerConfig, error) + func (cfg *RingConfig) ToRingConfig(replicationFactor int) ring.Config + type SizeReader interface + Size func() int64 + func NewSizeReader(r io.Reader) SizeReader + type SummaryData struct + func (s *SummaryData) AddSummary(sum *dto.Summary) + func (s *SummaryData) Metric(desc *prometheus.Desc, labelValues ...string) prometheus.Metric + type UserRegistries struct + func NewUserRegistries() *UserRegistries + func (r *UserRegistries) AddUserRegistry(user string, reg *prometheus.Registry) + func (r *UserRegistries) BuildMetricFamiliesPerUser() MetricFamiliesPerUser + func (r *UserRegistries) Registries() []UserRegistry + func (r *UserRegistries) RemoveUserRegistry(user string, hard bool) + type UserRegistry struct Other modules containing this package github.com/pao214/loki github.com/pao214/loki/v2