Skip to content

Commit 4ce96cc

Browse files
authored
mod,x-pack/filebeat/input/cel: update mito to v1.24.2 (#50222)
v1.24.2 of elastic/mito bumps the cel-go version to v0.28.0 and updates the code required for correctly handling maps in that runtime version. cel-go v0.28.0 fixes a bug in the runtime that caused error messages to identify the wrong source location. Update the dependency and fix the two test expectations that were tracking the incorrect locations. This change is functionally equivalent to a back-port of c589041.
1 parent 454fc76 commit 4ce96cc

6 files changed

Lines changed: 25 additions & 58 deletions

File tree

NOTICE.txt

Lines changed: 6 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -14414,11 +14414,11 @@ limitations under the License.
1441414414

1441514415
--------------------------------------------------------------------------------
1441614416
Dependency : github.com/elastic/mito
14417-
Version: v1.24.1
14417+
Version: v1.24.2
1441814418
Licence type (autodetected): Apache-2.0
1441914419
--------------------------------------------------------------------------------
1442014420

14421-
Contents of probable licence file $GOMODCACHE/github.com/elastic/mito@v1.24.1/LICENSE:
14421+
Contents of probable licence file $GOMODCACHE/github.com/elastic/mito@v1.24.2/LICENSE:
1442214422

1442314423

1442414424
Apache License
@@ -16532,11 +16532,11 @@ Contents of probable licence file $GOMODCACHE/github.com/gomodule/redigo@v1.9.2/
1653216532

1653316533
--------------------------------------------------------------------------------
1653416534
Dependency : github.com/google/cel-go
16535-
Version: v0.26.1
16535+
Version: v0.28.0
1653616536
Licence type (autodetected): Apache-2.0
1653716537
--------------------------------------------------------------------------------
1653816538

16539-
Contents of probable licence file $GOMODCACHE/github.com/google/cel-go@v0.26.1/LICENSE:
16539+
Contents of probable licence file $GOMODCACHE/github.com/google/cel-go@v0.28.0/LICENSE:
1654016540

1654116541

1654216542
Apache License
@@ -72268,37 +72268,6 @@ Contents of probable licence file $GOMODCACHE/github.com/spiffe/go-spiffe/v2@v2.
7226872268
limitations under the License.
7226972269

7227072270

72271-
--------------------------------------------------------------------------------
72272-
Dependency : github.com/stoewer/go-strcase
72273-
Version: v1.3.1
72274-
Licence type (autodetected): MIT
72275-
--------------------------------------------------------------------------------
72276-
72277-
Contents of probable licence file $GOMODCACHE/github.com/stoewer/go-strcase@v1.3.1/LICENSE:
72278-
72279-
The MIT License (MIT)
72280-
72281-
Copyright (c) 2017, Adrian Stoewer <adrian.stoewer@rz.ifi.lmu.de>
72282-
72283-
Permission is hereby granted, free of charge, to any person obtaining a copy
72284-
of this software and associated documentation files (the "Software"), to deal
72285-
in the Software without restriction, including without limitation the rights
72286-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
72287-
copies of the Software, and to permit persons to whom the Software is
72288-
furnished to do so, subject to the following conditions:
72289-
72290-
The above copyright notice and this permission notice shall be included in all
72291-
copies or substantial portions of the Software.
72292-
72293-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
72294-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
72295-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
72296-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
72297-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
72298-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
72299-
SOFTWARE.
72300-
72301-
7230272271
--------------------------------------------------------------------------------
7230372272
Dependency : github.com/stretchr/objx
7230472273
Version: v0.5.2
@@ -88139,11 +88108,11 @@ Contents of probable licence file $GOMODCACHE/google.golang.org/genproto@v0.0.0-
8813988108

8814088109
--------------------------------------------------------------------------------
8814188110
Dependency : google.golang.org/genproto/googleapis/rpc
88142-
Version: v0.0.0-20260226221140-a57be14db171
88111+
Version: v0.0.0-20260319201613-d00831a3d3e7
8814388112
Licence type (autodetected): Apache-2.0
8814488113
--------------------------------------------------------------------------------
8814588114

88146-
Contents of probable licence file $GOMODCACHE/google.golang.org/genproto/googleapis/rpc@v0.0.0-20260226221140-a57be14db171/LICENSE:
88115+
Contents of probable licence file $GOMODCACHE/google.golang.org/genproto/googleapis/rpc@v0.0.0-20260319201613-d00831a3d3e7/LICENSE:
8814788116

8814888117

8814988118
Apache License
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
kind: bug-fix
2+
summary: Update mito to v1.24.2, fixing runtime error location reporting.
3+
component: filebeat

docs/reference/filebeat/filebeat-input-cel.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ mapped_pages:
44
- https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-input-cel.html
55
sub:
66
mito_docs: https://pkg.go.dev/github.com/elastic/mito
7-
mito_version: v1.24.1
7+
mito_version: v1.24.2
88
applies_to:
99
stack: ga 8.6.0
1010
serverless: ga

go.mod

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ require (
178178
github.com/elastic/go-freelru v0.16.0
179179
github.com/elastic/go-quark v0.3.0
180180
github.com/elastic/go-sfdc v0.0.0-20251207194532-c5aadd4a4e06
181-
github.com/elastic/mito v1.24.1
181+
github.com/elastic/mito v1.24.2
182182
github.com/elastic/mock-es v0.0.0-20250530054253-8c3b6053f9b6
183183
github.com/elastic/sarama v1.19.1-0.20260310070522-abae92ca1603
184184
github.com/elastic/tk-btf v0.2.0
@@ -188,7 +188,7 @@ require (
188188
github.com/go-resty/resty/v2 v2.17.1
189189
github.com/gofrs/uuid/v5 v5.3.2
190190
github.com/golang-jwt/jwt/v5 v5.3.0
191-
github.com/google/cel-go v0.26.1
191+
github.com/google/cel-go v0.28.0
192192
github.com/googleapis/gax-go/v2 v2.15.0
193193
github.com/gorilla/handlers v1.5.1
194194
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674
@@ -460,7 +460,6 @@ require (
460460
github.com/sergi/go-diff v1.3.1 // indirect
461461
github.com/sirupsen/logrus v1.9.3 // indirect
462462
github.com/spiffe/go-spiffe/v2 v2.6.0 // indirect
463-
github.com/stoewer/go-strcase v1.3.1 // indirect
464463
github.com/stretchr/objx v0.5.2 // indirect
465464
github.com/tklauser/numcpus v0.11.0 // indirect
466465
github.com/twmb/franz-go v1.20.7 // indirect
@@ -532,7 +531,7 @@ require (
532531
golang.org/x/telemetry v0.0.0-20260311193753-579e4da9a98c // indirect
533532
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect
534533
gonum.org/v1/gonum v0.17.0 // indirect
535-
google.golang.org/genproto/googleapis/rpc v0.0.0-20260226221140-a57be14db171 // indirect
534+
google.golang.org/genproto/googleapis/rpc v0.0.0-20260319201613-d00831a3d3e7 // indirect
536535
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
537536
k8s.io/klog/v2 v2.130.1 // indirect
538537
k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b // indirect

go.sum

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -429,8 +429,8 @@ github.com/elastic/gopacket v1.1.20-0.20241002174017-e8c5fda595e6 h1:VgOx6omXIMK
429429
github.com/elastic/gopacket v1.1.20-0.20241002174017-e8c5fda595e6/go.mod h1:riddUzxTSBpJXk3qBHtYr4qOhFhT6k/1c0E3qkQjQpA=
430430
github.com/elastic/gosigar v0.14.4 h1:7NRnWJDFjEKpOjnHhtzrPGZWr9EMrYFsLjF4q0Czosk=
431431
github.com/elastic/gosigar v0.14.4/go.mod h1:tx91Eb3YgFk6y++h88fRAnxic3Si1ZDHooqnJU/hqo8=
432-
github.com/elastic/mito v1.24.1 h1:sx7TlL1OSKvIAWouRgCeuSd66V40pYl5s5vfcTqjHUo=
433-
github.com/elastic/mito v1.24.1/go.mod h1:h1V+8B62+DXsu0TstJkjsTh5ewJIDJlwzxPkP3HBM9s=
432+
github.com/elastic/mito v1.24.2 h1:r6bx4Y/AcfXy79cfEOnPsuVKLmOcriQzZh51GMuePD8=
433+
github.com/elastic/mito v1.24.2/go.mod h1:nmkKaLmNGWf79vthVZcNBvKZCAFCaxx4I1LcJ1+OAfU=
434434
github.com/elastic/mock-es v0.0.0-20250530054253-8c3b6053f9b6 h1:JVNuBrmOoqLJgp9o68YBMnOrXCzQI3mCppW+suwRSlw=
435435
github.com/elastic/mock-es v0.0.0-20250530054253-8c3b6053f9b6/go.mod h1:cXqWcLnmu5y4QveTb2hjk7rgzkHMuZsqeXtbJpNAcu0=
436436
github.com/elastic/sarama v1.19.1-0.20260310070522-abae92ca1603 h1:QFDM5JuLch52FxjHizLP2tiuzfhulUdyOsUe/JuPhrQ=
@@ -606,8 +606,8 @@ github.com/golang/snappy v1.0.0 h1:Oy607GVXHs7RtbggtPBnr2RmDArIsAefDwvrdWvRhGs=
606606
github.com/golang/snappy v1.0.0/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
607607
github.com/gomodule/redigo v1.9.2 h1:HrutZBLhSIU8abiSfW8pj8mPhOyMYjZT/wcA4/L9L9s=
608608
github.com/gomodule/redigo v1.9.2/go.mod h1:KsU3hiK/Ay8U42qpaJk+kuNa3C+spxapWpM+ywhcgtw=
609-
github.com/google/cel-go v0.26.1 h1:iPbVVEdkhTX++hpe3lzSk7D3G3QSYqLGoHOcEio+UXQ=
610-
github.com/google/cel-go v0.26.1/go.mod h1:A9O8OU9rdvrK5MQyrqfIxo1a0u4g3sF8KB6PUIaryMM=
609+
github.com/google/cel-go v0.28.0 h1:KjSWstCpz/MN5t4a8gnGJNIYUsJRpdi/r97xWDphIQc=
610+
github.com/google/cel-go v0.28.0/go.mod h1:X0bD6iVNR8pkROSOoHVdgTkzmRcosof7WQqCD6wcMc8=
611611
github.com/google/flatbuffers v25.2.10+incompatible h1:F3vclr7C3HpB1k9mxCGRMXq6FdUalZ6H/pNX4FP1v0Q=
612612
github.com/google/flatbuffers v25.2.10+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8=
613613
github.com/google/gnostic-models v0.7.0 h1:qwTtogB15McXDaNqTZdzPJRHvaVJlAl+HVQnLmJEJxo=
@@ -1004,8 +1004,6 @@ github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=
10041004
github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
10051005
github.com/spiffe/go-spiffe/v2 v2.6.0 h1:l+DolpxNWYgruGQVV0xsfeya3CsC7m8iBzDnMpsbLuo=
10061006
github.com/spiffe/go-spiffe/v2 v2.6.0/go.mod h1:gm2SeUoMZEtpnzPNs2Csc0D/gX33k1xIx7lEzqblHEs=
1007-
github.com/stoewer/go-strcase v1.3.1 h1:iS0MdW+kVTxgMoE1LAZyMiYJFKlOzLooE4MxjirtkAs=
1008-
github.com/stoewer/go-strcase v1.3.1/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo=
10091007
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
10101008
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
10111009
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
@@ -1501,8 +1499,8 @@ google.golang.org/genproto v0.0.0-20250603155806-513f23925822 h1:rHWScKit0gvAPuO
15011499
google.golang.org/genproto v0.0.0-20250603155806-513f23925822/go.mod h1:HubltRL7rMh0LfnQPkMH4NPDFEWp0jw3vixw7jEM53s=
15021500
google.golang.org/genproto/googleapis/api v0.0.0-20260226221140-a57be14db171 h1:tu/dtnW1o3wfaxCOjSLn5IRX4YDcJrtlpzYkhHhGaC4=
15031501
google.golang.org/genproto/googleapis/api v0.0.0-20260226221140-a57be14db171/go.mod h1:M5krXqk4GhBKvB596udGL3UyjL4I1+cTbK0orROM9ng=
1504-
google.golang.org/genproto/googleapis/rpc v0.0.0-20260226221140-a57be14db171 h1:ggcbiqK8WWh6l1dnltU4BgWGIGo+EVYxCaAPih/zQXQ=
1505-
google.golang.org/genproto/googleapis/rpc v0.0.0-20260226221140-a57be14db171/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8=
1502+
google.golang.org/genproto/googleapis/rpc v0.0.0-20260319201613-d00831a3d3e7 h1:ndE4FoJqsIceKP2oYSnUZqhTdYufCYYkqwtFzfrhI7w=
1503+
google.golang.org/genproto/googleapis/rpc v0.0.0-20260319201613-d00831a3d3e7/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8=
15061504
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
15071505
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
15081506
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=

x-pack/filebeat/input/cel/input_test.go

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -906,9 +906,9 @@ var inputTests = []struct {
906906
want: []map[string]interface{}{
907907
{
908908
"error": map[string]any{
909-
"message": `failed eval: ERROR: <input>:3:21: response body too big
910-
| "events": [string(body)]
911-
| ....................^`,
909+
"message": `failed eval: ERROR: <input>:2:5: response body too big
910+
| get(state.url).Body.as(body, {
911+
| ....^`,
912912
},
913913
},
914914
},
@@ -2163,13 +2163,11 @@ var inputTests = []struct {
21632163
},
21642164
handler: defaultHandler(http.MethodGet, ""),
21652165
want: []map[string]interface{}{
2166-
// Loss of location information here is a result of changes in the runtime.
2167-
// We no longer look into macros at all. This is a huge loss for debugging.
21682166
{
21692167
"error": map[string]interface{}{
2170-
"message": `failed eval: ERROR: <input>:5:14: no such overload
2171-
| "events": events,
2172-
| .............^`,
2168+
"message": `failed eval: ERROR: <input>:3:20: no such overload
2169+
| get(state.url+'/'+r.id).Body.decode_json()).as(events, {
2170+
| ...................^`,
21732171
},
21742172
},
21752173
},

0 commit comments

Comments
 (0)