Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hook up start and shutdown functions in fileexporter #3260

Merged
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions exporter/fileexporter/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,13 @@ func createTracesExporter(
fe := exporters.GetOrAdd(cfg, func() component.Component {
return &fileExporter{path: cfg.(*Config).Path}
})
return exporterhelper.NewTracesExporter(cfg, params.Logger, fe.Unwrap().(*fileExporter).ConsumeTraces)
return exporterhelper.NewTracesExporter(
cfg,
params.Logger,
fe.Unwrap().(*fileExporter).ConsumeTraces,
exporterhelper.WithStart(fe.Unwrap().(*fileExporter).Start),
exporterhelper.WithShutdown(fe.Unwrap().(*fileExporter).Shutdown),
)
}

func createMetricsExporter(
Expand All @@ -63,7 +69,13 @@ func createMetricsExporter(
fe := exporters.GetOrAdd(cfg, func() component.Component {
return &fileExporter{path: cfg.(*Config).Path}
})
return exporterhelper.NewMetricsExporter(cfg, params.Logger, fe.Unwrap().(*fileExporter).ConsumeMetrics)
return exporterhelper.NewMetricsExporter(
cfg,
params.Logger,
fe.Unwrap().(*fileExporter).ConsumeMetrics,
exporterhelper.WithStart(fe.Unwrap().(*fileExporter).Start),
exporterhelper.WithShutdown(fe.Unwrap().(*fileExporter).Shutdown),
)
}

func createLogsExporter(
Expand All @@ -74,7 +86,13 @@ func createLogsExporter(
fe := exporters.GetOrAdd(cfg, func() component.Component {
return &fileExporter{path: cfg.(*Config).Path}
})
return exporterhelper.NewLogsExporter(cfg, params.Logger, fe.Unwrap().(*fileExporter).ConsumeLogs)
return exporterhelper.NewLogsExporter(
cfg,
params.Logger,
fe.Unwrap().(*fileExporter).ConsumeLogs,
exporterhelper.WithStart(fe.Unwrap().(*fileExporter).Start),
exporterhelper.WithShutdown(fe.Unwrap().(*fileExporter).Shutdown),
)
}

// This is the map of already created File exporters for particular configurations.
Expand Down