kezhenxu94 commented on issue #6719:
URL: https://github.com/apache/skywalking/issues/6719#issuecomment-817846098


   > I would implement 2 filters, which are log abort filter and log metrics 
Filter.
   > So it's simpler than the LAL in the server.
   
   The feature parity between Go version and Java version is not a big concern 
to me, what I'm concerned is to design the architecture carefully and to make 
it easily extend when we need to implement all the features in Java version, 
see my comments 👇.
   
   According to your comment 
https://github.com/apache/skywalking/issues/6719#issuecomment-817803089 , I'm 
afraid that the implementation will be very specific to what you need, not in a 
general manner.
   
   Because there is DSL in the Java version, which makes the LAL in Java looks 
more "modern", while I didn't find DSL in Go, here is my suggestions.
   
   Because all discussed above are `filter` plugin, I'd suggest defining a 
general filter and some strategies (that can be defined by users and can be 
reused) to perform the actions after the filtered logs, here is a possible 
configuration.
   
   
   ```yaml
   filters:
     - regex: ".*DEBUG.*"
       # ... other configurations
       actions:
         - abort
     - regex: ".*failed to order a product.*"
       # ... other configurations
       actions:
         - countErrorMetrics
         - abort
     - regex: ".*failed to order a product.*"
       actions:
         - label1
   
   filterActions:
     - countErrorMetrics:
         name: "errorLogCount"
         type: counter
         # ... other
     - abort: {}
     - label1:
       key: "{{ Log.Key }}"
       val: "constantValue"
     - label2:
       key: "level"
       val: "{{ Log.Level }}"
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to