Skip to content

Commit

Permalink
chore: remove initial metric aggregation experiment (#13729)
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorwhitney authored Aug 12, 2024
1 parent 3c0e3e2 commit c6ab6b3
Show file tree
Hide file tree
Showing 55 changed files with 320 additions and 6,771 deletions.
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

0 comments on commit c6ab6b3

Please sign in to comment.