preview.go
preview.go - Overview
- Overview
This file contains functions to simulate log pipeline processing using the OpenTelemetry Collector simulator. It includes functions for converting between model.SignozLog
and plog.Logs
formats, simulating pipeline processing, and handling the configuration of the collector.
- Detailed Documentation
- Function:
SimulatePipelinesProcessing
- Purpose: Simulates the processing of logs through a series of pipelines using the OpenTelemetry Collector simulator.
- Parameters:
ctx
(context.Context): The context for cancellation and timeouts.pipelines
([]pipelinetypes.GettablePipeline): A slice of pipelines to simulate.logs
([]model.SignozLog): A slice of logs to process.
- Returns:
output
([]model.SignozLog): The processed logs.collectorWarnAndErrorLogs
([]string): A slice of warning and error messages from the collector.apiErr
(*model.ApiError): An error, if any occurred during simulation.
- Function:
SignozLogsToPLogs
- Purpose: Converts a slice of
model.SignozLog
to a slice ofplog.Logs
. - Parameters:
logs
([]model.SignozLog): A slice of logs to convert.
- Returns:
[]plog.Logs
: The converted logs in plog format.
- Purpose: Converts a slice of
- Function:
PLogsToSignozLogs
- Purpose: Converts a slice of
plog.Logs
to a slice ofmodel.SignozLog
. - Parameters:
plogs
([]plog.Logs): A slice of logs to convert.
- Returns:
[]model.SignozLog
: The converted logs inmodel.SignozLog
format.
- Purpose: Converts a slice of
- Function:
pMapToStrMap
- Purpose: Converts a
pcommon.Map
to amap[string]string
. - Parameters:
pMap
(pcommon.Map): The map to convert.
- Returns:
map[string]string
: The converted map.
- Purpose: Converts a
- Code Examples
Not applicable, the code is self-explanatory.
- Clarity and Accuracy
The documentation is based solely on the code provided.
- Markdown & MDX Perfection
No issues found.
-
Edge Cases To Avoid Breaking MDX No issues found.
-
Getting Started Relevance
Include in Getting Started: NO