Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
Logger *zap.Logger
Generators []any
Output output.Output
// contains filtered or unexported fields
}
Service manages generators and an output. It delegates orchestration of migrated ProducerModule generators to internal/runtime.Runtime and keeps the type-switch dispatch only for legacy generators that still use the writer-based Start signature (winevt, hostmetrics, traces).
func (*Service) Start ¶
Start starts all generators. ProducerModules run through Runtime; legacy metric/trace/log generators dispatch via writer interfaces.
If any legacy generator's Start fails (or the type switch hits the default case), Start rolls back: legacy generators already started are stopped in reverse order, then the Runtime is stopped, then the original error is returned. This prevents goroutine/worker leaks when Start aborts midway. Note that legacy generators' Stop methods use close(stopCh) under the hood, which panics on a second close — callers must NOT call Service.Stop after Service.Start returned an error; the rollback already cleaned up.