Skip to content

Commit

Permalink
deps: Fix inmemexporter after dependency updates (#182)
Browse files Browse the repository at this point in the history
The inmemexporter was broken after the upstream otel dependencies were
updated

Signed-off-by: Marc Lopez Rubio <[email protected]>
  • Loading branch information
marclop authored Nov 11, 2024
1 parent 2da06d9 commit ec5113e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
10 changes: 5 additions & 5 deletions cmd/otelinmemexporter/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (

func NewFactory() exporter.Factory {
return exporter.NewFactory(
componentID,
component.MustNewType(componentID),
createDefaultConfig,
exporter.WithMetrics(
createMetricsExporter,
Expand All @@ -34,7 +34,7 @@ func createDefaultConfig() component.Config {

func createMetricsExporter(
ctx context.Context,
settings exporter.CreateSettings,
settings exporter.Settings,
rawCfg component.Config,
) (exporter.Metrics, error) {
cfg := rawCfg.(*Config)
Expand All @@ -49,13 +49,13 @@ func createMetricsExporter(
newServer(store, cfg.Server.Endpoint, logger).Start()

exp := new(*cfg, store, logger)
return exporterhelper.NewMetricsExporter(
return exporterhelper.NewMetrics(
ctx, settings, cfg,
exp.consumeMetrics,
exporterhelper.WithCapabilities(consumer.Capabilities{MutatesData: false}),
// Disable Timeout/RetryOnFailure and SendingQueue
exporterhelper.WithTimeout(exporterhelper.TimeoutSettings{Timeout: 0}),
exporterhelper.WithTimeout(exporterhelper.TimeoutConfig{Timeout: 0}),
exporterhelper.WithRetry(configretry.BackOffConfig{Enabled: false}),
exporterhelper.WithQueue(exporterhelper.QueueSettings{Enabled: false}),
exporterhelper.WithQueue(exporterhelper.QueueConfig{Enabled: false}),
)
}
5 changes: 3 additions & 2 deletions cmd/otelinmemexporter/go.mod
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
module github.com/elastic/apm-perf/cmd/otelinmemexporter

go 1.22
toolchain go1.22.5
go 1.22.0

toolchain go1.23.2

require (
github.com/gorilla/mux v1.8.1
Expand Down

0 comments on commit ec5113e

Please sign in to comment.