Skip to content

Commit 898abd5

Browse files
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]>
1 parent 16b44e9 commit 898abd5

File tree

5 files changed

+16
-10
lines changed

5 files changed

+16
-10
lines changed

NOTICE-fips.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -872,11 +872,11 @@ Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-l
872872

873873
--------------------------------------------------------------------------------
874874
Dependency : github.com/elastic/elastic-agent-system-metrics
875-
Version: v0.11.18
875+
Version: v0.13.2
876876
Licence type (autodetected): Apache-2.0
877877
--------------------------------------------------------------------------------
878878

879-
Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-system-metrics@v0.11.18/LICENSE.txt:
879+
Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-system-metrics@v0.13.2/LICENSE.txt:
880880

881881
Apache License
882882
Version 2.0, January 2004

NOTICE.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -872,11 +872,11 @@ Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-l
872872

873873
--------------------------------------------------------------------------------
874874
Dependency : github.com/elastic/elastic-agent-system-metrics
875-
Version: v0.11.18
875+
Version: v0.13.2
876876
Licence type (autodetected): Apache-2.0
877877
--------------------------------------------------------------------------------
878878

879-
Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-system-metrics@v0.11.18/LICENSE.txt:
879+
Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-system-metrics@v0.13.2/LICENSE.txt:
880880

881881
Apache License
882882
Version 2.0, January 2004

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require (
99
github.com/docker/go-units v0.5.0
1010
github.com/elastic/elastic-agent-client/v7 v7.17.2
1111
github.com/elastic/elastic-agent-libs v0.24.0
12-
github.com/elastic/elastic-agent-system-metrics v0.11.18
12+
github.com/elastic/elastic-agent-system-metrics v0.13.2
1313
github.com/elastic/go-elasticsearch/v8 v8.19.0
1414
github.com/elastic/go-ucfg v0.8.8
1515
github.com/fxamacker/cbor/v2 v2.9.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ github.com/elastic/elastic-agent-client/v7 v7.17.2 h1:Cl2TeABqWZgW40t5fchGWT/sRk
3737
github.com/elastic/elastic-agent-client/v7 v7.17.2/go.mod h1:5irRFqp6HLqtu1S+OeY0jg8x7K6PLL+DW+PwVk1vJnk=
3838
github.com/elastic/elastic-agent-libs v0.24.0 h1:8skd0le8Y/zAGVaj4m44ljiJMAp0xuJz07ngDTL/1kM=
3939
github.com/elastic/elastic-agent-libs v0.24.0/go.mod h1:xSeIP3NtOIT4N2pPS4EyURmS1Q8mK0lWZ8Wd1Du6q3w=
40-
github.com/elastic/elastic-agent-system-metrics v0.11.18 h1:MuFLvHc3kQN/59+3KmRWhOUoXkL5PDzxEbdYbARGexA=
41-
github.com/elastic/elastic-agent-system-metrics v0.11.18/go.mod h1:qiZC5p1hd8te4XVnhh7FkXdcYhxFnl5i9GJpROtf6zo=
40+
github.com/elastic/elastic-agent-system-metrics v0.13.2 h1:R4ogKHESuWhWTtopnw/aHnBxxSZbxd7KHV4GefdwT2M=
41+
github.com/elastic/elastic-agent-system-metrics v0.13.2/go.mod h1:ezM1kzDUT+vWXFh5oK8QXB/AEB0UoLWqWA8rkRicFFo=
4242
github.com/elastic/elastic-transport-go/v8 v8.7.0 h1:OgTneVuXP2uip4BA658Xi6Hfw+PeIOod2rY3GVMGoVE=
4343
github.com/elastic/elastic-transport-go/v8 v8.7.0/go.mod h1:YLHer5cj0csTzNFXoNQ8qhtGY1GTvSqPnKWKaqQE3Hk=
4444
github.com/elastic/go-elasticsearch/v8 v8.19.0 h1:VmfBLNRORY7RZL+9hTxBD97ehl9H8Nxf2QigDh6HuMU=

internal/pkg/api/metrics.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,13 @@ func init() {
7474
cntGetPGP.Register(routesRegistry.newRegistry("getPGPKey"))
7575
cntAuditUnenroll.Register(routesRegistry.newRegistry("auditUnenroll"))
7676

77-
err := report.SetupMetrics(zap.NewStub("instance-metrics"), build.ServiceName, version.DefaultVersion, monitoring.NewRegistry(), registry.registry)
77+
err := report.SetupMetricsOptions(report.MetricOptions{
78+
Logger: zap.NewStub("instance-metrics"),
79+
Name: build.ServiceName,
80+
Version: version.DefaultVersion,
81+
SystemMetrics: monitoring.NewRegistry(),
82+
ProcessMetrics: registry.registry,
83+
})
7884
if err != nil {
7985
zerolog.Ctx(context.TODO()).Error().Err(err).Msg("unable to initialize metrics") // TODO is used because this may logged during the package load
8086
}
@@ -91,7 +97,7 @@ func newMetricsRegistry(name string) *metricsRegistry {
9197
reg := monitoring.Default
9298
return &metricsRegistry{
9399
fullName: name,
94-
registry: reg.NewRegistry(name),
100+
registry: reg.GetOrCreateRegistry(name),
95101
promReg: prometheus.NewRegistry(),
96102
}
97103
}
@@ -103,7 +109,7 @@ func (r *metricsRegistry) newRegistry(name string) *metricsRegistry {
103109
}
104110
return &metricsRegistry{
105111
fullName: fullName,
106-
registry: r.registry.NewRegistry(name),
112+
registry: r.registry.GetOrCreateRegistry(name),
107113
promReg: r.promReg,
108114
}
109115
}

0 commit comments

Comments
 (0)