Skip to content

Commit

Permalink
Merge branch 'main' into fix-helm-release
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorwhitney authored Oct 16, 2024
2 parents b367f1b + 3834c74 commit 81e7aca
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 4 deletions.
19 changes: 19 additions & 0 deletions operator/internal/manifests/internal/config/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ limits_config:
max_streams_per_user: 0
max_line_size: 256000
max_entries_limit_per_query: 5000
discover_service_name: []
max_global_streams_per_user: 0
max_chunks_per_query: 2000000
max_query_length: 721h
Expand Down Expand Up @@ -353,6 +354,7 @@ limits_config:
max_streams_per_user: 0
max_line_size: 256000
max_entries_limit_per_query: 5000
discover_service_name: []
max_global_streams_per_user: 0
max_chunks_per_query: 2000000
max_query_length: 721h
Expand Down Expand Up @@ -779,6 +781,7 @@ limits_config:
max_streams_per_user: 0
max_line_size: 256000
max_entries_limit_per_query: 5000
discover_service_name: []
max_global_streams_per_user: 0
max_chunks_per_query: 2000000
max_query_length: 721h
Expand Down Expand Up @@ -1137,6 +1140,7 @@ limits_config:
max_streams_per_user: 0
max_line_size: 256000
max_entries_limit_per_query: 5000
discover_service_name: []
max_global_streams_per_user: 0
max_chunks_per_query: 2000000
max_query_length: 721h
Expand Down Expand Up @@ -1496,6 +1500,7 @@ limits_config:
max_streams_per_user: 0
max_line_size: 256000
max_entries_limit_per_query: 5000
discover_service_name: []
max_global_streams_per_user: 0
max_chunks_per_query: 2000000
max_query_length: 721h
Expand Down Expand Up @@ -1889,6 +1894,7 @@ limits_config:
max_streams_per_user: 0
max_line_size: 256000
max_entries_limit_per_query: 5000
discover_service_name: []
max_global_streams_per_user: 0
max_chunks_per_query: 2000000
max_query_length: 721h
Expand Down Expand Up @@ -2224,6 +2230,7 @@ limits_config:
max_streams_per_user: 0
max_line_size: 256000
max_entries_limit_per_query: 5000
discover_service_name: []
max_global_streams_per_user: 0
max_chunks_per_query: 2000000
max_query_length: 721h
Expand Down Expand Up @@ -2663,6 +2670,7 @@ limits_config:
max_streams_per_user: 0
max_line_size: 256000
max_entries_limit_per_query: 5000
discover_service_name: []
max_global_streams_per_user: 0
max_chunks_per_query: 2000000
max_query_length: 721h
Expand Down Expand Up @@ -2987,6 +2995,7 @@ limits_config:
max_streams_per_user: 0
max_line_size: 256000
max_entries_limit_per_query: 5000
discover_service_name: []
max_global_streams_per_user: 0
max_chunks_per_query: 2000000
max_query_length: 721h
Expand Down Expand Up @@ -3484,6 +3493,7 @@ limits_config:
max_streams_per_user: 0
max_line_size: 256000
max_entries_limit_per_query: 5000
discover_service_name: []
max_global_streams_per_user: 0
max_chunks_per_query: 2000000
max_query_length: 721h
Expand Down Expand Up @@ -3745,6 +3755,7 @@ limits_config:
max_streams_per_user: 0
max_line_size: 256000
max_entries_limit_per_query: 5000
discover_service_name: []
max_global_streams_per_user: 0
max_chunks_per_query: 2000000
max_query_length: 721h
Expand Down Expand Up @@ -4007,6 +4018,7 @@ limits_config:
max_streams_per_user: 0
max_line_size: 256000
max_entries_limit_per_query: 5000
discover_service_name: []
max_global_streams_per_user: 0
max_chunks_per_query: 2000000
max_query_length: 721h
Expand Down Expand Up @@ -4270,6 +4282,7 @@ limits_config:
max_streams_per_user: 0
max_line_size: 256000
max_entries_limit_per_query: 5000
discover_service_name: []
max_global_streams_per_user: 0
max_chunks_per_query: 2000000
max_query_length: 721h
Expand Down Expand Up @@ -4569,6 +4582,7 @@ limits_config:
max_streams_per_user: 0
max_line_size: 256000
max_entries_limit_per_query: 5000
discover_service_name: []
max_global_streams_per_user: 0
max_chunks_per_query: 2000000
max_query_length: 721h
Expand Down Expand Up @@ -4866,6 +4880,7 @@ limits_config:
max_streams_per_user: 0
max_line_size: 256000
max_entries_limit_per_query: 5000
discover_service_name: []
max_global_streams_per_user: 0
max_chunks_per_query: 2000000
max_query_length: 721h
Expand Down Expand Up @@ -5364,6 +5379,7 @@ limits_config:
max_streams_per_user: 0
max_line_size: 256000
max_entries_limit_per_query: 5000
discover_service_name: []
max_global_streams_per_user: 0
max_chunks_per_query: 2000000
max_query_length: 721h
Expand Down Expand Up @@ -5540,6 +5556,7 @@ limits_config:
max_streams_per_user: 0
max_line_size: 256000
max_entries_limit_per_query: 5000
discover_service_name: []
max_global_streams_per_user: 0
max_chunks_per_query: 2000000
max_query_length: 721h
Expand Down Expand Up @@ -5709,6 +5726,7 @@ limits_config:
max_streams_per_user: 0
max_line_size: 256000
max_entries_limit_per_query: 5000
discover_service_name: []
max_global_streams_per_user: 0
max_chunks_per_query: 2000000
max_query_length: 721h
Expand Down Expand Up @@ -6101,6 +6119,7 @@ limits_config:
max_streams_per_user: 0
max_line_size: 256000
max_entries_limit_per_query: 5000
discover_service_name: []
max_global_streams_per_user: 0
max_chunks_per_query: 2000000
max_query_length: 721h
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ limits_config:
max_streams_per_user: 0
max_line_size: {{ .Stack.Limits.Global.IngestionLimits.MaxLineSize }}
max_entries_limit_per_query: {{ .Stack.Limits.Global.QueryLimits.MaxEntriesLimitPerQuery }}
discover_service_name: []
max_global_streams_per_user: {{ .Stack.Limits.Global.IngestionLimits.MaxGlobalStreamsPerTenant }}
max_chunks_per_query: {{ .Stack.Limits.Global.QueryLimits.MaxChunksPerQuery }}
max_query_length: 721h
Expand Down
2 changes: 2 additions & 0 deletions pkg/logql/log/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,8 @@ func (j *JSONExpressionParser) Process(_ int64, line []byte, lbs *LabelsBuilder)
switch typ {
case jsonparser.Null:
lbs.Set(ParsedLabel, key, "")
case jsonparser.Object:
lbs.Set(ParsedLabel, key, string(data))
default:
lbs.Set(ParsedLabel, key, unescapeJSONString(data))
}
Expand Down
30 changes: 26 additions & 4 deletions pkg/logql/log/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -542,13 +542,35 @@ func TestJSONExpressionParser(t *testing.T) {
),
NoParserHints(),
},
{
"nested object with escaped value",
[]byte(`{"app":{"name":"great \"loki\""}`),
[]LabelExtractionExpr{
NewLabelExtractionExpr("app", `app`),
},
labels.FromStrings("foo", "bar"),
labels.FromStrings("foo", "bar",
"app", `{"name":"great \"loki\""}`,
),
NoParserHints(),
},
{
"field with escaped value inside the json string",
[]byte(`{"app":"{\"name\":\"great \\\"loki\\\"\"}"}`),
[]LabelExtractionExpr{
NewLabelExtractionExpr("app", `app`),
},
labels.FromStrings("foo", "bar"),
labels.FromStrings("foo", "bar",
"app", `{"name":"great \"loki\""}`,
),
NoParserHints(),
},
}
for _, tt := range tests {
j, err := NewJSONExpressionParser(tt.expressions)
if err != nil {
t.Fatalf("cannot create JSON expression parser: %s", err.Error())
}
t.Run(tt.name, func(t *testing.T) {
j, err := NewJSONExpressionParser(tt.expressions)
require.NoError(t, err, "cannot create JSON expression parser")
b := NewBaseLabelsBuilderWithGrouping(nil, tt.hints, false, false).ForLabels(tt.lbs, tt.lbs.Hash())
b.Reset()
_, _ = j.Process(0, tt.line, b)
Expand Down

0 comments on commit 81e7aca

Please sign in to comment.