Skip to content

Commit 9705f2e

Browse files
authored
Merge branch '8.x' into mergify/bp/8.x/pr-41994
2 parents 16aafd8 + 5c94629 commit 9705f2e

File tree

5 files changed

+144
-10
lines changed

5 files changed

+144
-10
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: mergify backport labels copier
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
mergify-backport-labels-copier:
13+
runs-on: ubuntu-latest
14+
if: startsWith(github.head_ref, 'mergify/bp/')
15+
permissions:
16+
# Add GH labels
17+
pull-requests: write
18+
# See https://github.com/cli/cli/issues/6274
19+
repository-projects: read
20+
steps:
21+
- uses: elastic/oblt-actions/mergify/labels-copier@v1
22+
with:
23+
excluded-labels-regex: "^backport-*"

NOTICE.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13406,11 +13406,11 @@ SOFTWARE
1340613406

1340713407
--------------------------------------------------------------------------------
1340813408
Dependency : github.com/elastic/elastic-agent-libs
13409-
Version: v0.18.0
13409+
Version: v0.18.1
1341013410
Licence type (autodetected): Apache-2.0
1341113411
--------------------------------------------------------------------------------
1341213412

13413-
Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-libs@v0.18.0/LICENSE:
13413+
Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-libs@v0.18.1/LICENSE:
1341413414

1341513415
Apache License
1341613416
Version 2.0, January 2004
@@ -14039,11 +14039,11 @@ Contents of probable licence file $GOMODCACHE/github.com/elastic/go-concert@v0.3
1403914039

1404014040
--------------------------------------------------------------------------------
1404114041
Dependency : github.com/elastic/go-elasticsearch/v8
14042-
Version: v8.14.0
14042+
Version: v8.17.0
1404314043
Licence type (autodetected): Apache-2.0
1404414044
--------------------------------------------------------------------------------
1404514045

14046-
Contents of probable licence file $GOMODCACHE/github.com/elastic/go-elasticsearch/v8@v8.14.0/LICENSE:
14046+
Contents of probable licence file $GOMODCACHE/github.com/elastic/go-elasticsearch/v8@v8.17.0/LICENSE:
1404714047

1404814048
Apache License
1404914049
Version 2.0, January 2004

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,9 @@ require (
184184
github.com/elastic/bayeux v1.0.5
185185
github.com/elastic/ebpfevents v0.6.0
186186
github.com/elastic/elastic-agent-autodiscover v0.9.0
187-
github.com/elastic/elastic-agent-libs v0.18.0
187+
github.com/elastic/elastic-agent-libs v0.18.1
188188
github.com/elastic/elastic-agent-system-metrics v0.11.7
189-
github.com/elastic/go-elasticsearch/v8 v8.14.0
189+
github.com/elastic/go-elasticsearch/v8 v8.17.0
190190
github.com/elastic/go-quark v0.2.0
191191
github.com/elastic/go-sfdc v0.0.0-20241010131323-8e176480d727
192192
github.com/elastic/mito v1.16.0

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,8 @@ github.com/elastic/elastic-agent-autodiscover v0.9.0 h1:+iWIKh0u3e8I+CJa3FfWe9h0
340340
github.com/elastic/elastic-agent-autodiscover v0.9.0/go.mod h1:5iUxLHhVdaGSWYTveSwfJEY4RqPXTG13LPiFoxcpFd4=
341341
github.com/elastic/elastic-agent-client/v7 v7.15.0 h1:nDB7v8TBoNuD6IIzC3z7Q0y+7bMgXoT2DsHfolO2CHE=
342342
github.com/elastic/elastic-agent-client/v7 v7.15.0/go.mod h1:6h+f9QdIr3GO2ODC0Y8+aEXRwzbA5W4eV4dd/67z7nI=
343-
github.com/elastic/elastic-agent-libs v0.18.0 h1:PKG1StgHu2MfOwOryGuAVgNZlZXyvVSDw3SvLUfel+w=
344-
github.com/elastic/elastic-agent-libs v0.18.0/go.mod h1:5CR02awPrBr+tfmjBBK+JI+dMmHNQjpVY24J0wjbC7M=
343+
github.com/elastic/elastic-agent-libs v0.18.1 h1:dE6jf/D9bP8eRMQsV7KKpKV/G8zQzwMFBTj1w4e716c=
344+
github.com/elastic/elastic-agent-libs v0.18.1/go.mod h1:rWdyrrAFzZwgNNi41Tsqhlt2c2GdXWhCEwcsnqISJ2U=
345345
github.com/elastic/elastic-agent-system-metrics v0.11.7 h1:1xm2okCM0eQZ4jivZgUFSlt6HAn/nPgKB/Fj8eLG6mY=
346346
github.com/elastic/elastic-agent-system-metrics v0.11.7/go.mod h1:nzkrGajQA29YNcfP62gfzhxX9an3/xdQ3RmfQNw9YTI=
347347
github.com/elastic/elastic-transport-go/v8 v8.6.0 h1:Y2S/FBjx1LlCv5m6pWAF2kDJAHoSjSRSJCApolgfthA=
@@ -356,8 +356,8 @@ github.com/elastic/go-docappender/v2 v2.3.0 h1:Vr+l36jM+sE/LHp0JFxSIbHlWTSk8CpBb
356356
github.com/elastic/go-docappender/v2 v2.3.0/go.mod h1:VNWgXUE9HX1G6W6ON8dOs/KdH8aCxXir/fxxcfrnov4=
357357
github.com/elastic/go-elasticsearch/v7 v7.17.10 h1:TCQ8i4PmIJuBunvBS6bwT2ybzVFxxUhhltAs3Gyu1yo=
358358
github.com/elastic/go-elasticsearch/v7 v7.17.10/go.mod h1:OJ4wdbtDNk5g503kvlHLyErCgQwwzmDtaFC4XyOxXA4=
359-
github.com/elastic/go-elasticsearch/v8 v8.14.0 h1:1ywU8WFReLLcxE1WJqii3hTtbPUE2hc38ZK/j4mMFow=
360-
github.com/elastic/go-elasticsearch/v8 v8.14.0/go.mod h1:WRvnlGkSuZyp83M2U8El/LGXpCjYLrvlkSgkAH4O5I4=
359+
github.com/elastic/go-elasticsearch/v8 v8.17.0 h1:e9cWksE/Fr7urDRmGPGp47Nsp4/mvNOrU8As1l2HQQ0=
360+
github.com/elastic/go-elasticsearch/v8 v8.17.0/go.mod h1:lGMlgKIbYoRvay3xWBeKahAiJOgmFDsjZC39nmO3H64=
361361
github.com/elastic/go-libaudit/v2 v2.6.1 h1:eN7tobGizmB+OJpCuG7gvPX7Nxni//H47uvMDXlMrI0=
362362
github.com/elastic/go-libaudit/v2 v2.6.1/go.mod h1:8205nkf2oSrXFlO4H5j8/cyVMoSF3Y7jt+FjgS4ubQU=
363363
github.com/elastic/go-licenser v0.4.2 h1:bPbGm8bUd8rxzSswFOqvQh1dAkKGkgAmrPxbUi+Y9+A=
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
2+
// or more contributor license agreements. Licensed under the Elastic License;
3+
// you may not use this file except in compliance with the Elastic License.
4+
5+
//go:build integration && !agentbeat
6+
7+
package integration
8+
9+
import (
10+
"context"
11+
"crypto/tls"
12+
"fmt"
13+
"net/http"
14+
"os"
15+
"path/filepath"
16+
"testing"
17+
"time"
18+
19+
"github.com/stretchr/testify/require"
20+
21+
"github.com/elastic/beats/v7/libbeat/tests/integration"
22+
"github.com/elastic/elastic-agent-libs/testing/estools"
23+
"github.com/elastic/go-elasticsearch/v8"
24+
)
25+
26+
var beatsCfgFile = `
27+
filebeat.inputs:
28+
- type: filestream
29+
id: filestream-input-id
30+
enabled: true
31+
file_identity.native: ~
32+
prospector.scanner.fingerprint.enabled: false
33+
paths:
34+
- %s
35+
output:
36+
elasticsearch:
37+
hosts:
38+
- localhost:9200
39+
protocol: http
40+
username: admin
41+
password: testing
42+
index: %s
43+
queue.mem.flush.timeout: 0s
44+
`
45+
46+
func TestFilebeatOTelE2E(t *testing.T) {
47+
integration.EnsureESIsRunning(t)
48+
49+
filebeatOTel := integration.NewBeat(
50+
t,
51+
"filebeat-otel",
52+
"../../filebeat.test",
53+
"otel",
54+
)
55+
56+
logFilePath := filepath.Join(filebeatOTel.TempDir(), "log.log")
57+
filebeatOTel.WriteConfigFile(fmt.Sprintf(beatsCfgFile, logFilePath, "logs-integration-default"))
58+
59+
logFile, err := os.Create(logFilePath)
60+
if err != nil {
61+
t.Fatalf("could not create file '%s': %s", logFilePath, err)
62+
}
63+
64+
numEvents := 5
65+
66+
// write events to log file
67+
for i := 0; i < numEvents; i++ {
68+
msg := fmt.Sprintf("Line %d", i)
69+
_, err = logFile.Write([]byte(msg + "\n"))
70+
require.NoErrorf(t, err, "failed to write line %d to temp file", i)
71+
}
72+
73+
if err := logFile.Sync(); err != nil {
74+
t.Fatalf("could not sync log file '%s': %s", logFilePath, err)
75+
}
76+
if err := logFile.Close(); err != nil {
77+
t.Fatalf("could not close log file '%s': %s", logFilePath, err)
78+
}
79+
80+
filebeatOTel.Start()
81+
82+
// prepare to query ES
83+
esCfg := elasticsearch.Config{
84+
Addresses: []string{"http://localhost:9200"},
85+
Username: "admin",
86+
Password: "testing",
87+
Transport: &http.Transport{
88+
TLSClientConfig: &tls.Config{
89+
InsecureSkipVerify: true, //nolint:gosec // this is only for testing
90+
},
91+
},
92+
}
93+
es, err := elasticsearch.NewClient(esCfg)
94+
require.NoError(t, err)
95+
96+
actualHits := &struct{ Hits int }{}
97+
// wait for logs to be published
98+
require.Eventually(t,
99+
func() bool {
100+
findCtx, findCancel := context.WithTimeout(context.Background(), 10*time.Second)
101+
defer findCancel()
102+
103+
OTelDocs, err := estools.GetAllLogsForIndexWithContext(findCtx, es, ".ds-logs-integration-default*")
104+
require.NoError(t, err)
105+
106+
actualHits.Hits = OTelDocs.Hits.Total.Value
107+
return actualHits.Hits == numEvents
108+
},
109+
2*time.Minute, 1*time.Second, numEvents, actualHits.Hits)
110+
111+
}

0 commit comments

Comments
 (0)