-
Notifications
You must be signed in to change notification settings - Fork 243
Open
Labels
enhancementlibraryIssues pertaining to the use of the packages as a library more than the exporter itselfIssues pertaining to the use of the packages as a library more than the exporter itself
Description
Description
The current Parser implementation in pkg/line/line.go handles multiple types of syntax (DogStatsD, InfluxDB, Librato, SignalFX) within a single parser. This makes the code complex and harder to maintain. We propose refactoring the Parser to separate parsers for each syntax type.
Goals
- Improve Code Maintainability: By separating the parsing logic for different syntax types, the code will be easier to understand and maintain.
- Allow for improvements for specific cases: The current parser is quite slow and heavy on allocations for parsing tags for Dogstatsd, for example. We could after refactoring ensure that we optimize that specific parser.
- Avoid Breaking Changes: Ensure that the refactoring does not break existing projects that use this repository as a library.
Proposed Solution
- Create Separate Parsers: Implement individual parsers for DogStatsD, InfluxDB, Librato, and SignalFX.
- Parser Interface: Define a
Parserinterface that each specific parser will implement. - Stop-gap MultiParser: Define a MultiParser that will mimic the current behavior of the parser, and will check if the incoming line uses which type of tagging. This is necessary, if your instance needs to understand more than one type of syntax.
- Factory Method: Implement a factory method to create the appropriate parser based on configuration, here we could make sure to use only the specific parser, if only one syntax is enabled.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementlibraryIssues pertaining to the use of the packages as a library more than the exporter itselfIssues pertaining to the use of the packages as a library more than the exporter itself