Skip to content

Commit 8cbb4bb

Browse files
dependabot[bot]pkoutsovasilis
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)
1 parent 7bb692a commit 8cbb4bb

File tree

5 files changed

+37
-23
lines changed

5 files changed

+37
-23
lines changed

NOTICE-fips.txt

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

843843
--------------------------------------------------------------------------------
844844
Dependency : github.com/elastic/elastic-agent-system-metrics
845-
Version: v0.11.15
845+
Version: v0.13.2
846846
Licence type (autodetected): Apache-2.0
847847
--------------------------------------------------------------------------------
848848

849-
Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-system-metrics@v0.11.15/LICENSE.txt:
849+
Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-system-metrics@v0.13.2/LICENSE.txt:
850850

851851
Apache License
852852
Version 2.0, January 2004
@@ -1053,11 +1053,11 @@ Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-s
10531053

10541054
--------------------------------------------------------------------------------
10551055
Dependency : github.com/elastic/go-elasticsearch/v8
1056-
Version: v8.17.1
1056+
Version: v8.19.0
10571057
Licence type (autodetected): Apache-2.0
10581058
--------------------------------------------------------------------------------
10591059

1060-
Contents of probable licence file $GOMODCACHE/github.com/elastic/go-elasticsearch/v8@v8.17.1/LICENSE:
1060+
Contents of probable licence file $GOMODCACHE/github.com/elastic/go-elasticsearch/v8@v8.19.0/LICENSE:
10611061

10621062
Apache License
10631063
Version 2.0, January 2004
@@ -5178,11 +5178,11 @@ SOFTWARE.
51785178

51795179
--------------------------------------------------------------------------------
51805180
Dependency : github.com/elastic/elastic-transport-go/v8
5181-
Version: v8.6.1
5181+
Version: v8.7.0
51825182
Licence type (autodetected): Apache-2.0
51835183
--------------------------------------------------------------------------------
51845184

5185-
Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-transport-go/v8@v8.6.1/LICENSE:
5185+
Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-transport-go/v8@v8.7.0/LICENSE:
51865186

51875187
Apache License
51885188
Version 2.0, January 2004

NOTICE.txt

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

843843
--------------------------------------------------------------------------------
844844
Dependency : github.com/elastic/elastic-agent-system-metrics
845-
Version: v0.11.15
845+
Version: v0.13.2
846846
Licence type (autodetected): Apache-2.0
847847
--------------------------------------------------------------------------------
848848

849-
Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-system-metrics@v0.11.15/LICENSE.txt:
849+
Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-system-metrics@v0.13.2/LICENSE.txt:
850850

851851
Apache License
852852
Version 2.0, January 2004
@@ -1053,11 +1053,11 @@ Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-s
10531053

10541054
--------------------------------------------------------------------------------
10551055
Dependency : github.com/elastic/go-elasticsearch/v8
1056-
Version: v8.17.1
1056+
Version: v8.19.0
10571057
Licence type (autodetected): Apache-2.0
10581058
--------------------------------------------------------------------------------
10591059

1060-
Contents of probable licence file $GOMODCACHE/github.com/elastic/go-elasticsearch/v8@v8.17.1/LICENSE:
1060+
Contents of probable licence file $GOMODCACHE/github.com/elastic/go-elasticsearch/v8@v8.19.0/LICENSE:
10611061

10621062
Apache License
10631063
Version 2.0, January 2004
@@ -5178,11 +5178,11 @@ SOFTWARE.
51785178

51795179
--------------------------------------------------------------------------------
51805180
Dependency : github.com/elastic/elastic-transport-go/v8
5181-
Version: v8.6.1
5181+
Version: v8.7.0
51825182
Licence type (autodetected): Apache-2.0
51835183
--------------------------------------------------------------------------------
51845184

5185-
Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-transport-go/v8@v8.6.1/LICENSE:
5185+
Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-transport-go/v8@v8.7.0/LICENSE:
51865186

51875187
Apache License
51885188
Version 2.0, January 2004

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ 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.1
11-
github.com/elastic/elastic-agent-system-metrics v0.11.15
12-
github.com/elastic/go-elasticsearch/v8 v8.17.1
11+
github.com/elastic/elastic-agent-system-metrics v0.13.2
12+
github.com/elastic/go-elasticsearch/v8 v8.19.0
1313
github.com/elastic/go-ucfg v0.8.8
1414
github.com/fxamacker/cbor/v2 v2.8.0
1515
github.com/go-chi/chi/v5 v5.2.3
@@ -52,7 +52,7 @@ require (
5252
github.com/cespare/xxhash/v2 v2.3.0 // indirect
5353
github.com/davecgh/go-spew v1.1.1 // indirect
5454
github.com/dustin/go-humanize v1.0.1 // indirect
55-
github.com/elastic/elastic-transport-go/v8 v8.6.1 // indirect
55+
github.com/elastic/elastic-transport-go/v8 v8.7.0 // indirect
5656
github.com/elastic/go-structform v0.0.12 // indirect
5757
github.com/elastic/go-sysinfo v1.15.0 // indirect
5858
github.com/elastic/go-windows v1.0.2 // indirect

go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ 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.1 h1:kFPpOG5mbdaGRRNXPb2KfEaR65Uoi8nsMbDOKA02/Go=
3737
github.com/elastic/elastic-agent-libs v0.24.1/go.mod h1:o/iXtbHYaojpG4BOY7Z3hFMQAgEoqq2owO17JPGpf3A=
38-
github.com/elastic/elastic-agent-system-metrics v0.11.15 h1:RWX0n6LakadsqB6YB2I7AIXyMlEO4qBUGWn4A+aGeKA=
39-
github.com/elastic/elastic-agent-system-metrics v0.11.15/go.mod h1:qiZC5p1hd8te4XVnhh7FkXdcYhxFnl5i9GJpROtf6zo=
40-
github.com/elastic/elastic-transport-go/v8 v8.6.1 h1:h2jQRqH6eLGiBSN4eZbQnJLtL4bC5b4lfVFRjw2R4e4=
41-
github.com/elastic/elastic-transport-go/v8 v8.6.1/go.mod h1:YLHer5cj0csTzNFXoNQ8qhtGY1GTvSqPnKWKaqQE3Hk=
42-
github.com/elastic/go-elasticsearch/v8 v8.17.1 h1:bOXChDoCMB4TIwwGqKd031U8OXssmWLT3UrAr9EGs3Q=
43-
github.com/elastic/go-elasticsearch/v8 v8.17.1/go.mod h1:MVJCtL+gJJ7x5jFeUmA20O7rvipX8GcQmo5iBcmaJn4=
38+
github.com/elastic/elastic-agent-system-metrics v0.13.2 h1:R4ogKHESuWhWTtopnw/aHnBxxSZbxd7KHV4GefdwT2M=
39+
github.com/elastic/elastic-agent-system-metrics v0.13.2/go.mod h1:ezM1kzDUT+vWXFh5oK8QXB/AEB0UoLWqWA8rkRicFFo=
40+
github.com/elastic/elastic-transport-go/v8 v8.7.0 h1:OgTneVuXP2uip4BA658Xi6Hfw+PeIOod2rY3GVMGoVE=
41+
github.com/elastic/elastic-transport-go/v8 v8.7.0/go.mod h1:YLHer5cj0csTzNFXoNQ8qhtGY1GTvSqPnKWKaqQE3Hk=
42+
github.com/elastic/go-elasticsearch/v8 v8.19.0 h1:VmfBLNRORY7RZL+9hTxBD97ehl9H8Nxf2QigDh6HuMU=
43+
github.com/elastic/go-elasticsearch/v8 v8.19.0/go.mod h1:F3j9e+BubmKvzvLjNui/1++nJuJxbkhHefbaT0kFKGY=
4444
github.com/elastic/go-structform v0.0.12 h1:HXpzlAKyej8T7LobqKDThUw7BMhwV6Db24VwxNtgxCs=
4545
github.com/elastic/go-structform v0.0.12/go.mod h1:CZWf9aIRYY5SuKSmOhtXScE5uQiLZNqAFnwKR4OrIM4=
4646
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)