You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2022/04/08 04:04:26 UTC

[GitHub] [skywalking-satellite] mrproliu commented on a diff in pull request #108: Fix Metadata lost in the Native Meter protocol

mrproliu commented on code in PR #108:
URL: https://github.com/apache/skywalking-satellite/pull/108#discussion_r845719929


##########
plugins/forwarder/grpc/nativemeter/forwarder.go:
##########
@@ -98,22 +98,28 @@ func (f *Forwarder) Forward(batch event.BatchEvents) error {
 			}
 		}
 	}()
+	oldTransformDataCount := 0
 	for _, e := range batch {
-		if data, ok := e.GetData().(*v1.SniffData_Meter); ok {
-			if err := f.handleMeter(data, streamMap); err != nil {
-				return err
-			}
-		}
-		if data, ok := e.GetData().(*v1.SniffData_MeterCollection); ok {
+		switch data := e.GetData().(type) {
+		case *v1.SniffData_MeterCollection:
 			if err := f.handleMeterCollection(data, streamMap); err != nil {
 				return err
 			}
+		case *v1.SniffData_Meter:
+			oldTransformDataCount++

Review Comment:
   updated.



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org