Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove initial metric aggregation experiment #13729

Merged
merged 6 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions docs/sources/shared/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -612,21 +612,6 @@ pattern_ingester:
# CLI flag: -pattern-ingester.max-eviction-ratio
[max_eviction_ratio: <float> | default = 0.25]

# Configures the metric aggregation and storage behavior of the pattern
# ingester.
metric_aggregation:
# Whether the pattern ingester metric aggregation is enabled.
# CLI flag: -pattern-ingester.metric-aggregation.enabled
[enabled: <boolean> | default = false]

# Whether to log push observations.
# CLI flag: -pattern-ingester.metric-aggregation.log-push-observations
[log_push_observations: <boolean> | default = false]

# How often to downsample metrics from raw push observations.
# CLI flag: -pattern-ingester.downsample-period
[downsample_period: <duration> | default = 10s]

# The index_gateway block configures the Loki index gateway server, responsible
# for serving index queries without the need to constantly interact with the
# object store.
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ require (
github.com/coreos/etcd v3.3.27+incompatible // indirect
github.com/coreos/pkg v0.0.0-20220810130054-c7d1c02cb6cf // indirect
github.com/dlclark/regexp2 v1.4.0 // indirect
github.com/go-kit/kit v0.12.0 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/goccy/go-json v0.10.3 // indirect
github.com/hashicorp/go-msgpack/v2 v2.1.1 // indirect
Expand Down Expand Up @@ -241,6 +240,7 @@ require (
github.com/envoyproxy/go-control-plane v0.12.0 // indirect
github.com/envoyproxy/protoc-gen-validate v1.0.4 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/go-kit/kit v0.12.0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/analysis v0.22.2 // indirect
Expand Down
2 changes: 1 addition & 1 deletion pkg/canary/comparator/comparator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ func TestCacheTest(t *testing.T) {

queryResultsDiff = &mockCounter{} // reset counter
mr.countOverTime = 2.3 // value not important
mr.noCacheCountOvertime = 2.30000005 // different than `countOverTime` value but within tolerance
mr.noCacheCountOvertime = 2.30000005 // different than `countOverTime` value but withing tolerance
c.cacheTest(now)
assert.Equal(t, 0, queryResultsDiff.(*mockCounter).count)

Expand Down
35 changes: 0 additions & 35 deletions pkg/loghttp/samples.go

This file was deleted.

122 changes: 0 additions & 122 deletions pkg/loghttp/samples_test.go

This file was deleted.

33 changes: 0 additions & 33 deletions pkg/logproto/compat.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,6 @@ func FromMetricsToLabelAdapters(metric model.Metric) []LabelAdapter {
return result
}

func FromMetricsToLabels(metric model.Metric) labels.Labels {
return FromLabelAdaptersToLabels(FromMetricsToLabelAdapters(metric))
}

type byLabel []LabelAdapter

func (s byLabel) Len() int { return len(s) }
Expand Down Expand Up @@ -595,32 +591,3 @@ func (m *DetectedLabelsRequest) LogToSpan(sp opentracing.Span) {
}
sp.LogFields(fields...)
}

func (m *QuerySamplesRequest) GetCachingOptions() (res definitions.CachingOptions) { return }

func (m *QuerySamplesRequest) WithStartEnd(start, end time.Time) definitions.Request {
clone := *m
clone.Start = start
clone.End = end
return &clone
}

func (m *QuerySamplesRequest) WithStartEndForCache(start, end time.Time) resultscache.Request {
return m.WithStartEnd(start, end).(resultscache.Request)
}

func (m *QuerySamplesRequest) WithQuery(query string) definitions.Request {
clone := *m
clone.Query = query
return &clone
}

func (m *QuerySamplesRequest) LogToSpan(sp opentracing.Span) {
fields := []otlog.Field{
otlog.String("query", m.GetQuery()),
otlog.String("start", m.Start.String()),
otlog.String("end", m.End.String()),
otlog.String("step", time.Duration(m.Step).String()),
}
sp.LogFields(fields...)
}
46 changes: 0 additions & 46 deletions pkg/logproto/extensions.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package logproto

import (
"encoding/json"
"sort"
"strings"
"sync/atomic" //lint:ignore faillint we can't use go.uber.org/atomic with a protobuf struct without wrapping it.

"github.com/buger/jsonparser"
"github.com/cespare/xxhash/v2"
"github.com/dustin/go-humanize"
jsoniter "github.com/json-iterator/go"
Expand Down Expand Up @@ -190,47 +188,3 @@ func (m *ShardsResponse) Merge(other *ShardsResponse) {
m.ChunkGroups = append(m.ChunkGroups, other.ChunkGroups...)
m.Statistics.Merge(other.Statistics)
}

func NewPatternSeries(pattern string, samples []*PatternSample) *PatternSeries {
return &PatternSeries{Pattern: pattern, Samples: samples}
}

// UnmarshalJSON implements the json.Unmarshaler interface.
// QuerySamplesResponse json representation is different from the proto
func (r *QuerySamplesResponse) UnmarshalJSON(data []byte) error {
return jsonparser.ObjectEach(
data,
func(key, value []byte, dataType jsonparser.ValueType, offset int) error {
if string(key) == "data" {
var m []model.SampleStream
if err := json.Unmarshal(value, &m); err != nil {
return err
}
series := make([]Series, len(m))

for i, s := range m {
lbls := FromMetricsToLabels(s.Metric)

newSeries := Series{
Labels: s.Metric.String(),
StreamHash: lbls.Hash(),
Samples: make([]Sample, len(s.Values)),
}

for j, samplePair := range s.Values {
newSeries.Samples[j] = Sample{
Timestamp: samplePair.Timestamp.UnixNano(),
Value: float64(samplePair.Value),
}
}

series[i] = newSeries
}

r.Series = series
}

return nil
},
)
}
Loading
Loading