Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
4f68587
app/vlinsert/syslog: add support for accepting Syslog messages from U…
valyala Sep 4, 2025
00f0d5d
logsql: allow the -search.maxQueryTimeRange flag with d, w, and y suf…
func25 Sep 4, 2025
1089aa7
app/vlinsert: fix leaking json parser on error (#624)
func25 Sep 4, 2025
f409652
docs/victorialogs/CHANGELOG.md: add missing ":" after 00f0d5d9d87b5d9…
valyala Sep 4, 2025
76940bb
app/vlinsert/syslog: properly accept Syslog logs over SOCK_DGRAM Unix…
valyala Sep 8, 2025
c15434d
lib/logstorage: add `<W>` placeholder for `pattern_match(...)` filter
valyala Sep 8, 2025
aaefe8f
doc: re-order docs for VictoriaLogs (#640)
jiekun Sep 9, 2025
bdf9033
Fix typo in error message (#650)
damluk Sep 9, 2025
81a5cf2
lib/logstorage: avoid adding pipe "offset" with zero value (#634)
vadimalekseev Sep 10, 2025
2163794
app/vlselect: fix incorrect column order in select/logsql/hits respon…
func25 Sep 10, 2025
22eddfb
docs/victorialogs/README.md: refer posts from users who replaced Loki…
valyala Sep 10, 2025
dcf7085
docs/victorialogs/README.md: mention that VictoriaLogs fits well RUM …
valyala Sep 10, 2025
af51745
docs: reduce redirects in docs (#660)
makasim Sep 10, 2025
9c7b00b
docs: reduce redirects in docs (#661)
makasim Sep 10, 2025
db4e7a9
lib/logstorage: add more optimization cases for `offset` and `limit` …
valyala Sep 10, 2025
33fa3f2
lib/logstorage: properly return remote pipes from getRemoteAndLocalPi…
valyala Sep 10, 2025
b34d22b
app/vlselect/logsql: add a link to the issue, which explains why obta…
valyala Sep 10, 2025
9e0703b
build(deps): bump actions/setup-go from 5 to 6 (#636)
dependabot[bot] Sep 10, 2025
1495f9a
build(deps): bump actions/setup-node from 4 to 5 (#637)
dependabot[bot] Sep 10, 2025
0e2e1e6
docs/victorialogs/CHANGELOG.md: cut v1.33.0 release
valyala Sep 10, 2025
ebf1d5d
deployment: update VictoriaLogs Docker image tag from v1.32.0 to v1.33.0
valyala Sep 10, 2025
e9d0d7b
docs/victorialogs/CHANGELOG.md: typo fix: matchs -> matches
valyala Sep 10, 2025
130f5b8
lib/logstorage: drop `offset 0` pipe from the query, since it prevent…
valyala Sep 11, 2025
fb6dafb
lib/logstorage: take into account logs returned by union() pipe when …
valyala Sep 11, 2025
589e9ee
lib/logstorage: take into account the results of the `join` pipe at /…
valyala Sep 11, 2025
dbba346
lib/logstorage: removed misleading comment from the Query.dropPipesUn…
valyala Sep 11, 2025
faadf97
lib/logstorage: optimize queries containing offset+limit pipes for cl…
vadimalekseev Sep 11, 2025
e27c1da
lib/logstorage: add tests for `offset N | limit M` pipes optimization…
valyala Sep 11, 2025
cb18a3b
lib/logstorage: apply additional optimizations for offset and limit p…
valyala Sep 11, 2025
de0adac
ingesting: keep nanosecond precision in syslog RFC3339 timestamp (#639)
func25 Sep 11, 2025
98e3253
lib/logstorage: avoid memory allocation when parsing RFC3339 timestam…
valyala Sep 11, 2025
0fcf4c8
docs/victorialogs/CHANGELOG.md: cut v1.31.1 release
valyala Sep 11, 2025
d6464f7
app/vlstorage/{netinsert,netselect}: return an error instead of panic…
valyala Sep 11, 2025
efcb87c
vendor: update github.com/VictoriaMetrics/VictoriaMetrics from v0.0.0…
valyala Sep 11, 2025
ed2d683
deployment: update VictoriaLogs Docker image tag from v1.33.0 to v1.33.1
valyala Sep 11, 2025
2e68f37
docs/victorialogs/CHANGELOG.md: drop dots in the end of v1.33.0 and v…
valyala Sep 11, 2025
cf39bfb
docs: fix styling for displaying note in vmalert docs (#666)
hagen1778 Sep 11, 2025
4bd7dba
deployment/logs-benchmark: chore (#670)
hagen1778 Sep 12, 2025
61d34e0
docs: change relative link to absolute link (#674)
func25 Sep 16, 2025
a369b5a
docs: use canonical links (#677)
makasim Sep 16, 2025
a543de4
docs: use canonical links (#679)
makasim Sep 16, 2025
87fb24b
lib/logstorage: allow unquoted pipe names in LogsQL filters outside t…
valyala Sep 16, 2025
0784cac
dependency: port upstream changes (#678)
Haleygo Sep 17, 2025
aa26d67
lib/logstorage: add more tests for the https://github.com/VictoriaMet…
valyala Sep 17, 2025
fa9177a
vendor: update github.com/VictoriaMetrics/VictoriaMetrics to v0.0.0-2…
valyala Sep 17, 2025
2d4b343
app/vlselect: introduce -vmalert.proxyURL flag to proxy /select/vmale…
AndrewChubatiuk Sep 17, 2025
97ffbff
app/vmui: properly show tenant info if AccountID and ProjectID header…
AndrewChubatiuk Sep 17, 2025
1affba3
app/vmui: vmalert ui for logs (#522)
AndrewChubatiuk Sep 17, 2025
ecc5cb4
app/vlselect: introduce -storageNode.usernameFile flag (#685)
AndrewChubatiuk Sep 17, 2025
75cbaad
lib/logstorage: fix result_prefix handling unpack_* pipes (#684)
vadimalekseev Sep 17, 2025
57f3743
otel: fix typo in otel log processor name (#672)
yumosx Sep 17, 2025
1aaefd1
lib/logstorage: detect more cases with commonly occurred invalid filters
valyala Sep 17, 2025
d47efde
app/vlselect: limit the number of concurrently executed requests at /…
valyala Sep 17, 2025
73a649e
app/vlselect: add `-internalselect.maxConcurrentRequests` command-lin…
valyala Sep 17, 2025
c58c300
app/vlstorage/netselect: start processing query results from the give…
valyala Sep 17, 2025
8bd9599
lib/logstorage: cancel query pipes as soon as an error is triggered d…
valyala Sep 17, 2025
56b74b2
lib/logstorage: allow returning partial query responses from vlselect…
valyala Sep 17, 2025
70c2ac7
docs/victorialogs/logsql.md: typo fix in the example for the `allow_p…
valyala Sep 17, 2025
e0bc51b
lib/logstorage: follow-up for 75cbaad8174033e69d45c3ba7386e6d8c4cdbf85
valyala Sep 17, 2025
a2655c1
docs/victorialogs: follow-up for ecc5cb4195e324474f444fb3e3b044dbb6f2…
valyala Sep 17, 2025
88e9e3c
app/vmui: revert 1affba377bdefd7e6f5ea2845c5589a682ebdd46
valyala Sep 17, 2025
0463c2a
Revert "app/vmui: properly show tenant info if AccountID and ProjectI…
valyala Sep 17, 2025
ac32268
Revert "app/vlselect: introduce -vmalert.proxyURL flag to proxy /sele…
valyala Sep 17, 2025
5283603
lib/logstorage: reshard the shards imported from the remote side if t…
valyala Sep 18, 2025
be7d05b
lib/logstorage: add an ability to change the number of concurrent rea…
valyala Sep 18, 2025
d225e46
docs/victorialogs/logsql.md: use the proper link to parallel_readers …
valyala Sep 18, 2025
7f2d70a
lib/logstorage: add tests for re-sharding at importState for statsCou…
valyala Sep 18, 2025
04fa9cb
vlselect: handle canceled context correctly to avoid returning networ…
vadimalekseev Sep 19, 2025
8790c1f
lib/logstorage: format `start` and `end` boundaries inside the `_time…
valyala Sep 21, 2025
348f103
app/vlstorage/netselect/netselect.go: revert c58c300884693ce63371f2b8…
valyala Sep 21, 2025
f0680a6
lib/logstorage: fix TestQuery_AddTimeFilter() after the commit 8790c1…
valyala Sep 21, 2025
4956066
app/vlstorage: avoid binary search for the time range with the last N…
valyala Sep 22, 2025
ce13e0a
docs/victorialogs/CHANGELOG.md: cut v1.34.0 release
valyala Sep 22, 2025
dbb9ea1
docs/victorialogs/logsql.md: add a link to partial response docs from…
valyala Sep 22, 2025
b004228
docs/victorialogs/cluster.md: add links to data ingestion docs and qu…
valyala Sep 22, 2025
8244827
docs/victorialogs/cluster.md: typo fix: `can be build` -> `can be built`
valyala Sep 22, 2025
1f6d920
deployment: update VictoriaLogs Docker image tag from v1.33.1 to v1.34.0
valyala Sep 22, 2025
2e22646
docs/victorialogs/querying/README.md: typo fix: `aren` -> `are`
valyala Sep 22, 2025
7f66493
lib/logstorage: properly skip fields with more than max_values_per_fi…
valyala Sep 22, 2025
fe89524
docs/victorialogs/logsql.md: add missing `of` between `number` and `p…
valyala Sep 22, 2025
a8358c0
lib/logstorage: add `contains_common_case()` and `equals_common_case(…
valyala Sep 24, 2025
dffe6a9
build(deps): bump vite from 7.0.4 to 7.1.7 in /app/vmui/packages/vmui
dependabot[bot] Sep 25, 2025
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
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:

- name: Setup Go
id: go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: stable
cache: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-licenses.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

- name: Setup Go
id: go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: stable
cache: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

- name: Set up Go
id: go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
cache: false
go-version: stable
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:

- name: Setup Go
id: go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
cache: false
go-version: stable
Expand Down Expand Up @@ -71,7 +71,7 @@ jobs:

- name: Setup Go
id: go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
cache: false
go-version: stable
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:

- name: Setup Go
id: go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
cache: false
go-version: stable
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/vmui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
uses: actions/checkout@v5

- name: Setup Node
uses: actions/setup-node@v4
uses: actions/setup-node@v5
with:
node-version: '24.x'

Expand Down
4 changes: 3 additions & 1 deletion app/vlinsert/elasticsearch/elasticsearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,10 @@ func readBulkLine(lr *insertutil.LineReader, timeFields, msgFields []string, lmp
// Continue parsing next lines.
return true, nil
}

p := logstorage.GetJSONParser()
defer logstorage.PutJSONParser(p)

if err := p.ParseLogMessage(line); err != nil {
return false, fmt.Errorf("cannot parse json-encoded log entry: %w", err)
}
Expand All @@ -201,7 +204,6 @@ func readBulkLine(lr *insertutil.LineReader, timeFields, msgFields []string, lmp
}
logstorage.RenameField(p.Fields, msgFields, "_msg")
lmp.AddRow(ts, p.Fields, nil)
logstorage.PutJSONParser(p)

return true, nil
}
Expand Down
2 changes: 1 addition & 1 deletion app/vlinsert/opentelemetry/opentelemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func handleProtobuf(r *http.Request, w http.ResponseWriter) {

encoding := r.Header.Get("Content-Encoding")
err = protoparserutil.ReadUncompressedData(r.Body, encoding, maxRequestSize, func(data []byte) error {
lmp := cp.NewLogMessageProcessor("opentelelemtry_protobuf", false)
lmp := cp.NewLogMessageProcessor("opentelemetry_protobuf", false)
useDefaultStreamFields := len(cp.StreamFields) == 0
err := pushProtobufRequest(data, lmp, cp.MsgFields, useDefaultStreamFields)
lmp.MustClose()
Expand Down
309 changes: 203 additions & 106 deletions app/vlinsert/syslog/syslog.go

Large diffs are not rendered by default.

66 changes: 61 additions & 5 deletions app/vlselect/internalselect/internalselect.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package internalselect

import (
"context"
"flag"
"fmt"
"net/http"
"strconv"
Expand All @@ -21,10 +22,42 @@ import (
"github.com/VictoriaMetrics/VictoriaLogs/lib/logstorage"
)

var maxConcurrentRequests = flag.Int("internalselect.maxConcurrentRequests", 100, "The limit on the number of concurrent requests to /internal/select/* endpoints; "+
"other requests are put into the wait queue; see https://docs.victoriametrics.com/victorialogs/cluster/")

// RequestHandler processes requests to /internal/select/*
func RequestHandler(ctx context.Context, w http.ResponseWriter, r *http.Request) {
startTime := time.Now()

select {
case concurrencyLimitCh <- struct{}{}:
if d := time.Since(startTime); d > 100*time.Millisecond {
// Measure the wait duration for requests, which hit the concurrency limit and waited for more than 100 milliseconds to be executed.
concurrentRequestsWaitDuration.Update(d.Seconds())
}
requestHandler(ctx, w, r, startTime)
<-concurrencyLimitCh
case <-ctx.Done():
// Unconditionally measure the wait time until the the request is canceled by the client.
concurrentRequestsWaitDuration.UpdateDuration(startTime)
}
}

// Init initializes internalselect package.
func Init() {
concurrencyLimitCh = make(chan struct{}, *maxConcurrentRequests)
}

// Stop stops vlselect
func Stop() {
concurrencyLimitCh = nil
}

var concurrencyLimitCh chan struct{}

var concurrentRequestsWaitDuration = metrics.NewSummary(`vl_concurrent_internalselect_requests_wait_duration`)

func requestHandler(ctx context.Context, w http.ResponseWriter, r *http.Request, startTime time.Time) {
path := r.URL.Path
rh := requestHandlers[path]
if rh == nil {
Expand Down Expand Up @@ -277,14 +310,18 @@ type commonParams struct {
TenantIDs []logstorage.TenantID
Query *logstorage.Query

// Whether to disable compression of the response sent to the vlselect.
DisableCompression bool

// Whether to allow partial response when some of vlstorage nodes are unavailable.
AllowPartialResponse bool

// qs contains execution statistics for the Query.
qs logstorage.QueryStats
}

func (cp *commonParams) NewQueryContext(ctx context.Context) *logstorage.QueryContext {
return logstorage.NewQueryContext(ctx, &cp.qs, cp.TenantIDs, cp.Query)
return logstorage.NewQueryContext(ctx, &cp.qs, cp.TenantIDs, cp.Query, cp.AllowPartialResponse)
}

func (cp *commonParams) UpdatePerQueryStatsMetrics() {
Expand Down Expand Up @@ -314,17 +351,23 @@ func getCommonParams(r *http.Request, expectedProtocolVersion string) (*commonPa
return nil, fmt.Errorf("cannot unmarshal query=%q: %w", qStr, err)
}

s := r.FormValue("disable_compression")
disableCompression, err := strconv.ParseBool(s)
if err != nil {
return nil, fmt.Errorf("cannot parse disable_compression=%q: %w", s, err)
disableCompression := false
if err := getBoolFromRequest(&disableCompression, r, "disable_compression"); err != nil {
return nil, err
}

allowPartialResponse := false
if err := getBoolFromRequest(&allowPartialResponse, r, "allow_partial_response"); err != nil {
return nil, err
}

cp := &commonParams{
TenantIDs: tenantIDs,
Query: q,

DisableCompression: disableCompression,

AllowPartialResponse: allowPartialResponse,
}
return cp, nil
}
Expand Down Expand Up @@ -369,3 +412,16 @@ func getInt64FromRequest(r *http.Request, argName string) (int64, error) {
}
return n, nil
}

func getBoolFromRequest(dst *bool, r *http.Request, argName string) error {
s := r.FormValue(argName)
if s == "" {
return nil
}
b, err := strconv.ParseBool(s)
if err != nil {
return fmt.Errorf("cannot parse %s=%q as bool: %w", argName, s, err)
}
*dst = b
return nil
}
55 changes: 47 additions & 8 deletions app/vlselect/logsql/logsql.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (

"github.com/VictoriaMetrics/VictoriaMetrics/lib/atomicutil"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/bytesutil"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/flagutil"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/httpserver"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/httputil"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/logger"
Expand All @@ -29,8 +30,12 @@ import (
)

var (
maxQueryTimeRange = flag.Duration("search.maxQueryTimeRange", 0, "The maximum time range, which can be set in the query sent to querying APIs. "+
maxQueryTimeRange = flagutil.NewExtendedDuration("search.maxQueryTimeRange", "0", "The maximum time range, which can be set in the query sent to querying APIs. "+
"Queries with bigger time ranges are rejected. See https://docs.victoriametrics.com/victorialogs/querying/#resource-usage-limits")

allowPartialResponseFlag = flag.Bool("search.allowPartialResponse", false, "Whether to allow returning partial responses when some of vlstorage nodes "+
"from the -storageNode list are unavaialbe for querying. This flag works only for cluster setup of VictoriaLogs. "+
"See https://docs.victoriametrics.com/victorialogs/querying/#partial-responses")
)

// ProcessFacetsRequest handles /select/logsql/facets request.
Expand Down Expand Up @@ -79,9 +84,19 @@ func ProcessFacetsRequest(ctx context.Context, w http.ResponseWriter, r *http.Re
logger.Panicf("BUG: expecting 3 columns; got %d columns", len(columns))
}

fieldNames := columns[0].Values
fieldValues := columns[1].Values
hits := columns[2].Values
// Fetch columns by name to avoid relying on column ordering at VictoriaLogs cluster.
// See https://github.com/VictoriaMetrics/VictoriaLogs/issues/648
cFieldName := db.GetColumnByName("field_name")
cFieldValue := db.GetColumnByName("field_value")
cHits := db.GetColumnByName("hits")
if cFieldName == nil || cFieldValue == nil || cHits == nil {
logger.Panicf("BUG: missing expected columns for facets response: field_name=%v, field_value=%v, hits=%v",
cFieldName != nil, cFieldValue != nil, cHits != nil)
}

fieldNames := cFieldName.Values
fieldValues := cFieldValue.Values
hits := cHits.Values

bb := blockResultPool.Get()
for i := range fieldNames {
Expand Down Expand Up @@ -1093,6 +1108,10 @@ type commonArgs struct {
// tenantIDs is the list of tenantIDs to query.
tenantIDs []logstorage.TenantID

// Whether to allow partial response when some of vlstorage nodes are unavailable for querying.
// This option makes sense only for cluster setup when vlselect queries vlstorage nodes.
allowPartialResponse bool

// minTimestamp and maxTimestamp is the time range specified in the original query,
// without taking into account extra_filters and (start, end) query args.
minTimestamp int64
Expand All @@ -1103,7 +1122,7 @@ type commonArgs struct {
}

func (ca *commonArgs) newQueryContext(ctx context.Context) *logstorage.QueryContext {
return logstorage.NewQueryContext(ctx, &ca.qs, ca.tenantIDs, ca.q)
return logstorage.NewQueryContext(ctx, &ca.qs, ca.tenantIDs, ca.q, ca.allowPartialResponse)
}

func (ca *commonArgs) updatePerQueryStatsMetrics() {
Expand Down Expand Up @@ -1200,22 +1219,29 @@ func parseCommonArgs(r *http.Request) (*commonArgs, error) {
}
}

if *maxQueryTimeRange > 0 {
if maxRange := maxQueryTimeRange.Duration(); maxRange > 0 {
start, end := q.GetFilterTimeRange()
if end > start {
queryTimeRange := end - start
if queryTimeRange < 0 || queryTimeRange > maxQueryTimeRange.Nanoseconds() {
if queryTimeRange < 0 || queryTimeRange > maxRange.Nanoseconds() {
return nil, fmt.Errorf("too big time range selected: [%s, %s]; it cannot exceed -search.maxQueryTimeRange=%s; "+
"see https://docs.victoriametrics.com/victorialogs/querying/#resource-usage-limits",
timestampToString(start), timestampToString(end), *maxQueryTimeRange)
timestampToString(start), timestampToString(end), maxRange)
}
}
}

allowPartialResponse := *allowPartialResponseFlag
if err := getBoolFromRequest(&allowPartialResponse, r, "allow_partial_response"); err != nil {
return nil, err
}

ca := &commonArgs{
q: q,
tenantIDs: tenantIDs,

allowPartialResponse: allowPartialResponse,

minTimestamp: minTimestamp,
maxTimestamp: maxTimestamp,
}
Expand Down Expand Up @@ -1363,6 +1389,19 @@ func getPositiveInt(r *http.Request, argName string) (int, error) {
return n, nil
}

func getBoolFromRequest(dst *bool, r *http.Request, argName string) error {
s := r.FormValue(argName)
if s == "" {
return nil
}
b, err := strconv.ParseBool(s)
if err != nil {
return fmt.Errorf("cannot parse %s=%q as bool: %w", argName, s, err)
}
*dst = b
return nil
}

func writeRequestDuration(h http.Header, startTime time.Time) {
h.Set("Access-Control-Expose-Headers", "VL-Request-Duration-Seconds")
h.Set("VL-Request-Duration-Seconds", fmt.Sprintf("%.3f", time.Since(startTime).Seconds()))
Expand Down
5 changes: 5 additions & 0 deletions app/vlselect/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,15 @@ func getDefaultMaxConcurrentRequests() int {
// Init initializes vlselect
func Init() {
concurrencyLimitCh = make(chan struct{}, *maxConcurrentRequests)

internalselect.Init()
}

// Stop stops vlselect
func Stop() {
internalselect.Stop()

concurrencyLimitCh = nil
}

var concurrencyLimitCh chan struct{}
Expand Down
Loading