Skip to content

Commit 34135fa

Browse files
mergify[bot]dependabot[bot]pchila
authored
[8.19](backport #5700) build(deps): bump github.com/elastic/elastic-agent-system-metrics from 0.13.2 to 0.13.3 (#5701)
* build(deps): bump github.com/elastic/elastic-agent-system-metrics from 0.13.2 to 0.13.3 (#5700) * 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.13.2 to 0.13.3. - [Release notes](https://github.com/elastic/elastic-agent-system-metrics/releases) - [Commits](elastic/elastic-agent-system-metrics@v0.13.2...v0.13.3) --- updated-dependencies: - dependency-name: github.com/elastic/elastic-agent-system-metrics dependency-version: 0.13.3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * Post dependabot file modifications --------- 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> * Fix report.SetupMetricsOptions * fixup! Fix report.SetupMetricsOptions --------- 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: Paolo Chila <[email protected]>
1 parent 4808ab8 commit 34135fa

File tree

5 files changed

+33
-26
lines changed

5 files changed

+33
-26
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.3
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.3/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.3
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.3/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.3
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.3 h1:VlY3Ezuwi5bPZRsAM97WaJEW78XkXgqmPHcTl1WGMRw=
39+
github.com/elastic/elastic-agent-system-metrics v0.13.3/go.mod h1:lB8veYWYBlA9eF6TahmPN87G1IEgWlbep7QSqLSW90U=
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: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,6 @@ var (
5555
// metrics must be explicitly exposed with a call to InitMetrics
5656
// FIXME we have global metrics but an internal and external API; this may lead to some confusion.
5757
func init() {
58-
err := report.SetupMetrics(logger.NewZapStub("instance-metrics"), build.ServiceName, version.DefaultVersion)
59-
if err != nil {
60-
zerolog.Ctx(context.TODO()).Error().Err(err).Msg("unable to initialize metrics") // TODO is used because this may logged during the package load
61-
}
62-
6358
registry = newMetricsRegistry("http_server")
6459
cntHTTPNew = newCounter(registry, "tcp_open")
6560
cntHTTPClose = newCounter(registry, "tcp_close")
@@ -78,6 +73,18 @@ func init() {
7873
cntFileDeliv.Register(routesRegistry.newRegistry("deliverFile"))
7974
cntGetPGP.Register(routesRegistry.newRegistry("getPGPKey"))
8075
cntAuditUnenroll.Register(routesRegistry.newRegistry("auditUnenroll"))
76+
77+
err := report.SetupMetricsOptions(report.MetricOptions{
78+
Logger: logger.NewZapStub("instance-metrics"),
79+
Name: build.ServiceName,
80+
Version: version.DefaultVersion,
81+
SystemMetrics: monitoring.NewRegistry(),
82+
ProcessMetrics: registry.registry,
83+
})
84+
85+
if err != nil {
86+
zerolog.Ctx(context.TODO()).Error().Err(err).Msg("unable to initialize metrics") // TODO is used because this may logged during the package load
87+
}
8188
}
8289

8390
// metricsRegistry wraps libbeat and prometheus registries

0 commit comments

Comments
 (0)