Skip to content

Commit f4480ae

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 3582592 commit f4480ae

File tree

5 files changed

+42
-2
lines changed

5 files changed

+42
-2
lines changed

NOTICE-fips.txt

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

873873
--------------------------------------------------------------------------------
874874
Dependency : github.com/elastic/elastic-agent-system-metrics
875+
<<<<<<< HEAD
875876
Version: v0.11.16
876877
Licence type (autodetected): Apache-2.0
877878
--------------------------------------------------------------------------------
878879

879880
Contents of probable licence file $GOMODCACHE/github.com/elastic/[email protected]/LICENSE.txt:
881+
=======
882+
Version: v0.13.2
883+
Licence type (autodetected): Apache-2.0
884+
--------------------------------------------------------------------------------
885+
886+
Contents of probable licence file $GOMODCACHE/github.com/elastic/[email protected]/LICENSE.txt:
887+
>>>>>>> 898abd5 (build(deps): bump github.com/elastic/elastic-agent-system-metrics from 0.11.18 to 0.12.0 (#5273))
880888

881889
Apache License
882890
Version 2.0, January 2004

NOTICE.txt

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

873873
--------------------------------------------------------------------------------
874874
Dependency : github.com/elastic/elastic-agent-system-metrics
875+
<<<<<<< HEAD
875876
Version: v0.11.16
876877
Licence type (autodetected): Apache-2.0
877878
--------------------------------------------------------------------------------
878879

879880
Contents of probable licence file $GOMODCACHE/github.com/elastic/[email protected]/LICENSE.txt:
881+
=======
882+
Version: v0.13.2
883+
Licence type (autodetected): Apache-2.0
884+
--------------------------------------------------------------------------------
885+
886+
Contents of probable licence file $GOMODCACHE/github.com/elastic/[email protected]/LICENSE.txt:
887+
>>>>>>> 898abd5 (build(deps): bump github.com/elastic/elastic-agent-system-metrics from 0.11.18 to 0.12.0 (#5273))
880888

881889
Apache License
882890
Version 2.0, January 2004

go.mod

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,13 @@ 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+
<<<<<<< HEAD
1213
github.com/elastic/elastic-agent-system-metrics v0.11.16
1314
github.com/elastic/go-elasticsearch/v8 v8.18.1
15+
=======
16+
github.com/elastic/elastic-agent-system-metrics v0.13.2
17+
github.com/elastic/go-elasticsearch/v8 v8.19.0
18+
>>>>>>> 898abd5 (build(deps): bump github.com/elastic/elastic-agent-system-metrics from 0.11.18 to 0.12.0 (#5273))
1419
github.com/elastic/go-ucfg v0.8.8
1520
github.com/fxamacker/cbor/v2 v2.8.0
1621
github.com/go-chi/chi/v5 v5.2.3

go.sum

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,13 @@ 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+
<<<<<<< HEAD
4041
github.com/elastic/elastic-agent-system-metrics v0.11.16 h1:cLjuO8pE5cUwPGWUHmy1VOERmJVDaep8gY+U4YRQ5vs=
4142
github.com/elastic/elastic-agent-system-metrics v0.11.16/go.mod h1:qiZC5p1hd8te4XVnhh7FkXdcYhxFnl5i9GJpROtf6zo=
43+
=======
44+
github.com/elastic/elastic-agent-system-metrics v0.13.2 h1:R4ogKHESuWhWTtopnw/aHnBxxSZbxd7KHV4GefdwT2M=
45+
github.com/elastic/elastic-agent-system-metrics v0.13.2/go.mod h1:ezM1kzDUT+vWXFh5oK8QXB/AEB0UoLWqWA8rkRicFFo=
46+
>>>>>>> 898abd5 (build(deps): bump github.com/elastic/elastic-agent-system-metrics from 0.11.18 to 0.12.0 (#5273))
4247
github.com/elastic/elastic-transport-go/v8 v8.7.0 h1:OgTneVuXP2uip4BA658Xi6Hfw+PeIOod2rY3GVMGoVE=
4348
github.com/elastic/elastic-transport-go/v8 v8.7.0/go.mod h1:YLHer5cj0csTzNFXoNQ8qhtGY1GTvSqPnKWKaqQE3Hk=
4449
github.com/elastic/go-elasticsearch/v8 v8.18.1 h1:lPsN2Wk6+QqBeD4ckmOax7G/Y8tAZgroDYG8j6/5Ce0=

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)