Skip to content

Commit 79acd4c

Browse files
committed
Fixing conflicts
1 parent 8cbb4bb commit 79acd4c

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

internal/pkg/api/metrics.go

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,23 @@ import (
1010
"fmt"
1111
"sync"
1212

13+
"github.com/elastic/elastic-agent-system-metrics/report"
14+
"github.com/elastic/fleet-server/v7/version"
15+
"github.com/rs/zerolog"
16+
1317
"github.com/prometheus/client_golang/prometheus"
1418
"github.com/prometheus/client_golang/prometheus/promhttp"
15-
"github.com/rs/zerolog"
1619
apmprometheus "go.elastic.co/apm/module/apmprometheus/v2"
1720
"go.elastic.co/apm/v2"
1821

1922
"github.com/elastic/elastic-agent-libs/api"
2023
cfglib "github.com/elastic/elastic-agent-libs/config"
2124
"github.com/elastic/elastic-agent-libs/monitoring"
22-
"github.com/elastic/elastic-agent-system-metrics/report"
23-
2425
"github.com/elastic/fleet-server/v7/internal/pkg/build"
2526
"github.com/elastic/fleet-server/v7/internal/pkg/config"
2627
"github.com/elastic/fleet-server/v7/internal/pkg/dl"
2728
"github.com/elastic/fleet-server/v7/internal/pkg/limit"
2829
"github.com/elastic/fleet-server/v7/internal/pkg/logger"
29-
"github.com/elastic/fleet-server/v7/version"
3030
)
3131

3232
var (
@@ -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,11 +73,9 @@ func init() {
7873
cntFileDeliv.Register(routesRegistry.newRegistry("deliverFile"))
7974
cntGetPGP.Register(routesRegistry.newRegistry("getPGPKey"))
8075
cntAuditUnenroll.Register(routesRegistry.newRegistry("auditUnenroll"))
81-
<<<<<<< HEAD
82-
=======
8376

8477
err := report.SetupMetricsOptions(report.MetricOptions{
85-
Logger: zap.NewStub("instance-metrics"),
78+
Logger: logger.NewZapStub("instance-metrics"),
8679
Name: build.ServiceName,
8780
Version: version.DefaultVersion,
8881
SystemMetrics: monitoring.NewRegistry(),
@@ -91,7 +84,7 @@ func init() {
9184
if err != nil {
9285
zerolog.Ctx(context.TODO()).Error().Err(err).Msg("unable to initialize metrics") // TODO is used because this may logged during the package load
9386
}
94-
>>>>>>> 898abd5 (build(deps): bump github.com/elastic/elastic-agent-system-metrics from 0.11.18 to 0.12.0 (#5273))
87+
9588
}
9689

9790
// metricsRegistry wraps libbeat and prometheus registries

0 commit comments

Comments
 (0)