Skip to content

Commit

Permalink
Merge pull request #14051 from prometheus/resolve-conflicts-2.52
Browse files Browse the repository at this point in the history
Merge `release-2.52` back to main
  • Loading branch information
ArthurSens committed May 3, 2024
2 parents c10186e + 2e323af commit 93be830
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 16 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
* [BUGFIX] OTLP: Don't generate target_info unless at least one identifying label is defined. #13991
* [BUGFIX] OTLP: Don't generate target_info unless there are metrics. #13991

## 2.52.0-rc.1 / 2024-05-03

* [BUGFIX] API: Fix missing comma during JSON encoding of API results. #14047

## 2.52.0-rc.0 / 2024-04-22

* [CHANGE] TSDB: Fix the predicate checking for blocks which are beyond the retention period to include the ones right at the retention boundary. #9633
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.52.0-rc.0
2.52.0-rc.1
10 changes: 8 additions & 2 deletions web/api/v1/json_codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,11 @@ func labelsIsEmpty(ptr unsafe.Pointer) bool {
func unsafeMarshalVectorJSON(ptr unsafe.Pointer, stream *jsoniter.Stream) {
v := *((*promql.Vector)(ptr))
stream.WriteArrayStart()
for _, s := range v {
for i, s := range v {
marshalSampleJSON(s, stream)
if i != len(v)-1 {
stream.WriteMore()
}
}
stream.WriteArrayEnd()
}
Expand All @@ -251,8 +254,11 @@ func unsafeMarshalVectorJSON(ptr unsafe.Pointer, stream *jsoniter.Stream) {
func unsafeMarshalMatrixJSON(ptr unsafe.Pointer, stream *jsoniter.Stream) {
m := *((*promql.Matrix)(ptr))
stream.WriteArrayStart()
for _, s := range m {
for i, s := range m {
marshalSeriesJSON(s, stream)
if i != len(m)-1 {
stream.WriteMore()
}
}
stream.WriteArrayEnd()
}
34 changes: 34 additions & 0 deletions web/api/v1/json_codec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,40 @@ func TestJsonCodec_Encode(t *testing.T) {
response interface{}
expected string
}{
{
response: &QueryData{
ResultType: parser.ValueTypeVector,
Result: promql.Vector{
promql.Sample{
Metric: labels.FromStrings("__name__", "foo"),
T: 1000,
F: 1,
},
promql.Sample{
Metric: labels.FromStrings("__name__", "bar"),
T: 2000,
F: 2,
},
},
},
expected: `{"status":"success","data":{"resultType":"vector","result":[{"metric":{"__name__":"foo"},"value":[1,"1"]},{"metric":{"__name__":"bar"},"value":[2,"2"]}]}}`,
},
{
response: &QueryData{
ResultType: parser.ValueTypeMatrix,
Result: promql.Matrix{
promql.Series{
Metric: labels.FromStrings("__name__", "foo"),
Floats: []promql.FPoint{{F: 1, T: 1000}},
},
promql.Series{
Metric: labels.FromStrings("__name__", "bar"),
Floats: []promql.FPoint{{F: 2, T: 2000}},
},
},
},
expected: `{"status":"success","data":{"resultType":"matrix","result":[{"metric":{"__name__":"foo"},"values":[[1,"1"]]},{"metric":{"__name__":"bar"},"values":[[2,"2"]]}]}}`,
},
{
response: &QueryData{
ResultType: parser.ValueTypeMatrix,
Expand Down
4 changes: 2 additions & 2 deletions web/ui/module/codemirror-promql/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@prometheus-io/codemirror-promql",
"version": "0.52.0-rc.0",
"version": "0.52.0-rc.1",
"description": "a CodeMirror mode for the PromQL language",
"types": "dist/esm/index.d.ts",
"module": "dist/esm/index.js",
Expand Down Expand Up @@ -29,7 +29,7 @@
},
"homepage": "https://github.com/prometheus/prometheus/blob/main/web/ui/module/codemirror-promql/README.md",
"dependencies": {
"@prometheus-io/lezer-promql": "0.52.0-rc.0",
"@prometheus-io/lezer-promql": "0.52.0-rc.1",
"lru-cache": "^7.18.3"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion web/ui/module/lezer-promql/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@prometheus-io/lezer-promql",
"version": "0.52.0-rc.0",
"version": "0.52.0-rc.1",
"description": "lezer-based PromQL grammar",
"main": "dist/index.cjs",
"type": "module",
Expand Down
14 changes: 7 additions & 7 deletions web/ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion web/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@
"ts-jest": "^29.1.1",
"typescript": "^4.9.5"
},
"version": "0.52.0-rc.0"
"version": "0.52.0-rc.1"
}
4 changes: 2 additions & 2 deletions web/ui/react-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@prometheus-io/app",
"version": "0.52.0-rc.0",
"version": "0.52.0-rc.1",
"private": true,
"dependencies": {
"@codemirror/autocomplete": "^6.11.1",
Expand All @@ -19,7 +19,7 @@
"@lezer/lr": "^1.3.14",
"@nexucis/fuzzy": "^0.4.1",
"@nexucis/kvsearch": "^0.8.1",
"@prometheus-io/codemirror-promql": "0.52.0-rc.0",
"@prometheus-io/codemirror-promql": "0.52.0-rc.1",
"bootstrap": "^4.6.2",
"css.escape": "^1.5.1",
"downshift": "^7.6.2",
Expand Down

0 comments on commit 93be830

Please sign in to comment.