Preparing report...

Report for github.com/metrico/loki-apache

(v0.0.0-20211205161021-bd85d16d7be6)

A+    Excellent!    Found 178 issues across 417 files

Tweet

gofmt94%

Gofmt formats Go programs. We run gofmt -s on your code, where -s is for the "simplify" command


go_vet100%

go vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string.

No problems detected. Good job!


golint66%

Golint is a linter for Go source code.

    • pkg/logql/test_utils.go
    • Line 20: warning: exported function NewMockQuerier should have comment or be unexported (golint)
    • Line 27: warning: comment on exported type MockQuerier should be of the form "MockQuerier ..." (with optional leading article) (golint)
    • Line 33: warning: exported method MockQuerier.SelectLogs should have comment or be unexported (golint)
    • Line 153: warning: exported method MockQuerier.SelectSamples should have comment or be unexported (golint)
    • Line 208: warning: exported type MockDownstreamer should have comment or be unexported (golint)
    • Line 212: warning: exported method MockDownstreamer.Downstreamer should have comment or be unexported (golint)
    • Line 214: warning: exported method MockDownstreamer.Downstream should have comment or be unexported (golint)
    • pkg/promtail/client/fake/client.go
    • Line 19: warning: exported function New should have comment or be unexported (golint)
    • Line 43: warning: exported method Client.Chan should have comment or be unexported (golint)
    • Line 47: warning: exported method Client.Received should have comment or be unexported (golint)
    • pkg/storage/stores/shipper/util/queries.go
    • Line 15: warning: exported type TableQuerier should have comment or be unexported (golint)
    • Line 33: warning: exported function DoParallelQueries should have comment or be unexported (golint)
    • Line 64: warning: exported function NewIndexDeduper should have comment or be unexported (golint)
    • Line 71: warning: exported method IndexDeduper.Callback should have comment or be unexported (golint)
    • pkg/logentry/metric/gauges.go
    • Line 14: warning: exported const GaugeSet should have comment (or a comment on this block) or be unexported (golint)
    • Line 24: warning: exported type GaugeConfig should have comment or be unexported (golint)
    • pkg/logcli/output/raw.go
    • Line 17: warning: exported function NewRaw should have comment or be unexported (golint)
    • Line 24: warning: comment on exported method RawOutput.FormatAndPrintln should be of the form "FormatAndPrintln ..." (golint)
    • pkg/querier/queryrange/downstreamer.go
    • Line 19: warning: exported const DefaultDownstreamConcurrency should have comment (or a comment on this block) or be unexported (golint)
    • Line 22: warning: exported type DownstreamHandler should have comment or be unexported (golint)
    • Line 26: warning: exported function ParamsToLokiRequest should have comment or be unexported (golint)
    • Line 38: warning: exported method DownstreamHandler.Downstreamer should have comment or be unexported (golint)
    • Line 153: warning: exported function ResponseToResult should have comment or be unexported (golint)
    • pkg/querier/queryrange/codec.go
    • Line 36: warning: exported method LokiRequest.GetEnd should have comment or be unexported (golint)
    • Line 40: warning: exported method LokiRequest.GetStart should have comment or be unexported (golint)
    • Line 44: warning: exported method LokiRequest.WithStartEnd should have comment or be unexported (golint)
    • Line 51: warning: exported method LokiRequest.WithQuery should have comment or be unexported (golint)
    • Line 57: warning: exported method LokiRequest.WithShards should have comment or be unexported (golint)
    • Line 63: warning: exported method LokiRequest.LogToSpan should have comment or be unexported (golint)
    • Line 75: warning: exported method LokiRequest.GetCachingOptions should have comment or be unexported (golint)
    • Line 77: warning: exported method LokiSeriesRequest.GetEnd should have comment or be unexported (golint)
    • Line 81: warning: exported method LokiSeriesRequest.GetStart should have comment or be unexported (golint)
    • Line 85: warning: exported method LokiSeriesRequest.WithStartEnd should have comment or be unexported (golint)
    • Line 92: warning: exported method LokiSeriesRequest.WithQuery should have comment or be unexported (golint)
    • Line 97: warning: exported method LokiSeriesRequest.GetQuery should have comment or be unexported (golint)
    • Line 101: warning: exported method LokiSeriesRequest.GetStep should have comment or be unexported (golint)
    • Line 105: warning: exported method LokiSeriesRequest.LogToSpan should have comment or be unexported (golint)
    • Line 113: warning: exported method LokiSeriesRequest.GetCachingOptions should have comment or be unexported (golint)
    • Line 115: warning: exported method LokiLabelNamesRequest.GetEnd should have comment or be unexported (golint)
    • Line 119: warning: exported method LokiLabelNamesRequest.GetStart should have comment or be unexported (golint)
    • Line 123: warning: exported method LokiLabelNamesRequest.WithStartEnd should have comment or be unexported (golint)
    • Line 130: warning: exported method LokiLabelNamesRequest.WithQuery should have comment or be unexported (golint)
    • Line 135: warning: exported method LokiLabelNamesRequest.GetQuery should have comment or be unexported (golint)
    • Line 139: warning: exported method LokiLabelNamesRequest.GetStep should have comment or be unexported (golint)
    • Line 143: warning: exported method LokiLabelNamesRequest.LogToSpan should have comment or be unexported (golint)
    • Line 150: warning: exported method LokiLabelNamesRequest.GetCachingOptions should have comment or be unexported (golint)
    • Line 638: warning: exported method LokiResponse.Count should have comment or be unexported (golint)
    • cmd/docker-driver/http.go
    • Line 14: warning: exported type StartLoggingRequest should have comment or be unexported (golint)
    • Line 19: warning: exported type StopLoggingRequest should have comment or be unexported (golint)
    • Line 23: warning: exported type CapabilitiesResponse should have comment or be unexported (golint)
    • Line 28: warning: exported type ReadLogsRequest should have comment or be unexported (golint)
    • pkg/logql/ast.go
    • Line 27: warning: exported type QueryParams should have comment or be unexported (golint)
    • Line 39: warning: comment on exported type SelectLogParams should be of the form "SelectLogParams ..." (with optional leading article) (golint)
    • Line 50: warning: exported type SelectSampleParams should have comment or be unexported (golint)
    • Line 85: warning: comment on exported type Pipeline should be of the form "Pipeline ..." (with optional leading article) (golint)
    • Line 85: warning: comment on exported type SampleExtractor should be of the form "SampleExtractor ..." (with optional leading article) (golint)
    • Line 106: warning: exported method MultiStageExpr.Pipeline should have comment or be unexported (golint)
    • Line 528: warning: comment on exported const OpTypeSum should be of the form "OpTypeSum ..." (golint)
    • Line 530: warning: exported const OpTypeAvg should have comment (or a comment on this block) or be unexported (golint)
    • Line 539: warning: comment on exported const OpRangeTypeCount should be of the form "OpRangeTypeCount ..." (golint)
    • Line 553: warning: comment on exported const OpTypeOr should be of the form "OpTypeOr ..." (golint)
    • Line 558: warning: comment on exported const OpTypeAdd should be of the form "OpTypeAdd ..." (golint)
    • Line 566: warning: comment on exported const OpTypeCmpEQ should be of the form "OpTypeCmpEQ ..." (golint)
    • Line 574: warning: comment on exported const OpParserTypeJSON should be of the form "OpParserTypeJSON ..." (golint)
    • Line 586: warning: comment on exported const OpConvBytes should be of the form "OpConvBytes ..." (golint)
    • Line 594: warning: exported function IsComparisonOperator should have comment or be unexported (golint)
    • Line 814: warning: exported type BinOpOptions should have comment or be unexported (golint)
    • pkg/promtail/positions/positions.go
    • Line 29: warning: comment on exported method Config.RegisterFlagsWithPrefix should be of the form "RegisterFlagsWithPrefix ..." (golint)
    • Line 57: warning: exported type Positions should have comment or be unexported (golint)
    • pkg/promtail/targets/file/filetarget.go
    • Line 24: warning: exported const FilenameLabel should have comment (or a comment on this block) or be unexported (golint)
    • Line 33: warning: comment on exported method Config.RegisterFlagsWithPrefix should be of the form "RegisterFlagsWithPrefix ..." (golint)
    • pkg/ruler/manager/compat.go
    • Line 86: warning: exported function MemstoreTenantManager should have comment or be unexported (golint)
    • Line 131: warning: exported type GroupLoader should have comment or be unexported (golint)
    • Line 133: warning: exported method GroupLoader.Parse should have comment or be unexported (golint)
    • Line 142: warning: exported method GroupLoader.Load should have comment or be unexported (golint)
    • Line 174: warning: exported function ValidateGroups should have comment or be unexported (golint)
    • pkg/storage/stores/shipper/shipper_index_client.go
    • Line 42: warning: exported const StorageKeyPrefix should have comment (or a comment on this block) or be unexported (golint)
    • Line 56: warning: exported type Config should have comment or be unexported (golint)
    • Line 78: warning: exported type Shipper should have comment or be unexported (golint)
    • Line 189: warning: exported method Shipper.Stop should have comment or be unexported (golint)
    • Line 205: warning: exported method Shipper.NewWriteBatch should have comment or be unexported (golint)
    • Line 209: warning: exported method Shipper.BatchWrite should have comment or be unexported (golint)
    • Line 215: warning: exported method Shipper.QueryPages should have comment or be unexported (golint)
    • pkg/util/log.go
    • Line 12: warning: exported type LogAdapter should have comment or be unexported (golint)
    • Line 16: warning: exported function NewLogAdapter should have comment or be unexported (golint)
    • pkg/logql/log/filter.go
    • Line 18: warning: comment on exported type FiltererFunc should be of the form "FiltererFunc ..." (with optional leading article) (golint)
    • Line 21: warning: exported method FiltererFunc.Filter should have comment or be unexported (golint)
    • pkg/canary/reader/reader.go
    • Line 45: warning: exported type LokiReader should have comment or be unexported (golint)
    • Line 50: warning: exported type Reader should have comment or be unexported (golint)
    • Line 73: warning: exported function NewReader should have comment or be unexported (golint)
    • Line 133: warning: exported method Reader.Stop should have comment or be unexported (golint)
    • pkg/logql/shardmapper.go
    • Line 30: warning: exported function NewShardingMetrics should have comment or be unexported (golint)
    • Line 85: warning: exported function NewShardMapper should have comment or be unexported (golint)
    • Line 95: warning: exported type ShardMapper should have comment or be unexported (golint)
    • Line 100: warning: exported method ShardMapper.Parse should have comment or be unexported (golint)
    • Line 128: warning: exported method ShardMapper.Map should have comment or be unexported (golint)
    • pkg/canary/writer/writer.go
    • Line 12: warning: exported const LogEntry should have comment (or a comment on this block) or be unexported (golint)
    • Line 15: warning: exported type Writer should have comment or be unexported (golint)
    • Line 26: warning: exported function NewWriter should have comment or be unexported (golint)
    • Line 43: warning: exported method Writer.Stop should have comment or be unexported (golint)
    • pkg/ingester/checkpoint.go
    • Line 144: warning: exported type SeriesWithErr should have comment or be unexported (golint)
    • Line 149: warning: exported type SeriesIter should have comment or be unexported (golint)
    • Line 290: warning: exported type CheckpointWriter should have comment or be unexported (golint)
    • Line 304: warning: exported type WALCheckpointWriter should have comment or be unexported (golint)
    • Line 315: warning: exported method WALCheckpointWriter.Advance should have comment or be unexported (golint)
    • Line 480: warning: exported method WALCheckpointWriter.Close should have comment or be unexported (golint)
    • Line 518: warning: exported type Checkpointer should have comment or be unexported (golint)
    • Line 527: warning: exported function NewCheckpointer should have comment or be unexported (golint)
    • Line 537: warning: exported method Checkpointer.PerformCheckpoint should have comment or be unexported (golint)
    • Line 602: warning: exported method Checkpointer.Run should have comment or be unexported (golint)
    • pkg/storage/stores/util/object_client.go
    • Line 11: warning: exported type PrefixedObjectClient should have comment or be unexported (golint)
    • Line 16: warning: exported method PrefixedObjectClient.PutObject should have comment or be unexported (golint)
    • Line 20: warning: exported method PrefixedObjectClient.GetObject should have comment or be unexported (golint)
    • Line 24: warning: exported method PrefixedObjectClient.List should have comment or be unexported (golint)
    • Line 41: warning: exported method PrefixedObjectClient.DeleteObject should have comment or be unexported (golint)
    • Line 45: warning: exported method PrefixedObjectClient.Stop should have comment or be unexported (golint)
    • Line 48: warning: exported function NewPrefixedObjectClient should have comment or be unexported (golint)
    • pkg/logproto/types.go
    • Line 23: warning: exported method Stream.Marshal should have comment or be unexported (golint)
    • Line 33: warning: exported method Stream.MarshalTo should have comment or be unexported (golint)
    • Line 59: warning: exported method Entry.Marshal should have comment or be unexported (golint)
    • Line 69: warning: exported method Entry.MarshalTo should have comment or be unexported (golint)
    • Line 91: warning: exported method Stream.Unmarshal should have comment or be unexported (golint)
    • Line 211: warning: exported method Entry.Unmarshal should have comment or be unexported (golint)
    • Line 330: warning: exported method Stream.Size should have comment or be unexported (golint)
    • Line 349: warning: exported method Entry.Size should have comment or be unexported (golint)
    • Line 364: warning: exported method Stream.Equal should have comment or be unexported (golint)
    • Line 396: warning: exported method Entry.Equal should have comment or be unexported (golint)
    • pkg/promtail/targets/stdin/stdin_target_manager.go
    • Line 50: warning: exported type Shutdownable should have comment or be unexported (golint)
    • Line 54: warning: comment on exported type StdinTargetManager should be of the form "StdinTargetManager ..." (with optional leading article) (golint)
    • Line 60: warning: exported function NewStdinTargetManager should have comment or be unexported (golint)
    • Line 89: warning: exported method StdinTargetManager.Ready should have comment or be unexported (golint)
    • Line 92: warning: exported method StdinTargetManager.Stop should have comment or be unexported (golint)
    • Line 93: warning: exported method StdinTargetManager.ActiveTargets should have comment or be unexported (golint)
    • Line 94: warning: exported method StdinTargetManager.AllTargets should have comment or be unexported (golint)
    • pkg/ingester/encoding.go
    • Line 20: warning: comment on exported const WALRecordEntries should be of the form "WALRecordEntries ..." (golint)
    • Line 38: warning: exported method WALRecord.IsEmpty should have comment or be unexported (golint)
    • Line 42: warning: exported method WALRecord.Reset should have comment or be unexported (golint)
    • Line 55: warning: exported method WALRecord.AddEntries should have comment or be unexported (golint)
    • Line 68: warning: exported type RefEntries should have comment or be unexported (golint)
    • Line 202: warning: exported function EncWith should have comment or be unexported (golint)
    • Line 212: warning: exported method Encbuf.PutString should have comment or be unexported (golint)
    • Line 214: warning: exported function DecWith should have comment or be unexported (golint)
    • Line 224: warning: exported method Decbuf.Bytes should have comment or be unexported (golint)
    • pkg/promtail/client/client.go
    • Line 36: warning: comment on exported const ReservedLabelTenantID should be of the form "ReservedLabelTenantID ..." (golint)
    • Line 40: warning: exported const LatencyLabel should have comment (or a comment on this block) or be unexported (golint)
    • Line 44: warning: exported var UserAgent should have comment or be unexported (golint)
    • pkg/logql/log/label_filter.go
    • Line 63: warning: exported type BinaryLabelFilter should have comment or be unexported (golint)
    • Line 86: warning: exported method BinaryLabelFilter.Process should have comment or be unexported (golint)
    • Line 98: warning: exported method BinaryLabelFilter.RequiredLabelNames should have comment or be unexported (golint)
    • Line 140: warning: exported type BytesLabelFilter should have comment or be unexported (golint)
    • Line 156: warning: exported method BytesLabelFilter.Process should have comment or be unexported (golint)
    • Line 190: warning: exported method BytesLabelFilter.RequiredLabelNames should have comment or be unexported (golint)
    • Line 204: warning: exported type DurationLabelFilter should have comment or be unexported (golint)
    • Line 220: warning: exported method DurationLabelFilter.Process should have comment or be unexported (golint)
    • Line 254: warning: exported method DurationLabelFilter.RequiredLabelNames should have comment or be unexported (golint)
    • Line 262: warning: exported type NumericLabelFilter should have comment or be unexported (golint)
    • Line 278: warning: exported method NumericLabelFilter.Process should have comment or be unexported (golint)
    • Line 313: warning: exported method NumericLabelFilter.RequiredLabelNames should have comment or be unexported (golint)
    • Line 321: warning: exported type StringLabelFilter should have comment or be unexported (golint)
    • Line 334: warning: exported method StringLabelFilter.Process should have comment or be unexported (golint)
    • Line 342: warning: exported method StringLabelFilter.RequiredLabelNames should have comment or be unexported (golint)
    • pkg/chunkenc/pool.go
    • Line 34: warning: exported var Lz4_64k should have comment or be unexported (golint)
    • Line 210: warning: comment on exported type ZstdPool should be of the form "ZstdPool ..." (with optional leading article) (golint)
    • Line 259: warning: exported type LZ4Pool should have comment or be unexported (golint)
    • Line 307: warning: exported type SnappyPool should have comment or be unexported (golint)
    • Line 342: warning: exported type NoopPool should have comment or be unexported (golint)
    • pkg/ruler/ruler.go
    • Line 14: warning: exported type Config should have comment or be unexported (golint)
    • Line 18: warning: comment on exported method Config.Validate should be of the form "Validate ..." (golint)
    • Line 26: warning: exported function NewRuler should have comment or be unexported (golint)
    • cmd/promtail/main.go
    • Line 33: warning: exported type Config should have comment or be unexported (golint)
    • Line 43: warning: exported method Config.RegisterFlags should have comment or be unexported (golint)
    • pkg/logql/metrics.go
    • Line 19: warning: exported const QueryTypeMetric should have comment (or a comment on this block) or be unexported (golint)
    • Line 68: warning: exported function RecordMetrics should have comment or be unexported (golint)
    • Line 118: warning: exported function QueryType should have comment or be unexported (golint)
    • pkg/logql/log/labels.go
    • Line 99: warning: comment on exported function NewBaseLabelsBuilder should be of the form "NewBaseLabelsBuilder ..." (golint)
    • pkg/storage/stores/shipper/compactor/compactor.go
    • Line 26: warning: exported type Config should have comment or be unexported (golint)
    • Line 39: warning: exported method Config.IsDefaults should have comment or be unexported (golint)
    • Line 45: warning: exported type Compactor should have comment or be unexported (golint)
    • Line 54: warning: exported function NewCompactor should have comment or be unexported (golint)
    • Line 102: warning: exported method Compactor.Run should have comment or be unexported (golint)
    • pkg/distributor/validator.go
    • Line 16: warning: exported type Validator should have comment or be unexported (golint)
    • Line 20: warning: exported function NewValidator should have comment or be unexported (golint)
    • Line 82: warning: comment on exported method Validator.ValidateLabels should be of the form "ValidateLabels ..." (golint)
    • pkg/ingester/flush.go
    • Line 111: warning: comment on exported method Ingester.InitFlushQueues should be of the form "InitFlushQueues ..." (golint)
    • pkg/cfg/cfg.go
    • Line 26: warning: exported var ErrNotPointer should have comment or be unexported (golint)
    • pkg/logql/log/json_expr.go
    • Line 3: warning: exported type JSONExpression should have comment or be unexported (golint)
    • Line 8: warning: exported function NewJSONExpr should have comment or be unexported (golint)
    • pkg/logql/sharding.go
    • Line 113: warning: exported type Shards should have comment or be unexported (golint)
    • Line 115: warning: exported method Shards.Encode should have comment or be unexported (golint)
    • Line 140: warning: exported type Downstreamable should have comment or be unexported (golint)
    • Line 144: warning: exported type DownstreamQuery should have comment or be unexported (golint)
    • Line 188: warning: exported function NewDownstreamEvaluator should have comment or be unexported (golint)
    • Line 195: warning: comment on exported method DownstreamEvaluator.StepEvaluator should be of the form "StepEvaluator ..." (golint)
    • pkg/storage/stores/shipper/testutil/testutil.go
    • Line 23: warning: exported function AddRecordsToDB should have comment or be unexported (golint)
    • Line 36: warning: exported function AddRecordsToBatch should have comment or be unexported (golint)
    • Line 43: warning: exported type SingleTableQuerier should have comment or be unexported (golint)
    • Line 47: warning: exported function TestSingleTableQuery should have comment or be unexported (golint)
    • Line 58: warning: exported type SingleDBQuerier should have comment or be unexported (golint)
    • Line 62: warning: exported function TestSingleDBQuery should have comment or be unexported (golint)
    • Line 73: warning: exported type MultiTableQuerier should have comment or be unexported (golint)
    • Line 77: warning: exported function TestMultiTableQuery should have comment or be unexported (golint)
    • Line 108: warning: exported function CompareDBs should have comment or be unexported (golint)
    • Line 132: warning: exported type DBRecords should have comment or be unexported (golint)
    • Line 136: warning: exported function SetupDBTablesAtPath should have comment or be unexported (golint)
    • Line 175: warning: exported function DecompressFile should have comment or be unexported (golint)
    • pkg/logql/log/jsonexpr/lexer.go
    • Line 11: warning: exported type Scanner should have comment or be unexported (golint)
    • Line 18: warning: exported function NewScanner should have comment or be unexported (golint)
    • Line 30: warning: exported method Scanner.Reduced should have comment or be unexported (golint)
    • Line 37: warning: exported method Scanner.Lex should have comment or be unexported (golint)
    • pkg/ingester/ingester.go
    • Line 104: warning: exported method Config.Validate should have comment or be unexported (golint)
    • Line 632: warning: comment on exported method Ingester.CheckReady should be of the form "CheckReady ..." (golint)
    • pkg/iter/cache.go
    • Line 7: warning: exported type CacheEntryIterator should have comment or be unexported (golint)
    • Line 87: warning: exported type CacheSampleIterator should have comment or be unexported (golint)
    • Line 103: warning: comment on exported function NewCachedSampleIterator should be of the form "NewCachedSampleIterator ..." (golint)
    • pkg/logql/engine.go
    • Line 79: warning: exported method EngineOpts.RegisterFlagsWithPrefix should have comment or be unexported (golint)
    • Line 306: warning: exported function PopulateMatrixFromScalar should have comment or be unexported (golint)
    • pkg/logentry/stages/timestamp.go
    • Line 19: warning: exported const ErrEmptyTimestampStageConfig should have comment (or a comment on this block) or be unexported (golint)
    • Line 42: warning: exported var TimestampActionOnFailureOptions should have comment or be unexported (golint)
    • pkg/querier/queryrange/extensions.go
    • Line 16: warning: exported method LokiLabelNamesResponse.GetHeaders should have comment or be unexported (golint)
    • Line 23: warning: exported method LokiSeriesResponse.GetHeaders should have comment or be unexported (golint)
    • Line 30: warning: exported method LokiPromResponse.GetHeaders should have comment or be unexported (golint)
    • Line 37: warning: exported method LokiResponse.GetHeaders should have comment or be unexported (golint)
    • pkg/util/flagext/bytesize.go
    • Line 17: warning: exported method ByteSize.Set should have comment or be unexported (golint)
    • Line 29: warning: exported method ByteSize.Get should have comment or be unexported (golint)
    • Line 33: warning: exported method ByteSize.Val should have comment or be unexported (golint)
    • Line 37: warning: comment on exported method ByteSize.UnmarshalYAML should be of the form "UnmarshalYAML ..." (golint)
    • pkg/logcli/client/client.go
    • Line 46: warning: comment on exported type DefaultClient should be of the form "DefaultClient ..." (with optional leading article) (golint)
    • Line 118: warning: exported method DefaultClient.Series should have comment or be unexported (golint)
    • Line 144: warning: exported method DefaultClient.GetOrgID should have comment or be unexported (golint)
    • pkg/canary/comparator/comparator.go
    • Line 17: warning: exported const ErrOutOfOrderEntry should have comment (or a comment on this block) or be unexported (golint)
    • Line 94: warning: exported type Comparator should have comment or be unexported (golint)
    • Line 128: warning: exported function NewComparator should have comment or be unexported (golint)
    • Line 181: warning: exported method Comparator.Stop should have comment or be unexported (golint)
    • Line 242: warning: exported method Comparator.Size should have comment or be unexported (golint)
    • pkg/chunkenc/memchunk.go
    • Line 515: warning: exported method MemChunk.CheckpointSize should have comment or be unexported (golint)
    • Line 519: warning: exported function MemchunkFromCheckpoint should have comment or be unexported (golint)
    • Line 723: warning: comment on exported method MemChunk.SampleIterator should be of the form "SampleIterator ..." (golint)
    • pkg/storage/stores/shipper/util/util.go
    • Line 20: warning: exported type StorageClient should have comment or be unexported (golint)
    • Line 60: warning: exported function GetDBNameFromObjectKey should have comment or be unexported (golint)
    • Line 72: warning: exported function BuildObjectKey should have comment or be unexported (golint)
    • Line 84: warning: exported function CompressFile should have comment or be unexported (golint)
    • pkg/logproto/timestamp.go
    • Line 59: warning: exported function SizeOfStdTime should have comment or be unexported (golint)
    • Line 67: warning: exported function StdTimeMarshalTo should have comment or be unexported (golint)
    • Line 75: warning: exported function StdTimeUnmarshal should have comment or be unexported (golint)
    • pkg/querier/querier.go
    • Line 80: warning: comment on exported method Querier.SelectLogs should be of the form "SelectLogs ..." (golint)
    • Line 123: warning: exported method Querier.SelectSamples should have comment or be unexported (golint)
    • pkg/ingester/wal.go
    • Line 26: warning: exported type WALConfig should have comment or be unexported (golint)
    • Line 34: warning: exported method WALConfig.Validate should have comment or be unexported (golint)
    • pkg/promtail/targets/gcplog/target.go
    • Line 70: warning: context.Context should be the first parameter of a function (golint)
    • Line 135: warning: comment on exported method GcplogTarget.Type should be of the form "Type ..." (golint)
    • Line 140: warning: exported method GcplogTarget.Ready should have comment or be unexported (golint)
    • Line 144: warning: exported method GcplogTarget.DiscoveredLabels should have comment or be unexported (golint)
    • Line 148: warning: exported method GcplogTarget.Labels should have comment or be unexported (golint)
    • Line 152: warning: exported method GcplogTarget.Details should have comment or be unexported (golint)
    • Line 156: warning: exported method GcplogTarget.Stop should have comment or be unexported (golint)
    • pkg/tracing/config.go
    • Line 7: warning: exported type Config should have comment or be unexported (golint)
    • Line 11: warning: exported method Config.RegisterFlags should have comment or be unexported (golint)
    • pkg/util/validation/limits.go
    • Line 11: warning: comment on exported const LocalIngestionRateStrategy should be of the form "LocalIngestionRateStrategy ..." (golint)
    • Line 14: warning: comment on exported const GlobalIngestionRateStrategy should be of the form "GlobalIngestionRateStrategy ..." (golint)
    • Line 220: warning: comment on exported method Overrides.MaxQuerySeries should be of the form "MaxQuerySeries ..." (golint)
    • Line 266: warning: exported method Overrides.MaxCacheFreshness should have comment or be unexported (golint)
    • pkg/storage/async_store.go
    • Line 17: warning: exported type IngesterQuerier should have comment or be unexported (golint)
    • Line 31: warning: exported function NewAsyncStore should have comment or be unexported (golint)
    • Line 39: warning: exported method AsyncStore.GetChunkRefs should have comment or be unexported (golint)
    • cmd/loki/main.go
    • Line 30: warning: exported type Config should have comment or be unexported (golint)
    • Line 40: warning: exported method Config.RegisterFlags should have comment or be unexported (golint)
    • pkg/storage/lazy_chunk.go
    • Line 157: warning: exported function IsBlockOverlapping should have comment or be unexported (golint)
    • Line 172: warning: exported method LazyChunk.IsOverlapping should have comment or be unexported (golint)
    • pkg/storage/stores/shipper/uploads/table.go
    • Line 28: warning: comment on exported const ShardDBsByDuration should be of the form "ShardDBsByDuration ..." (golint)
    • Line 40: warning: exported type BoltDBIndexClient should have comment or be unexported (golint)
    • Line 45: warning: exported type StorageClient should have comment or be unexported (golint)
    • Line 112: warning: exported method Table.Snapshot should have comment or be unexported (golint)
    • Line 300: warning: exported method Table.RemoveSnapshotDB should have comment or be unexported (golint)
    • pkg/loghttp/query.go
    • Line 82: warning: exported method Streams.ToProto should have comment or be unexported (golint)
    • Line 151: warning: exported method Scalar.MarshalJSON should have comment or be unexported (golint)
    • Line 155: warning: exported method Scalar.UnmarshalJSON should have comment or be unexported (golint)
    • pkg/ingester/client/client.go
    • Line 29: warning: exported type HealthAndIngesterClient should have comment or be unexported (golint)
    • Line 35: warning: exported type ClosableHealthAndIngesterClient should have comment or be unexported (golint)
    • pkg/promtail/server/server.go
    • Line 33: warning: exported type Server should have comment or be unexported (golint)
    • Line 55: warning: comment on exported method Config.RegisterFlagsWithPrefix should be of the form "RegisterFlagsWithPrefix ..." (golint)
    • pkg/storage/stores/shipper/downloads/table_manager.go
    • Line 30: warning: exported type Config should have comment or be unexported (golint)
    • Line 37: warning: exported type TableManager should have comment or be unexported (golint)
    • Line 51: warning: exported function NewTableManager should have comment or be unexported (golint)
    • Line 121: warning: exported method TableManager.Stop should have comment or be unexported (golint)
    • Line 133: warning: exported method TableManager.QueryPages should have comment or be unexported (golint)
    • pkg/logql/log/fmt.go
    • Line 61: warning: exported type LineFormatter should have comment or be unexported (golint)
    • Line 78: warning: exported method LineFormatter.Process should have comment or be unexported (golint)
    • Line 90: warning: exported method LineFormatter.RequiredLabelNames should have comment or be unexported (golint)
    • Line 176: warning: exported type LabelsFormatter should have comment or be unexported (golint)
    • Line 222: warning: exported method LabelsFormatter.Process should have comment or be unexported (golint)
    • Line 246: warning: exported method LabelsFormatter.RequiredLabelNames should have comment or be unexported (golint)
    • pkg/logentry/stages/stage.go
    • Line 15: warning: exported const StageTypeJSON should have comment (or a comment on this block) or be unexported (golint)
    • Line 42: warning: exported type Entry should have comment or be unexported (golint)
    • pkg/ingester/limiter.go
    • Line 32: warning: exported method Limiter.Disable should have comment or be unexported (golint)
    • Line 38: warning: exported method Limiter.Enable should have comment or be unexported (golint)
    • pkg/promtail/targets/gcplog/targetmanager.go
    • Line 15: warning: comment on exported type GcplogTargetManager should be of the form "GcplogTargetManager ..." (with optional leading article) (golint)
    • Line 21: warning: exported function NewGcplogTargetManager should have comment or be unexported (golint)
    • Line 51: warning: exported method GcplogTargetManager.Ready should have comment or be unexported (golint)
    • Line 60: warning: exported method GcplogTargetManager.Stop should have comment or be unexported (golint)
    • Line 68: warning: exported method GcplogTargetManager.ActiveTargets should have comment or be unexported (golint)
    • Line 73: warning: exported method GcplogTargetManager.AllTargets should have comment or be unexported (golint)
    • pkg/iter/sample_iterator.go
    • Line 43: warning: exported function NewPeekingSampleIterator should have comment or be unexported (golint)
    • Line 297: warning: comment on exported function NewSampleQueryClientIterator should be of the form "NewSampleQueryClientIterator ..." (golint)
    • Line 488: warning: comment on exported function ReadSampleBatch should be of the form "ReadSampleBatch ..." (golint)
    • pkg/logentry/metric/counters.go
    • Line 14: warning: exported const CounterInc should have comment (or a comment on this block) or be unexported (golint)
    • Line 24: warning: exported type CounterConfig should have comment or be unexported (golint)
    • cmd/fluent-bit/out_grafana_loki.go
    • Line 38: warning: comment on exported function FLBPluginRegister should be of the form "FLBPluginRegister ..." (golint)
    • Line 43: warning: comment on exported function FLBPluginInit should be of the form "FLBPluginInit ..." (golint)
    • Line 99: warning: comment on exported function FLBPluginFlushCtx should be of the form "FLBPluginFlushCtx ..." (golint)
    • Line 146: warning: comment on exported function FLBPluginExit should be of the form "FLBPluginExit ..." (golint)
    • pkg/logql/matrix.go
    • Line 24: warning: exported function NewMatrixStepper should have comment or be unexported (golint)
    • Line 34: warning: exported method MatrixStepper.Next should have comment or be unexported (golint)
    • Line 67: warning: exported method MatrixStepper.Close should have comment or be unexported (golint)
    • pkg/storage/stores/shipper/downloads/table.go
    • Line 36: warning: exported type BoltDBIndexClient should have comment or be unexported (golint)
    • Line 40: warning: exported type StorageClient should have comment or be unexported (golint)
    • Line 63: warning: exported function NewTable should have comment or be unexported (golint)
    • Line 248: warning: comment on exported method Table.Close should be of the form "Close ..." (golint)
    • Line 314: warning: comment on exported method Table.CleanupAllDBs should be of the form "CleanupAllDBs ..." (golint)
    • Line 342: warning: exported method Table.UpdateLastUsedAt should have comment or be unexported (golint)
    • pkg/util/list.go
    • Line 3: warning: exported function MergeStringLists should have comment or be unexported (golint)
    • Line 17: warning: exported function MergeStringPair should have comment or be unexported (golint)
    • pkg/util/string.go
    • Line 9: warning: exported function StringRef should have comment or be unexported (golint)
    • Line 13: warning: exported function StringSliceContains should have comment or be unexported (golint)
    • pkg/logql/log/pipeline.go
    • Line 80: warning: exported type StageFunc should have comment or be unexported (golint)
    • Line 85: warning: exported method StageFunc.Process should have comment or be unexported (golint)
    • Line 89: warning: exported method StageFunc.RequiredLabelNames should have comment or be unexported (golint)
    • pkg/logproto/extensions.go
    • Line 5: warning: comment on exported type SeriesIdentifiers should be of the form "SeriesIdentifiers ..." (with optional leading article) (golint)
    • Line 15: warning: exported type Streams should have comment or be unexported (golint)
    • pkg/logql/log/parser.go
    • Line 21: warning: exported const PackedEntryKey should have comment (or a comment on this block) or be unexported (golint)
    • Line 32: warning: exported type JSONParser should have comment or be unexported (golint)
    • Line 44: warning: exported method JSONParser.Process should have comment or be unexported (golint)
    • Line 147: warning: exported method JSONParser.RequiredLabelNames should have comment or be unexported (golint)
    • Line 177: warning: exported type RegexpParser should have comment or be unexported (golint)
    • Line 223: warning: exported method RegexpParser.Process should have comment or be unexported (golint)
    • Line 232: warning: exported method RegexpParser.RequiredLabelNames should have comment or be unexported (golint)
    • Line 234: warning: exported type LogfmtParser should have comment or be unexported (golint)
    • Line 246: warning: exported method LogfmtParser.Process should have comment or be unexported (golint)
    • Line 266: warning: exported method LogfmtParser.RequiredLabelNames should have comment or be unexported (golint)
    • Line 268: warning: exported type JSONExpressionParser should have comment or be unexported (golint)
    • Line 272: warning: exported function NewJSONExpressionParser should have comment or be unexported (golint)
    • Line 293: warning: exported method JSONExpressionParser.Process should have comment or be unexported (golint)
    • Line 316: warning: exported method JSONExpressionParser.RequiredLabelNames should have comment or be unexported (golint)
    • Line 318: warning: exported type UnpackParser should have comment or be unexported (golint)
    • Line 332: warning: exported method UnpackParser.RequiredLabelNames should have comment or be unexported (golint)
    • Line 334: warning: exported method UnpackParser.Process should have comment or be unexported (golint)
    • pkg/logql/stats/context.go
    • Line 74: warning: exported method Summary.Log should have comment or be unexported (golint)
    • Line 198: warning: exported method Result.Merge should have comment or be unexported (golint)
    • Line 241: warning: exported function GetResult should have comment or be unexported (golint)
    • Line 249: warning: comment on exported function GetMutex should be of the form "GetMutex ..." (golint)
    • pkg/logql/evaluator.go
    • Line 20: warning: exported type QueryRangeType should have comment or be unexported (golint)
    • Line 23: warning: exported var InstantType should have comment or be unexported (golint)
    • Line 39: warning: exported function NewLiteralParams should have comment or be unexported (golint)
    • Line 70: warning: exported method LiteralParams.Copy should have comment or be unexported (golint)
    • Line 72: warning: comment on exported method LiteralParams.Query should be of the form "Query ..." (golint)
    • Line 110: warning: exported type SampleEvaluator should have comment or be unexported (golint)
    • Line 116: warning: exported type SampleEvaluatorFunc should have comment or be unexported (golint)
    • Line 118: warning: exported method SampleEvaluatorFunc.StepEvaluator should have comment or be unexported (golint)
    • Line 122: warning: exported type EntryEvaluator should have comment or be unexported (golint)
    • Line 132: warning: exported type DefaultEvaluator should have comment or be unexported (golint)
    • Line 145: warning: exported method DefaultEvaluator.Iterator should have comment or be unexported (golint)
    • Line 164: warning: exported method DefaultEvaluator.StepEvaluator should have comment or be unexported (golint)
    • pkg/ingester/instance.go
    • Line 634: warning: exported method OnceSwitch.Get should have comment or be unexported (golint)
    • Line 638: warning: exported method OnceSwitch.Trigger should have comment or be unexported (golint)
    • pkg/promtail/api/types.go
    • Line 17: warning: exported type InstrumentedEntryHandler should have comment or be unexported (golint)
    • Line 38: warning: exported method EntryMiddlewareFunc.Wrap should have comment or be unexported (golint)
    • pkg/util/runtime/config.go
    • Line 3: warning: exported type Config should have comment or be unexported (golint)
    • Line 28: warning: comment on exported function NewTenantConfigs should be of the form "NewTenantConfigs ..." (golint)
    • Line 46: warning: exported method TenantConfigs.LogStreamCreation should have comment or be unexported (golint)
    • Line 50: warning: exported method TenantConfigs.LogPushRequest should have comment or be unexported (golint)
    • Line 54: warning: exported method TenantConfigs.LogPushRequestStreams should have comment or be unexported (golint)
    • pkg/storage/batch.go
    • Line 28: warning: exported type ChunkMetrics should have comment or be unexported (golint)
    • Line 40: warning: exported function NewChunkMetrics should have comment or be unexported (golint)
    • pkg/ruler/manager/memstore.go
    • Line 23: warning: exported const AlertForStateMetricName should have comment (or a comment on this block) or be unexported (golint)
    • Line 28: warning: exported type NoopAppender should have comment or be unexported (golint)
    • Line 30: warning: exported method NoopAppender.Appender should have comment or be unexported (golint)
    • Line 31: warning: exported method NoopAppender.Add should have comment or be unexported (golint)
    • Line 32: warning: exported method NoopAppender.AddFast should have comment or be unexported (golint)
    • Line 35: warning: exported method NoopAppender.Commit should have comment or be unexported (golint)
    • Line 36: warning: exported method NoopAppender.Rollback should have comment or be unexported (golint)
    • Line 38: warning: exported function ForStateMetric should have comment or be unexported (golint)
    • Line 45: warning: exported type Metrics should have comment or be unexported (golint)
    • Line 51: warning: exported function NewMetrics should have comment or be unexported (golint)
    • Line 68: warning: exported type RuleIter should have comment or be unexported (golint)
    • Line 72: warning: exported type MemStore should have comment or be unexported (golint)
    • Line 86: warning: exported function NewMemStore should have comment or be unexported (golint)
    • Line 102: warning: comment on exported method MemStore.Start should be of the form "Start ..." (golint)
    • Line 109: warning: exported method MemStore.Stop should have comment or be unexported (golint)
    • Line 173: warning: comment on exported method MemStore.Querier should be of the form "Querier ..." (golint)
    • Line 319: warning: exported type RuleCache should have comment or be unexported (golint)
    • Line 325: warning: exported function NewRuleCache should have comment or be unexported (golint)
    • Line 332: warning: exported method RuleCache.Set should have comment or be unexported (golint)
    • pkg/util/query_string_builder.go
    • Line 8: warning: exported type QueryStringBuilder should have comment or be unexported (golint)
    • Line 12: warning: exported function NewQueryStringBuilder should have comment or be unexported (golint)
    • Line 18: warning: exported method QueryStringBuilder.SetString should have comment or be unexported (golint)
    • Line 22: warning: exported method QueryStringBuilder.SetStringArray should have comment or be unexported (golint)
    • Line 28: warning: exported method QueryStringBuilder.SetInt should have comment or be unexported (golint)
    • Line 32: warning: exported method QueryStringBuilder.SetInt32 should have comment or be unexported (golint)
    • Line 36: warning: exported method QueryStringBuilder.SetFloat should have comment or be unexported (golint)
    • Line 40: warning: exported method QueryStringBuilder.SetFloat32 should have comment or be unexported (golint)
    • pkg/querier/queryrange/roundtrip.go
    • Line 194: warning: exported const QueryRangeOp should have comment (or a comment on this block) or be unexported (golint)
    • Line 258: warning: comment on exported function NewSeriesTripperware should be of the form "NewSeriesTripperware ..." (golint)
    • pkg/querier/queryrange/split_by_interval.go
    • Line 29: warning: exported type SplitByMetrics should have comment or be unexported (golint)
    • Line 33: warning: exported function NewSplitByMetrics should have comment or be unexported (golint)
    • Line 52: warning: exported type Splitter should have comment or be unexported (golint)
    • pkg/loki/loki.go
    • Line 197: warning: exported var GRPCStreamAuthInterceptor should have comment or be unexported (golint)
    • pkg/logentry/stages/tenant.go
    • Line 17: warning: exported const ErrTenantStageEmptySourceOrValue should have comment (or a comment on this block) or be unexported (golint)
    • Line 26: warning: exported type TenantConfig should have comment or be unexported (golint)
    • pkg/logql/log/metrics_extraction.go
    • Line 15: warning: exported const ConvertBytes should have comment (or a comment on this block) or be unexported (golint)
    • Line 24: warning: exported var CountExtractor should have comment or be unexported (golint)
    • pkg/util/mock.go
    • Line 7: warning: exported type ExtendedMock should have comment or be unexported (golint)
    • Line 11: warning: exported method ExtendedMock.GetMockedCallsByMethod should have comment or be unexported (golint)
    • pkg/loghttp/series.go
    • Line 11: warning: exported type SeriesResponse should have comment or be unexported (golint)
    • Line 16: warning: exported function ParseSeriesQuery should have comment or be unexported (golint)
    • pkg/storage/stores/shipper/uploads/table_manager.go
    • Line 25: warning: exported type Config should have comment or be unexported (golint)
    • Line 32: warning: exported type TableManager should have comment or be unexported (golint)
    • Line 46: warning: exported function NewTableManager should have comment or be unexported (golint)
    • Line 86: warning: exported method TableManager.Stop should have comment or be unexported (golint)
    • Line 95: warning: exported method TableManager.QueryPages should have comment or be unexported (golint)
    • Line 122: warning: exported method TableManager.BatchWrite should have comment or be unexported (golint)
    • pkg/querier/ingester_querier.go
    • Line 38: warning: exported function NewIngesterQuerier should have comment or be unexported (golint)
    • Line 102: warning: exported method IngesterQuerier.SelectLogs should have comment or be unexported (golint)
    • Line 117: warning: exported method IngesterQuerier.SelectSample should have comment or be unexported (golint)
    • Line 132: warning: exported method IngesterQuerier.Label should have comment or be unexported (golint)
    • Line 148: warning: exported method IngesterQuerier.Tail should have comment or be unexported (golint)
    • Line 164: warning: exported method IngesterQuerier.TailDisconnectedIngesters should have comment or be unexported (golint)
    • Line 213: warning: exported method IngesterQuerier.Series should have comment or be unexported (golint)
    • Line 228: warning: exported method IngesterQuerier.TailersCount should have comment or be unexported (golint)
    • Line 268: warning: exported method IngesterQuerier.GetChunkIDs should have comment or be unexported (golint)
    • pkg/ingester/recovery.go
    • Line 19: warning: exported type WALReader should have comment or be unexported (golint)
    • Line 26: warning: exported type NoopWALReader should have comment or be unexported (golint)
    • Line 28: warning: exported method NoopWALReader.Next should have comment or be unexported (golint)
    • Line 29: warning: exported method NoopWALReader.Err should have comment or be unexported (golint)
    • Line 30: warning: exported method NoopWALReader.Record should have comment or be unexported (golint)
    • Line 31: warning: exported method NoopWALReader.Close should have comment or be unexported (golint)
    • Line 85: warning: exported type Recoverer should have comment or be unexported (golint)
    • Line 207: warning: exported function RecoverWAL should have comment or be unexported (golint)
    • Line 271: warning: exported function RecoverCheckpoint should have comment or be unexported (golint)

gocyclo92%

Gocyclo calculates cyclomatic complexities of functions in Go source code. The cyclomatic complexity of a function is calculated according to the following rules: 1 is the base complexity of a function +1 for each 'if', 'for', 'case', '&&' or '||' Go Report Card warns on functions with cyclomatic complexity > 15.

    • cmd/migrate/main.go
    • Line 38: warning: cyclomatic complexity 25 of function main() is high (> 15) (gocyclo)
    • Line 290: warning: cyclomatic complexity 19 of function (*chunkMover).moveChunks() is high (> 15) (gocyclo)
    • pkg/logql/evaluator.go
    • Line 622: warning: cyclomatic complexity 64 of function mergeBinOp() is high (> 15) (gocyclo)
    • Line 213: warning: cyclomatic complexity 47 of function vectorAggEvaluator() is high (> 15) (gocyclo)
    • Line 511: warning: cyclomatic complexity 18 of function binOpStepEvaluator() is high (> 15) (gocyclo)
    • pkg/logproto/types.go
    • Line 211: warning: cyclomatic complexity 32 of function (*Entry).Unmarshal() is high (> 15) (gocyclo)
    • Line 91: warning: cyclomatic complexity 32 of function (*Stream).Unmarshal() is high (> 15) (gocyclo)
    • pkg/promtail/targets/file/filetarget_test.go
    • Line 505: warning: cyclomatic complexity 27 of function TestFileTargetSync() is high (> 15) (gocyclo)
    • Line 297: warning: cyclomatic complexity 18 of function TestResumesWhereLeftOff() is high (> 15) (gocyclo)
    • Line 404: warning: cyclomatic complexity 18 of function TestGlobWithMultipleFiles() is high (> 15) (gocyclo)
    • Line 200: warning: cyclomatic complexity 18 of function TestFileRolls() is high (> 15) (gocyclo)
    • Line 108: warning: cyclomatic complexity 16 of function TestWatchEntireDirectory() is high (> 15) (gocyclo)
    • pkg/logcli/query/query.go
    • Line 258: warning: cyclomatic complexity 24 of function (*Query).printStream() is high (> 15) (gocyclo)
    • Line 60: warning: cyclomatic complexity 16 of function (*Query).DoQuery() is high (> 15) (gocyclo)
    • cmd/docker-driver/config.go
    • Line 135: warning: cyclomatic complexity 40 of function parseConfig() is high (> 15) (gocyclo)
    • Line 91: warning: cyclomatic complexity 30 of function validateDriverOpt() is high (> 15) (gocyclo)
    • pkg/logentry/stages/drop.go
    • Line 119: warning: cyclomatic complexity 31 of function (*dropStage).shouldDrop() is high (> 15) (gocyclo)
    • Line 44: warning: cyclomatic complexity 16 of function validateDropConfig() is high (> 15) (gocyclo)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!