Skip to content

Commit fbb11e3

Browse files
authored
Merge branch 'main' into updatecli_main_updatecli-update-beats-main
2 parents cbf237d + f6c9c38 commit fbb11e3

File tree

7 files changed

+195
-0
lines changed

7 files changed

+195
-0
lines changed

CHANGELOG.asciidoc

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// tag::list[]
2+
* <<apm-release-notes-8.17>>
23
* <<apm-release-notes-8.16>>
34
* <<apm-release-notes-8.15>>
45
* <<apm-release-notes-8.14>>
@@ -20,6 +21,7 @@
2021
2122
// tag::includes[]
2223
include::./changelogs/head.asciidoc[]
24+
include::./changelogs/8.17.asciidoc[]
2325
include::./changelogs/8.16.asciidoc[]
2426
include::./changelogs/8.15.asciidoc[]
2527
include::./changelogs/8.14.asciidoc[]

NOTICE.txt

+99
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,37 @@ Third party libraries used by the Elastic APM Server project:
99
================================================================================
1010

1111

12+
--------------------------------------------------------------------------------
13+
Dependency : github.com/KimMachineGun/automemlimit
14+
Version: v0.7.0-pre.3
15+
Licence type (autodetected): MIT
16+
--------------------------------------------------------------------------------
17+
18+
Contents of probable licence file $GOMODCACHE/github.com/!kim!machine!gun/[email protected]/LICENSE:
19+
20+
MIT License
21+
22+
Copyright (c) 2022 Geon Kim
23+
24+
Permission is hereby granted, free of charge, to any person obtaining a copy
25+
of this software and associated documentation files (the "Software"), to deal
26+
in the Software without restriction, including without limitation the rights
27+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
28+
copies of the Software, and to permit persons to whom the Software is
29+
furnished to do so, subject to the following conditions:
30+
31+
The above copyright notice and this permission notice shall be included in all
32+
copies or substantial portions of the Software.
33+
34+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
35+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
36+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
37+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
38+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
39+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
40+
SOFTWARE.
41+
42+
1243
--------------------------------------------------------------------------------
1344
Dependency : github.com/cespare/xxhash/v2
1445
Version: v2.3.0
@@ -5644,6 +5675,35 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
56445675
THE SOFTWARE.
56455676

56465677

5678+
--------------------------------------------------------------------------------
5679+
Dependency : go.uber.org/zap/exp
5680+
Version: v0.3.0
5681+
Licence type (autodetected): MIT
5682+
--------------------------------------------------------------------------------
5683+
5684+
Contents of probable licence file $GOMODCACHE/go.uber.org/zap/[email protected]/LICENSE:
5685+
5686+
Copyright (c) 2016-2024 Uber Technologies, Inc.
5687+
5688+
Permission is hereby granted, free of charge, to any person obtaining a copy
5689+
of this software and associated documentation files (the "Software"), to deal
5690+
in the Software without restriction, including without limitation the rights
5691+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
5692+
copies of the Software, and to permit persons to whom the Software is
5693+
furnished to do so, subject to the following conditions:
5694+
5695+
The above copyright notice and this permission notice shall be included in
5696+
all copies or substantial portions of the Software.
5697+
5698+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
5699+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
5700+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
5701+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
5702+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
5703+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
5704+
THE SOFTWARE.
5705+
5706+
56475707
--------------------------------------------------------------------------------
56485708
Dependency : golang.org/x/net
56495709
Version: v0.32.0
@@ -13367,6 +13427,45 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1336713427
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1336813428

1336913429

13430+
--------------------------------------------------------------------------------
13431+
Dependency : github.com/pbnjay/memory
13432+
Version: v0.0.0-20210728143218-7b4eea64cf58
13433+
Licence type (autodetected): BSD-3-Clause
13434+
--------------------------------------------------------------------------------
13435+
13436+
Contents of probable licence file $GOMODCACHE/github.com/pbnjay/[email protected]/LICENSE:
13437+
13438+
BSD 3-Clause License
13439+
13440+
Copyright (c) 2017, Jeremy Jay
13441+
All rights reserved.
13442+
13443+
Redistribution and use in source and binary forms, with or without
13444+
modification, are permitted provided that the following conditions are met:
13445+
13446+
* Redistributions of source code must retain the above copyright notice, this
13447+
list of conditions and the following disclaimer.
13448+
13449+
* Redistributions in binary form must reproduce the above copyright notice,
13450+
this list of conditions and the following disclaimer in the documentation
13451+
and/or other materials provided with the distribution.
13452+
13453+
* Neither the name of the copyright holder nor the names of its
13454+
contributors may be used to endorse or promote products derived from
13455+
this software without specific prior written permission.
13456+
13457+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
13458+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
13459+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
13460+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
13461+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
13462+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
13463+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
13464+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
13465+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13466+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13467+
13468+
1337013469
--------------------------------------------------------------------------------
1337113470
Dependency : github.com/pierrec/lz4/v4
1337213471
Version: v4.1.21

changelogs/8.17.asciidoc

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
[[apm-release-notes-8.17]]
2+
== APM version 8.17
3+
* <<apm-release-notes-8.17.0>>
4+
5+
[float]
6+
[[apm-release-notes-8.17.0]]
7+
=== APM version 8.17.0
8+
9+
https://github.com/elastic/apm-server/compare/v8.16.0\...v8.17.0[View commits]
10+
11+
[float]
12+
==== Bug fixes
13+
14+
- Clear scroll after completing scroll requests {pull}14551[14551]
15+
- Surface config parsing error under EA managed mode by logging and marking EA input unit as failed {pull}14574[14574]
16+
- Remove unnecessary hot reload under EA managed mode when apm tracing config is nil {pull}14865[14865]
17+
- The mappings are updated to disable date_detection for all APM data streams.
18+
The change is applied through https://github.com/elastic/elasticsearch/pull/116995[elasticsearch#116995]
19+
20+
[float]
21+
==== Breaking Changes
22+
23+
[float]
24+
==== Deprecations
25+
26+
[float]
27+
==== Intake API Changes
28+
29+
[float]
30+
==== Added
31+
32+
- In 8.15 the default lifecycle management was switched to leverage DSL instead of ILM.
33+
This change was potentially interruptive for several use cases, and therefore is reverted in 8.17.
34+
From 8.17 onwards ILM is again the default lifecycle management configuration for the apm data management setup.
35+
The change is applied through https://github.com/elastic/elasticsearch/pull/115687[elasticsearch#115687]

go.mod

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ module github.com/elastic/apm-server
33
go 1.23.0
44

55
require (
6+
github.com/KimMachineGun/automemlimit v0.7.0-pre.3
67
github.com/cespare/xxhash/v2 v2.3.0
78
github.com/dgraph-io/badger/v2 v2.2007.4
89
github.com/dustin/go-humanize v1.0.1
@@ -46,6 +47,7 @@ require (
4647
go.opentelemetry.io/otel/sdk/metric v1.32.0
4748
go.uber.org/automaxprocs v1.6.0
4849
go.uber.org/zap v1.27.0
50+
go.uber.org/zap/exp v0.3.0
4951
golang.org/x/net v0.32.0
5052
golang.org/x/sync v0.10.0
5153
golang.org/x/term v0.27.0
@@ -122,6 +124,7 @@ require (
122124
github.com/mitchellh/hashstructure v1.1.0 // indirect
123125
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
124126
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
127+
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
125128
github.com/pierrec/lz4/v4 v4.1.21 // indirect
126129
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
127130
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect

go.sum

+6
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ github.com/HdrHistogram/hdrhistogram-go v1.1.2 h1:5IcZpTvzydCQeHzK4Ef/D5rrSqwxob
1717
github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo=
1818
github.com/IBM/sarama v1.43.3 h1:Yj6L2IaNvb2mRBop39N7mmJAHBVY3dTPncr3qGVkxPA=
1919
github.com/IBM/sarama v1.43.3/go.mod h1:FVIRaLrhK3Cla/9FfRF5X9Zua2KpS3SYIXxhac1H+FQ=
20+
github.com/KimMachineGun/automemlimit v0.7.0-pre.3 h1:aZVmBE7SmIsRoVHIzpgCJ6rvwnKRnguDZv5pAZWcZyQ=
21+
github.com/KimMachineGun/automemlimit v0.7.0-pre.3/go.mod h1:QZxpHaGOQoYvFhv/r4u3U0JTC2ZcOwbSr11UZF46UBM=
2022
github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY=
2123
github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
2224
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
@@ -332,6 +334,8 @@ github.com/opencontainers/image-spec v1.1.0/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2sz
332334
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
333335
github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc=
334336
github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ=
337+
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 h1:onHthvaw9LFnH4t2DcNVpwGmV9E1BkGknEliJkfwQj0=
338+
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58/go.mod h1:DXv8WO4yhMYhSNPKjeNKa5WY9YCIEBRbNzFFPJbWO6Y=
335339
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
336340
github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ=
337341
github.com/pierrec/lz4/v4 v4.1.21/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
@@ -476,6 +480,8 @@ go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
476480
go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg=
477481
go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
478482
go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
483+
go.uber.org/zap/exp v0.3.0 h1:6JYzdifzYkGmTdRR59oYH+Ng7k49H9qVpWwNSsGJj3U=
484+
go.uber.org/zap/exp v0.3.0/go.mod h1:5I384qq7XGxYyByIhHm6jg5CHkGY0nsTfbDLgDDlgJQ=
479485
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
480486
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
481487
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=

internal/beatcmd/beat.go

+7
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"errors"
2424
"fmt"
2525
"io"
26+
"log/slog"
2627
"os"
2728
"os/user"
2829
"runtime"
@@ -33,6 +34,7 @@ import (
3334

3435
"github.com/gofrs/uuid/v5"
3536
"go.uber.org/zap"
37+
"go.uber.org/zap/exp/zapslog"
3638
"golang.org/x/sync/errgroup"
3739

3840
"github.com/elastic/beats/v7/libbeat/api"
@@ -348,6 +350,11 @@ func (b *Beat) Run(ctx context.Context) error {
348350
return adjustMaxProcs(ctx, 30*time.Second, logger)
349351
})
350352

353+
slogger := slog.New(zapslog.NewHandler(logger.Core()))
354+
if err := adjustMemlimit(1*time.Second, slogger); err != nil {
355+
return err
356+
}
357+
351358
logSystemInfo(b.Info)
352359

353360
cleanup, err := b.registerElasticsearchVersionCheck()

internal/beatcmd/memlimit.go

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// Licensed to Elasticsearch B.V. under one or more contributor
2+
// license agreements. See the NOTICE file distributed with
3+
// this work for additional information regarding copyright
4+
// ownership. Elasticsearch B.V. licenses this file to you under
5+
// the Apache License, Version 2.0 (the "License"); you may
6+
// not use this file except in compliance with the License.
7+
// You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
18+
package beatcmd
19+
20+
import (
21+
"fmt"
22+
"log/slog"
23+
"time"
24+
25+
"github.com/KimMachineGun/automemlimit/memlimit"
26+
)
27+
28+
func adjustMemlimit(d time.Duration, logger *slog.Logger) error {
29+
if _, err := memlimit.SetGoMemLimitWithOpts(
30+
memlimit.WithProvider(
31+
memlimit.ApplyFallback(
32+
memlimit.FromCgroup,
33+
memlimit.FromSystem,
34+
),
35+
),
36+
memlimit.WithLogger(logger),
37+
memlimit.WithRefreshInterval(d),
38+
memlimit.WithRatio(0.9),
39+
); err != nil {
40+
return fmt.Errorf("failed to set go memlimit: %w", err)
41+
}
42+
return nil
43+
}

0 commit comments

Comments
 (0)