diff --git a/CHANGELOG.md b/CHANGELOG.md index 5588e7c52f..7cb3a6e101 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,10 @@ * [9252](https://github.com/grafana/loki/pull/9252) **jeschkies**: Use un-escaped regex literal for string matching. * [9176](https://github.com/grafana/loki/pull/9176) **DylanGuedes**: Fix incorrect association of per-stream rate limit when sharding is enabled. +##### Changes + +* [9212](https://github.com/grafana/loki/pull/9212) **trevorwhitney**: Rename UsageReport to Analytics. The only external impact of this change is a change in the `-list-targets` output. + #### Promtail ##### Enhancements diff --git a/docs/sources/configuration/_index.md b/docs/sources/configuration/_index.md index f192688b67..94e5f6ba89 100644 --- a/docs/sources/configuration/_index.md +++ b/docs/sources/configuration/_index.md @@ -192,7 +192,7 @@ Pass the `-config.expand-env` flag at the command line to enable this way of set # Configuration for tracing. [tracing: ] -# Configuration for usage report. +# Configuration for analytics. [analytics: ] # Common configuration to be shared between multiple modules. If a more specific @@ -2962,7 +2962,7 @@ Configuration for `tracing`. ### analytics -Configuration for usage report. +Configuration for `analytics`. ```yaml # Enable anonymous usage reporting. diff --git a/pkg/usagestats/reporter.go b/pkg/analytics/reporter.go similarity index 99% rename from pkg/usagestats/reporter.go rename to pkg/analytics/reporter.go index 508380a57b..85050237d9 100644 --- a/pkg/usagestats/reporter.go +++ b/pkg/analytics/reporter.go @@ -1,4 +1,4 @@ -package usagestats +package analytics import ( "bytes" diff --git a/pkg/usagestats/reporter_test.go b/pkg/analytics/reporter_test.go similarity index 99% rename from pkg/usagestats/reporter_test.go rename to pkg/analytics/reporter_test.go index 5e21540141..183f2d8246 100644 --- a/pkg/usagestats/reporter_test.go +++ b/pkg/analytics/reporter_test.go @@ -1,4 +1,4 @@ -package usagestats +package analytics import ( "context" diff --git a/pkg/usagestats/seed.go b/pkg/analytics/seed.go similarity index 99% rename from pkg/usagestats/seed.go rename to pkg/analytics/seed.go index 1a98569504..d52d51e41d 100644 --- a/pkg/usagestats/seed.go +++ b/pkg/analytics/seed.go @@ -1,4 +1,4 @@ -package usagestats +package analytics import ( "fmt" diff --git a/pkg/usagestats/seed_test.go b/pkg/analytics/seed_test.go similarity index 99% rename from pkg/usagestats/seed_test.go rename to pkg/analytics/seed_test.go index fe9673888b..aae8381d4a 100644 --- a/pkg/usagestats/seed_test.go +++ b/pkg/analytics/seed_test.go @@ -1,4 +1,4 @@ -package usagestats +package analytics import ( "context" diff --git a/pkg/usagestats/stats.go b/pkg/analytics/stats.go similarity index 99% rename from pkg/usagestats/stats.go rename to pkg/analytics/stats.go index 6db6613d67..c1261f40ba 100644 --- a/pkg/usagestats/stats.go +++ b/pkg/analytics/stats.go @@ -1,4 +1,4 @@ -package usagestats +package analytics import ( "bytes" diff --git a/pkg/usagestats/stats_test.go b/pkg/analytics/stats_test.go similarity index 99% rename from pkg/usagestats/stats_test.go rename to pkg/analytics/stats_test.go index 093c890234..81458e2c33 100644 --- a/pkg/usagestats/stats_test.go +++ b/pkg/analytics/stats_test.go @@ -1,4 +1,4 @@ -package usagestats +package analytics import ( "runtime" diff --git a/pkg/distributor/distributor.go b/pkg/distributor/distributor.go index 7eeb3a8dad..64b377197b 100644 --- a/pkg/distributor/distributor.go +++ b/pkg/distributor/distributor.go @@ -31,6 +31,7 @@ import ( "github.com/weaveworks/common/user" "go.uber.org/atomic" + "github.com/grafana/loki/pkg/analytics" "github.com/grafana/loki/pkg/distributor/clientpool" "github.com/grafana/loki/pkg/distributor/shardstreams" "github.com/grafana/loki/pkg/ingester/client" @@ -38,7 +39,6 @@ import ( "github.com/grafana/loki/pkg/logql/syntax" "github.com/grafana/loki/pkg/runtime" "github.com/grafana/loki/pkg/storage/stores/indexshipper/compactor/retention" - "github.com/grafana/loki/pkg/usagestats" "github.com/grafana/loki/pkg/util" util_log "github.com/grafana/loki/pkg/util/log" "github.com/grafana/loki/pkg/validation" @@ -52,7 +52,7 @@ const ( var ( maxLabelCacheSize = 100000 - rfStats = usagestats.NewInt("distributor_replication_factor") + rfStats = analytics.NewInt("distributor_replication_factor") ) // Config for a Distributor. diff --git a/pkg/ingester/ingester.go b/pkg/ingester/ingester.go index 4c9acb73aa..c816fef3f4 100644 --- a/pkg/ingester/ingester.go +++ b/pkg/ingester/ingester.go @@ -26,6 +26,7 @@ import ( "github.com/prometheus/prometheus/model/labels" "google.golang.org/grpc/health/grpc_health_v1" + "github.com/grafana/loki/pkg/analytics" "github.com/grafana/loki/pkg/chunkenc" "github.com/grafana/loki/pkg/ingester/client" "github.com/grafana/loki/pkg/ingester/index" @@ -40,7 +41,6 @@ import ( "github.com/grafana/loki/pkg/storage/chunk/fetcher" "github.com/grafana/loki/pkg/storage/config" index_stats "github.com/grafana/loki/pkg/storage/stores/index/stats" - "github.com/grafana/loki/pkg/usagestats" "github.com/grafana/loki/pkg/util" util_log "github.com/grafana/loki/pkg/util/log" "github.com/grafana/loki/pkg/util/wal" @@ -62,10 +62,10 @@ var ( Name: "cortex_ingester_flush_queue_length", Help: "The total number of series pending in the flush queue.", }) - compressionStats = usagestats.NewString("ingester_compression") - targetSizeStats = usagestats.NewInt("ingester_target_size_bytes") - walStats = usagestats.NewString("ingester_wal") - activeTenantsStats = usagestats.NewInt("ingester_active_tenants") + compressionStats = analytics.NewString("ingester_compression") + targetSizeStats = analytics.NewInt("ingester_target_size_bytes") + walStats = analytics.NewString("ingester_wal") + activeTenantsStats = analytics.NewInt("ingester_active_tenants") ) // Config for an ingester. diff --git a/pkg/ingester/instance.go b/pkg/ingester/instance.go index 651730f2dd..9c872a5397 100644 --- a/pkg/ingester/instance.go +++ b/pkg/ingester/instance.go @@ -19,6 +19,7 @@ import ( "github.com/weaveworks/common/httpgrpc" "go.uber.org/atomic" + "github.com/grafana/loki/pkg/analytics" "github.com/grafana/loki/pkg/ingester/index" "github.com/grafana/loki/pkg/ingester/wal" "github.com/grafana/loki/pkg/iter" @@ -30,7 +31,6 @@ import ( "github.com/grafana/loki/pkg/runtime" "github.com/grafana/loki/pkg/storage/chunk" "github.com/grafana/loki/pkg/storage/config" - "github.com/grafana/loki/pkg/usagestats" "github.com/grafana/loki/pkg/util" "github.com/grafana/loki/pkg/util/deletion" util_log "github.com/grafana/loki/pkg/util/log" @@ -70,7 +70,7 @@ var ( Help: "The total number of streams removed per tenant.", }, []string{"tenant"}) - streamsCountStats = usagestats.NewInt("ingester_streams_count") + streamsCountStats = analytics.NewInt("ingester_streams_count") ) type instance struct { diff --git a/pkg/ingester/metrics.go b/pkg/ingester/metrics.go index c8e1038f87..96b2af61f3 100644 --- a/pkg/ingester/metrics.go +++ b/pkg/ingester/metrics.go @@ -4,7 +4,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" - "github.com/grafana/loki/pkg/usagestats" + "github.com/grafana/loki/pkg/analytics" "github.com/grafana/loki/pkg/validation" ) @@ -48,17 +48,17 @@ type ingesterMetrics struct { chunkEncodeTime prometheus.Histogram chunksFlushedPerReason *prometheus.CounterVec chunkLifespan prometheus.Histogram - flushedChunksStats *usagestats.Counter - flushedChunksBytesStats *usagestats.Statistics - flushedChunksLinesStats *usagestats.Statistics - flushedChunksAgeStats *usagestats.Statistics - flushedChunksLifespanStats *usagestats.Statistics - flushedChunksUtilizationStats *usagestats.Statistics + flushedChunksStats *analytics.Counter + flushedChunksBytesStats *analytics.Statistics + flushedChunksLinesStats *analytics.Statistics + flushedChunksAgeStats *analytics.Statistics + flushedChunksLifespanStats *analytics.Statistics + flushedChunksUtilizationStats *analytics.Statistics chunksCreatedTotal prometheus.Counter samplesPerChunk prometheus.Histogram blocksPerChunk prometheus.Histogram - chunkCreatedStats *usagestats.Counter + chunkCreatedStats *analytics.Counter // Shutdown marker for ingester scale down shutdownMarker prometheus.Gauge @@ -241,12 +241,12 @@ func newIngesterMetrics(r prometheus.Registerer) *ingesterMetrics { // 1h -> 8hr Buckets: prometheus.LinearBuckets(1, 1, 8), }), - flushedChunksStats: usagestats.NewCounter("ingester_flushed_chunks"), - flushedChunksBytesStats: usagestats.NewStatistics("ingester_flushed_chunks_bytes"), - flushedChunksLinesStats: usagestats.NewStatistics("ingester_flushed_chunks_lines"), - flushedChunksAgeStats: usagestats.NewStatistics("ingester_flushed_chunks_age_seconds"), - flushedChunksLifespanStats: usagestats.NewStatistics("ingester_flushed_chunks_lifespan_seconds"), - flushedChunksUtilizationStats: usagestats.NewStatistics("ingester_flushed_chunks_utilization"), + flushedChunksStats: analytics.NewCounter("ingester_flushed_chunks"), + flushedChunksBytesStats: analytics.NewStatistics("ingester_flushed_chunks_bytes"), + flushedChunksLinesStats: analytics.NewStatistics("ingester_flushed_chunks_lines"), + flushedChunksAgeStats: analytics.NewStatistics("ingester_flushed_chunks_age_seconds"), + flushedChunksLifespanStats: analytics.NewStatistics("ingester_flushed_chunks_lifespan_seconds"), + flushedChunksUtilizationStats: analytics.NewStatistics("ingester_flushed_chunks_utilization"), chunksCreatedTotal: promauto.With(r).NewCounter(prometheus.CounterOpts{ Namespace: "loki", Name: "ingester_chunks_created_total", @@ -269,7 +269,7 @@ func newIngesterMetrics(r prometheus.Registerer) *ingesterMetrics { Buckets: prometheus.ExponentialBuckets(5, 2, 6), }), - chunkCreatedStats: usagestats.NewCounter("ingester_chunk_created"), + chunkCreatedStats: analytics.NewCounter("ingester_chunk_created"), shutdownMarker: promauto.With(r).NewGauge(prometheus.GaugeOpts{ Namespace: "loki", diff --git a/pkg/loghttp/push/push.go b/pkg/loghttp/push/push.go index e826965152..de6665f991 100644 --- a/pkg/loghttp/push/push.go +++ b/pkg/loghttp/push/push.go @@ -17,10 +17,10 @@ import ( "github.com/prometheus/client_golang/prometheus/promauto" "github.com/prometheus/prometheus/model/labels" + "github.com/grafana/loki/pkg/analytics" "github.com/grafana/loki/pkg/loghttp" "github.com/grafana/loki/pkg/logproto" "github.com/grafana/loki/pkg/logql/syntax" - "github.com/grafana/loki/pkg/usagestats" "github.com/grafana/loki/pkg/util" loki_util "github.com/grafana/loki/pkg/util" "github.com/grafana/loki/pkg/util/unmarshal" @@ -41,8 +41,8 @@ var ( Help: "The total number of lines received per tenant", }, []string{"tenant"}) - bytesReceivedStats = usagestats.NewCounter("distributor_bytes_received") - linesReceivedStats = usagestats.NewCounter("distributor_lines_received") + bytesReceivedStats = analytics.NewCounter("distributor_bytes_received") + linesReceivedStats = analytics.NewCounter("distributor_lines_received") ) const applicationJSON = "application/json" diff --git a/pkg/logql/metrics.go b/pkg/logql/metrics.go index 7228d44ec7..d0e9f7b5c6 100644 --- a/pkg/logql/metrics.go +++ b/pkg/logql/metrics.go @@ -13,10 +13,10 @@ import ( "github.com/prometheus/client_golang/prometheus/promauto" promql_parser "github.com/prometheus/prometheus/promql/parser" + "github.com/grafana/loki/pkg/analytics" "github.com/grafana/loki/pkg/logql/syntax" "github.com/grafana/loki/pkg/logqlmodel" logql_stats "github.com/grafana/loki/pkg/logqlmodel/stats" - "github.com/grafana/loki/pkg/usagestats" "github.com/grafana/loki/pkg/util/httpreq" util_log "github.com/grafana/loki/pkg/util/log" ) @@ -72,10 +72,10 @@ var ( Help: "Total count of lines sent from ingesters while executing LogQL queries.", }) - bytePerSecondMetricUsage = usagestats.NewStatistics("query_metric_bytes_per_second") - bytePerSecondLogUsage = usagestats.NewStatistics("query_log_bytes_per_second") - linePerSecondMetricUsage = usagestats.NewStatistics("query_metric_lines_per_second") - linePerSecondLogUsage = usagestats.NewStatistics("query_log_lines_per_second") + bytePerSecondMetricUsage = analytics.NewStatistics("query_metric_bytes_per_second") + bytePerSecondLogUsage = analytics.NewStatistics("query_log_bytes_per_second") + linePerSecondMetricUsage = analytics.NewStatistics("query_metric_lines_per_second") + linePerSecondLogUsage = analytics.NewStatistics("query_log_lines_per_second") ) func RecordRangeAndInstantQueryMetrics( diff --git a/pkg/loki/loki.go b/pkg/loki/loki.go index 09d36e56bd..8e861ac4bf 100644 --- a/pkg/loki/loki.go +++ b/pkg/loki/loki.go @@ -29,6 +29,7 @@ import ( "github.com/weaveworks/common/signals" "google.golang.org/grpc/health/grpc_health_v1" + "github.com/grafana/loki/pkg/analytics" "github.com/grafana/loki/pkg/distributor" "github.com/grafana/loki/pkg/ingester" ingester_client "github.com/grafana/loki/pkg/ingester/client" @@ -54,7 +55,6 @@ import ( "github.com/grafana/loki/pkg/storage/stores/series/index" "github.com/grafana/loki/pkg/storage/stores/shipper/indexgateway" "github.com/grafana/loki/pkg/tracing" - "github.com/grafana/loki/pkg/usagestats" "github.com/grafana/loki/pkg/util" "github.com/grafana/loki/pkg/util/fakeauth" "github.com/grafana/loki/pkg/util/limiter" @@ -99,7 +99,7 @@ type Config struct { RuntimeConfig runtimeconfig.Config `yaml:"runtime_config,omitempty"` Tracing tracing.Config `yaml:"tracing"` - UsageReport usagestats.Config `yaml:"analytics"` + Analytics analytics.Config `yaml:"analytics"` LegacyReadTarget bool `yaml:"legacy_read_target,omitempty" doc:"hidden"` @@ -165,7 +165,7 @@ func (c *Config) RegisterFlags(f *flag.FlagSet) { c.Tracing.RegisterFlags(f) c.CompactorConfig.RegisterFlags(f) c.QueryScheduler.RegisterFlags(f) - c.UsageReport.RegisterFlags(f) + c.Analytics.RegisterFlags(f) } func (c *Config) registerServerFlagsWithChangedDefaultValues(fs *flag.FlagSet) { @@ -365,7 +365,7 @@ type Loki struct { compactor *compactor.Compactor QueryFrontEndTripperware basetripper.Tripperware queryScheduler *scheduler.Scheduler - usageReport *usagestats.Reporter + usageReport *analytics.Reporter indexGatewayRingManager *indexgateway.RingManager clientMetrics storage.ClientMetrics @@ -381,7 +381,7 @@ func New(cfg Config) (*Loki, error) { clientMetrics: storage.NewClientMetrics(), deleteClientMetrics: deletion.NewDeleteRequestClientMetrics(prometheus.DefaultRegisterer), } - usagestats.Edition("oss") + analytics.Edition("oss") loki.setupAuthMiddleware() loki.setupGRPCRecoveryMiddleware() if err := loki.setupModuleManager(); err != nil { @@ -632,7 +632,7 @@ func (t *Loki) setupModuleManager() error { mm.RegisterModule(IndexGateway, t.initIndexGateway) mm.RegisterModule(QueryScheduler, t.initQueryScheduler) mm.RegisterModule(IndexGatewayRing, t.initIndexGatewayRing, modules.UserInvisibleModule) - mm.RegisterModule(UsageReport, t.initUsageReport) + mm.RegisterModule(Analytics, t.initAnalytics) mm.RegisterModule(CacheGenerationLoader, t.initCacheGenerationLoader) mm.RegisterModule(All, nil) @@ -643,22 +643,22 @@ func (t *Loki) setupModuleManager() error { // Add dependencies deps := map[string][]string{ Ring: {RuntimeConfig, Server, MemberlistKV}, - UsageReport: {}, + Analytics: {}, Overrides: {RuntimeConfig}, OverridesExporter: {Overrides, Server}, TenantConfigs: {RuntimeConfig}, - Distributor: {Ring, Server, Overrides, TenantConfigs, UsageReport}, + Distributor: {Ring, Server, Overrides, TenantConfigs, Analytics}, Store: {Overrides, IndexGatewayRing}, - Ingester: {Store, Server, MemberlistKV, TenantConfigs, UsageReport}, - Querier: {Store, Ring, Server, IngesterQuerier, Overrides, UsageReport, CacheGenerationLoader}, + Ingester: {Store, Server, MemberlistKV, TenantConfigs, Analytics}, + Querier: {Store, Ring, Server, IngesterQuerier, Overrides, Analytics, CacheGenerationLoader}, QueryFrontendTripperware: {Server, Overrides, TenantConfigs}, - QueryFrontend: {QueryFrontendTripperware, UsageReport, CacheGenerationLoader}, - QueryScheduler: {Server, Overrides, MemberlistKV, UsageReport}, - Ruler: {Ring, Server, RulerStorage, RuleEvaluator, Overrides, TenantConfigs, UsageReport}, - RuleEvaluator: {Ring, Server, Store, IngesterQuerier, Overrides, TenantConfigs, UsageReport}, - TableManager: {Server, UsageReport}, - Compactor: {Server, Overrides, MemberlistKV, UsageReport}, - IndexGateway: {Server, Store, Overrides, UsageReport, MemberlistKV, IndexGatewayRing}, + QueryFrontend: {QueryFrontendTripperware, Analytics, CacheGenerationLoader}, + QueryScheduler: {Server, Overrides, MemberlistKV, Analytics}, + Ruler: {Ring, Server, RulerStorage, RuleEvaluator, Overrides, TenantConfigs, Analytics}, + RuleEvaluator: {Ring, Server, Store, IngesterQuerier, Overrides, TenantConfigs, Analytics}, + TableManager: {Server, Analytics}, + Compactor: {Server, Overrides, MemberlistKV, Analytics}, + IndexGateway: {Server, Store, Overrides, Analytics, MemberlistKV, IndexGatewayRing}, IngesterQuerier: {Ring}, IndexGatewayRing: {RuntimeConfig, Server, MemberlistKV}, All: {QueryScheduler, QueryFrontend, Querier, Ingester, Distributor, Ruler, Compactor}, @@ -753,7 +753,7 @@ func (t *Loki) setupModuleManager() error { t.ModuleManager = mm if t.isModuleActive(Ingester) { - if err := mm.AddDependency(UsageReport, Ring); err != nil { + if err := mm.AddDependency(Analytics, Ring); err != nil { return err } } diff --git a/pkg/loki/modules.go b/pkg/loki/modules.go index 929fff8270..d02e31b6d3 100644 --- a/pkg/loki/modules.go +++ b/pkg/loki/modules.go @@ -33,6 +33,7 @@ import ( "github.com/weaveworks/common/server" "github.com/weaveworks/common/user" + "github.com/grafana/loki/pkg/analytics" "github.com/grafana/loki/pkg/distributor" "github.com/grafana/loki/pkg/ingester" "github.com/grafana/loki/pkg/logproto" @@ -65,7 +66,6 @@ import ( boltdb_shipper_compactor "github.com/grafana/loki/pkg/storage/stores/shipper/index/compactor" "github.com/grafana/loki/pkg/storage/stores/shipper/indexgateway" "github.com/grafana/loki/pkg/storage/stores/tsdb" - "github.com/grafana/loki/pkg/usagestats" "github.com/grafana/loki/pkg/util/httpreq" "github.com/grafana/loki/pkg/util/limiter" util_log "github.com/grafana/loki/pkg/util/log" @@ -109,7 +109,7 @@ const ( Read string = "read" Write string = "write" Backend string = "backend" - UsageReport string = "usage-report" + Analytics string = "analytics" ) func (t *Loki) initServer() (services.Service, error) { @@ -1042,7 +1042,7 @@ func (t *Loki) initMemberlistKV() (services.Service, error) { t.Cfg.MemberlistKV.MetricsRegisterer = reg t.Cfg.MemberlistKV.Codecs = []codec.Codec{ ring.GetCodec(), - usagestats.JSONCodec, + analytics.JSONCodec, } dnsProviderReg := prometheus.WrapRegistererWithPrefix( @@ -1266,16 +1266,16 @@ func (t *Loki) initQueryLimitsTripperware() (services.Service, error) { return nil, nil } -func (t *Loki) initUsageReport() (services.Service, error) { - if !t.Cfg.UsageReport.Enabled { +func (t *Loki) initAnalytics() (services.Service, error) { + if !t.Cfg.Analytics.Enabled { return nil, nil } - t.Cfg.UsageReport.Leader = false + t.Cfg.Analytics.Leader = false if t.isModuleActive(Ingester) { - t.Cfg.UsageReport.Leader = true + t.Cfg.Analytics.Leader = true } - usagestats.Target(t.Cfg.Target.String()) + analytics.Target(t.Cfg.Target.String()) period, err := t.Cfg.SchemaConfig.SchemaForTime(model.Now()) if err != nil { return nil, err @@ -1286,7 +1286,7 @@ func (t *Loki) initUsageReport() (services.Service, error) { level.Info(util_log.Logger).Log("msg", "failed to initialize usage report", "err", err) return nil, nil } - ur, err := usagestats.NewReporter(t.Cfg.UsageReport, t.Cfg.Ingester.LifecyclerConfig.RingConfig.KVStore, objectClient, util_log.Logger, prometheus.DefaultRegisterer) + ur, err := analytics.NewReporter(t.Cfg.Analytics, t.Cfg.Ingester.LifecyclerConfig.RingConfig.KVStore, objectClient, util_log.Logger, prometheus.DefaultRegisterer) if err != nil { level.Info(util_log.Logger).Log("msg", "failed to initialize usage report", "err", err) return nil, nil diff --git a/pkg/storage/store.go b/pkg/storage/store.go index 62ffeab91e..95a683fb82 100644 --- a/pkg/storage/store.go +++ b/pkg/storage/store.go @@ -14,6 +14,7 @@ import ( "github.com/grafana/dskit/tenant" + "github.com/grafana/loki/pkg/analytics" "github.com/grafana/loki/pkg/iter" "github.com/grafana/loki/pkg/logproto" "github.com/grafana/loki/pkg/logql" @@ -32,15 +33,14 @@ import ( series_index "github.com/grafana/loki/pkg/storage/stores/series/index" "github.com/grafana/loki/pkg/storage/stores/shipper/indexgateway" "github.com/grafana/loki/pkg/storage/stores/tsdb" - "github.com/grafana/loki/pkg/usagestats" "github.com/grafana/loki/pkg/util" "github.com/grafana/loki/pkg/util/deletion" ) var ( - indexTypeStats = usagestats.NewString("store_index_type") - objectTypeStats = usagestats.NewString("store_object_type") - schemaStats = usagestats.NewString("store_schema") + indexTypeStats = analytics.NewString("store_index_type") + objectTypeStats = analytics.NewString("store_object_type") + schemaStats = analytics.NewString("store_schema") errWritingChunkUnsupported = errors.New("writing chunks is not supported while running store in read-only mode") ) diff --git a/pkg/storage/stores/indexshipper/compactor/compactor.go b/pkg/storage/stores/indexshipper/compactor/compactor.go index b1158462f2..174ad2367d 100644 --- a/pkg/storage/stores/indexshipper/compactor/compactor.go +++ b/pkg/storage/stores/indexshipper/compactor/compactor.go @@ -20,6 +20,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/model" + "github.com/grafana/loki/pkg/analytics" "github.com/grafana/loki/pkg/storage/chunk/client" "github.com/grafana/loki/pkg/storage/chunk/client/local" chunk_util "github.com/grafana/loki/pkg/storage/chunk/client/util" @@ -27,7 +28,6 @@ import ( "github.com/grafana/loki/pkg/storage/stores/indexshipper/compactor/deletion" "github.com/grafana/loki/pkg/storage/stores/indexshipper/compactor/retention" shipper_storage "github.com/grafana/loki/pkg/storage/stores/indexshipper/storage" - "github.com/grafana/loki/pkg/usagestats" "github.com/grafana/loki/pkg/util" "github.com/grafana/loki/pkg/util/filter" util_log "github.com/grafana/loki/pkg/util/log" @@ -66,8 +66,8 @@ const ( ) var ( - retentionEnabledStats = usagestats.NewString("compactor_retention_enabled") - defaultRetentionStats = usagestats.NewString("compactor_default_retention") + retentionEnabledStats = analytics.NewString("compactor_retention_enabled") + defaultRetentionStats = analytics.NewString("compactor_default_retention") ) type Config struct { diff --git a/tools/doc-generator/parse/root_blocks.go b/tools/doc-generator/parse/root_blocks.go index 7aa636b30c..7aee45b692 100644 --- a/tools/doc-generator/parse/root_blocks.go +++ b/tools/doc-generator/parse/root_blocks.go @@ -12,6 +12,7 @@ import ( "github.com/grafana/dskit/runtimeconfig" "github.com/weaveworks/common/server" + "github.com/grafana/loki/pkg/analytics" "github.com/grafana/loki/pkg/distributor" "github.com/grafana/loki/pkg/ingester" ingester_client "github.com/grafana/loki/pkg/ingester/client" @@ -37,7 +38,6 @@ import ( "github.com/grafana/loki/pkg/storage/stores/series/index" "github.com/grafana/loki/pkg/storage/stores/shipper/indexgateway" "github.com/grafana/loki/pkg/tracing" - "github.com/grafana/loki/pkg/usagestats" "github.com/grafana/loki/pkg/validation" ) @@ -144,8 +144,8 @@ var ( }, { Name: "analytics", - StructType: reflect.TypeOf(usagestats.Config{}), - Desc: "Configuration for usage report.", + StructType: reflect.TypeOf(analytics.Config{}), + Desc: "Configuration for analytics.", }, {