Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func Clean ¶
func Clean(ctx context.Context, pipe <-chan *pipelines.LogEntry, wg *sync.WaitGroup, mu *sync.Mutex, Shipper pkgEx.Shipper)
Clean function that processes the received information and sends it to their corresponding functions
Parameters:
- ctx: context for cancellation (not explicitly used in the current body)
- pipe: input channel of *pipelines.LogEntry. Processing continues until the channel is closed and all remaining entries are drained.
- wg: WaitGroup to notify the caller that the goroutine has completed
- mu: mutex protecting the shared maps 'logs' and 'logsBurst'.
The function performs:
- Sanitization and clustering of log content.
- Statistics updates by source and message (logs).
- Burst detection by log level (logsBurst).
- Returning processed objects back to pools (EntryPool, BufferPool).
- Periodic exporting triggered by Ticker.C Sends logs to exporter.ShipLogs, exporter.Console and integrations.Integrations. If GenerateLogsFile is enabled, accumulates logs for later writing.
- File Export triggered by TickerReportFile.C when GenerateLogsFile is true.
Note: This functions is intented to run as a concurrent goroutine. It uses the unsafe package for zero-copy byte-to-string conversions, assuming the underlying buffers will not be modified afterward.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.