Skip to content

Commit 591a42f

Browse files
dependabot[bot]mergify[bot]
authored andcommitted
build(deps): bump github.com/elastic/elastic-agent-system-metrics from 0.11.18 to 0.12.0 (#5273)
* build(deps): bump github.com/elastic/elastic-agent-system-metrics Bumps [github.com/elastic/elastic-agent-system-metrics](https://github.com/elastic/elastic-agent-system-metrics) from 0.11.18 to 0.12.0. - [Release notes](https://github.com/elastic/elastic-agent-system-metrics/releases) - [Commits](elastic/elastic-agent-system-metrics@v0.11.18...v0.12.0) --- updated-dependencies: - dependency-name: github.com/elastic/elastic-agent-system-metrics dependency-version: 0.12.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * Post dependabot file modifications * fix: resolve breaking API changes * fix: replace deprecated calls to NewRegistry with GetOrCreateRegistry --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <dependabot[bot]@users.noreply.github.com> Co-authored-by: Panos Koutsovasilis <[email protected]> (cherry picked from commit 898abd5) # Conflicts: # NOTICE-fips.txt # NOTICE.txt # go.mod # go.sum # internal/pkg/api/metrics.go
1 parent 02a8fc2 commit 591a42f

File tree

5 files changed

+46
-2
lines changed

5 files changed

+46
-2
lines changed

NOTICE-fips.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -842,11 +842,19 @@ Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-l
842842

843843
--------------------------------------------------------------------------------
844844
Dependency : github.com/elastic/elastic-agent-system-metrics
845+
<<<<<<< HEAD
845846
Version: v0.11.15
846847
Licence type (autodetected): Apache-2.0
847848
--------------------------------------------------------------------------------
848849

849850
Contents of probable licence file $GOMODCACHE/github.com/elastic/[email protected]/LICENSE.txt:
851+
=======
852+
Version: v0.13.2
853+
Licence type (autodetected): Apache-2.0
854+
--------------------------------------------------------------------------------
855+
856+
Contents of probable licence file $GOMODCACHE/github.com/elastic/[email protected]/LICENSE.txt:
857+
>>>>>>> 898abd5 (build(deps): bump github.com/elastic/elastic-agent-system-metrics from 0.11.18 to 0.12.0 (#5273))
850858

851859
Apache License
852860
Version 2.0, January 2004

NOTICE.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -842,11 +842,19 @@ Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-l
842842

843843
--------------------------------------------------------------------------------
844844
Dependency : github.com/elastic/elastic-agent-system-metrics
845+
<<<<<<< HEAD
845846
Version: v0.11.15
846847
Licence type (autodetected): Apache-2.0
847848
--------------------------------------------------------------------------------
848849

849850
Contents of probable licence file $GOMODCACHE/github.com/elastic/[email protected]/LICENSE.txt:
851+
=======
852+
Version: v0.13.2
853+
Licence type (autodetected): Apache-2.0
854+
--------------------------------------------------------------------------------
855+
856+
Contents of probable licence file $GOMODCACHE/github.com/elastic/[email protected]/LICENSE.txt:
857+
>>>>>>> 898abd5 (build(deps): bump github.com/elastic/elastic-agent-system-metrics from 0.11.18 to 0.12.0 (#5273))
850858

851859
Apache License
852860
Version 2.0, January 2004

go.mod

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,13 @@ require (
88
github.com/docker/go-units v0.5.0
99
github.com/elastic/elastic-agent-client/v7 v7.17.2
1010
github.com/elastic/elastic-agent-libs v0.24.0
11+
<<<<<<< HEAD
1112
github.com/elastic/elastic-agent-system-metrics v0.11.15
1213
github.com/elastic/go-elasticsearch/v8 v8.17.1
14+
=======
15+
github.com/elastic/elastic-agent-system-metrics v0.13.2
16+
github.com/elastic/go-elasticsearch/v8 v8.19.0
17+
>>>>>>> 898abd5 (build(deps): bump github.com/elastic/elastic-agent-system-metrics from 0.11.18 to 0.12.0 (#5273))
1318
github.com/elastic/go-ucfg v0.8.8
1419
github.com/fxamacker/cbor/v2 v2.8.0
1520
github.com/go-chi/chi/v5 v5.2.3

go.sum

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,21 @@ github.com/elastic/elastic-agent-client/v7 v7.17.2 h1:Cl2TeABqWZgW40t5fchGWT/sRk
3535
github.com/elastic/elastic-agent-client/v7 v7.17.2/go.mod h1:5irRFqp6HLqtu1S+OeY0jg8x7K6PLL+DW+PwVk1vJnk=
3636
github.com/elastic/elastic-agent-libs v0.24.0 h1:8skd0le8Y/zAGVaj4m44ljiJMAp0xuJz07ngDTL/1kM=
3737
github.com/elastic/elastic-agent-libs v0.24.0/go.mod h1:xSeIP3NtOIT4N2pPS4EyURmS1Q8mK0lWZ8Wd1Du6q3w=
38+
<<<<<<< HEAD
3839
github.com/elastic/elastic-agent-system-metrics v0.11.15 h1:RWX0n6LakadsqB6YB2I7AIXyMlEO4qBUGWn4A+aGeKA=
3940
github.com/elastic/elastic-agent-system-metrics v0.11.15/go.mod h1:qiZC5p1hd8te4XVnhh7FkXdcYhxFnl5i9GJpROtf6zo=
4041
github.com/elastic/elastic-transport-go/v8 v8.6.1 h1:h2jQRqH6eLGiBSN4eZbQnJLtL4bC5b4lfVFRjw2R4e4=
4142
github.com/elastic/elastic-transport-go/v8 v8.6.1/go.mod h1:YLHer5cj0csTzNFXoNQ8qhtGY1GTvSqPnKWKaqQE3Hk=
4243
github.com/elastic/go-elasticsearch/v8 v8.17.1 h1:bOXChDoCMB4TIwwGqKd031U8OXssmWLT3UrAr9EGs3Q=
4344
github.com/elastic/go-elasticsearch/v8 v8.17.1/go.mod h1:MVJCtL+gJJ7x5jFeUmA20O7rvipX8GcQmo5iBcmaJn4=
45+
=======
46+
github.com/elastic/elastic-agent-system-metrics v0.13.2 h1:R4ogKHESuWhWTtopnw/aHnBxxSZbxd7KHV4GefdwT2M=
47+
github.com/elastic/elastic-agent-system-metrics v0.13.2/go.mod h1:ezM1kzDUT+vWXFh5oK8QXB/AEB0UoLWqWA8rkRicFFo=
48+
github.com/elastic/elastic-transport-go/v8 v8.7.0 h1:OgTneVuXP2uip4BA658Xi6Hfw+PeIOod2rY3GVMGoVE=
49+
github.com/elastic/elastic-transport-go/v8 v8.7.0/go.mod h1:YLHer5cj0csTzNFXoNQ8qhtGY1GTvSqPnKWKaqQE3Hk=
50+
github.com/elastic/go-elasticsearch/v8 v8.19.0 h1:VmfBLNRORY7RZL+9hTxBD97ehl9H8Nxf2QigDh6HuMU=
51+
github.com/elastic/go-elasticsearch/v8 v8.19.0/go.mod h1:F3j9e+BubmKvzvLjNui/1++nJuJxbkhHefbaT0kFKGY=
52+
>>>>>>> 898abd5 (build(deps): bump github.com/elastic/elastic-agent-system-metrics from 0.11.18 to 0.12.0 (#5273))
4453
github.com/elastic/go-structform v0.0.12 h1:HXpzlAKyej8T7LobqKDThUw7BMhwV6Db24VwxNtgxCs=
4554
github.com/elastic/go-structform v0.0.12/go.mod h1:CZWf9aIRYY5SuKSmOhtXScE5uQiLZNqAFnwKR4OrIM4=
4655
github.com/elastic/go-sysinfo v1.15.0 h1:54pRFlAYUlVNQ2HbXzLVZlV+fxS7Eax49stzg95M4Xw=

internal/pkg/api/metrics.go

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,20 @@ func init() {
7878
cntFileDeliv.Register(routesRegistry.newRegistry("deliverFile"))
7979
cntGetPGP.Register(routesRegistry.newRegistry("getPGPKey"))
8080
cntAuditUnenroll.Register(routesRegistry.newRegistry("auditUnenroll"))
81+
<<<<<<< HEAD
82+
=======
83+
84+
err := report.SetupMetricsOptions(report.MetricOptions{
85+
Logger: zap.NewStub("instance-metrics"),
86+
Name: build.ServiceName,
87+
Version: version.DefaultVersion,
88+
SystemMetrics: monitoring.NewRegistry(),
89+
ProcessMetrics: registry.registry,
90+
})
91+
if err != nil {
92+
zerolog.Ctx(context.TODO()).Error().Err(err).Msg("unable to initialize metrics") // TODO is used because this may logged during the package load
93+
}
94+
>>>>>>> 898abd5 (build(deps): bump github.com/elastic/elastic-agent-system-metrics from 0.11.18 to 0.12.0 (#5273))
8195
}
8296

8397
// metricsRegistry wraps libbeat and prometheus registries
@@ -91,7 +105,7 @@ func newMetricsRegistry(name string) *metricsRegistry {
91105
reg := monitoring.Default
92106
return &metricsRegistry{
93107
fullName: name,
94-
registry: reg.NewRegistry(name),
108+
registry: reg.GetOrCreateRegistry(name),
95109
promReg: prometheus.NewRegistry(),
96110
}
97111
}
@@ -103,7 +117,7 @@ func (r *metricsRegistry) newRegistry(name string) *metricsRegistry {
103117
}
104118
return &metricsRegistry{
105119
fullName: fullName,
106-
registry: r.registry.NewRegistry(name),
120+
registry: r.registry.GetOrCreateRegistry(name),
107121
promReg: r.promReg,
108122
}
109123
}

0 commit comments

Comments
 (0)