wu-sheng commented on a change in pull request #6727:
URL: https://github.com/apache/skywalking/pull/6727#discussion_r619903972
##########
File path: oap-server/server-bootstrap/src/main/resources/oal/core.oal
##########
@@ -68,3 +68,18 @@ database_access_resp_time =
from(DatabaseAccess.latency).longAvg();
database_access_sla = from(DatabaseAccess.*).percent(status == true);
database_access_cpm = from(DatabaseAccess.*).cpm();
database_access_percentile = from(DatabaseAccess.latency).percentile(10);
+
+// TCP services' metrics
+service_throughput_received = from(Service.tcpInfo.receivedBytes).filter(type
== RequestType.TCP).longAvg();
+service_throughput_sent = from(Service.tcpInfo.sentBytes).filter(type ==
RequestType.TCP).longAvg();
+service_relation_client_received =
from(ServiceRelation.tcpInfo.sentBytes).filter(type ==
RequestType.TCP).filter(detectPoint == DetectPoint.CLIENT).longAvg();
+service_relation_client_sent =
from(ServiceRelation.tcpInfo.sentBytes).filter(type ==
RequestType.TCP).filter(detectPoint == DetectPoint.CLIENT).longAvg();
+service_relation_server_received =
from(ServiceRelation.tcpInfo.sentBytes).filter(type ==
RequestType.TCP).filter(detectPoint == DetectPoint.SERVER).longAvg();
+service_relation_server_sent =
from(ServiceRelation.tcpInfo.sentBytes).filter(type ==
RequestType.TCP).filter(detectPoint == DetectPoint.SERVER).longAvg();
+
+service_instance_throughput_received =
from(ServiceInstance.tcpInfo.receivedBytes).filter(type ==
RequestType.TCP).longAvg();
+service_instance_throughput_sent =
from(ServiceInstance.tcpInfo.sentBytes).filter(type ==
RequestType.TCP).longAvg();
+service_instance_relation_client_received =
from(ServiceInstanceRelation.tcpInfo.sentBytes).filter(type ==
RequestType.TCP).filter(detectPoint == DetectPoint.CLIENT).longAvg();
+service_instance_relation_client_sent =
from(ServiceInstanceRelation.tcpInfo.sentBytes).filter(type ==
RequestType.TCP).filter(detectPoint == DetectPoint.CLIENT).longAvg();
+service_instance_relation_server_received =
from(ServiceInstanceRelation.tcpInfo.sentBytes).filter(type ==
RequestType.TCP).filter(detectPoint == DetectPoint.SERVER).longAvg();
+service_instance_relation_server_sent =
from(ServiceInstanceRelation.tcpInfo.sentBytes).filter(type ==
RequestType.TCP).filter(detectPoint == DetectPoint.SERVER).longAvg();
Review comment:
I think this should only be activated when the ALS receiver activated.
So, this should be another OAL file.
Also, I think you need to filter `tcpInfo == null` to generate metrics like
CPM, meanwhile, only to generate TCP metrics when `tcpInfo != null` even when
ALS receiver activated, make sense?
Another question is about `responseCode`, what is TCP level response code?
##########
File path: oap-server/server-bootstrap/src/main/resources/oal/core.oal
##########
@@ -68,3 +68,18 @@ database_access_resp_time =
from(DatabaseAccess.latency).longAvg();
database_access_sla = from(DatabaseAccess.*).percent(status == true);
database_access_cpm = from(DatabaseAccess.*).cpm();
database_access_percentile = from(DatabaseAccess.latency).percentile(10);
+
+// TCP services' metrics
+service_throughput_received = from(Service.tcpInfo.receivedBytes).filter(type
== RequestType.TCP).longAvg();
+service_throughput_sent = from(Service.tcpInfo.sentBytes).filter(type ==
RequestType.TCP).longAvg();
+service_relation_client_received =
from(ServiceRelation.tcpInfo.sentBytes).filter(type ==
RequestType.TCP).filter(detectPoint == DetectPoint.CLIENT).longAvg();
+service_relation_client_sent =
from(ServiceRelation.tcpInfo.sentBytes).filter(type ==
RequestType.TCP).filter(detectPoint == DetectPoint.CLIENT).longAvg();
+service_relation_server_received =
from(ServiceRelation.tcpInfo.sentBytes).filter(type ==
RequestType.TCP).filter(detectPoint == DetectPoint.SERVER).longAvg();
+service_relation_server_sent =
from(ServiceRelation.tcpInfo.sentBytes).filter(type ==
RequestType.TCP).filter(detectPoint == DetectPoint.SERVER).longAvg();
+
+service_instance_throughput_received =
from(ServiceInstance.tcpInfo.receivedBytes).filter(type ==
RequestType.TCP).longAvg();
+service_instance_throughput_sent =
from(ServiceInstance.tcpInfo.sentBytes).filter(type ==
RequestType.TCP).longAvg();
+service_instance_relation_client_received =
from(ServiceInstanceRelation.tcpInfo.sentBytes).filter(type ==
RequestType.TCP).filter(detectPoint == DetectPoint.CLIENT).longAvg();
+service_instance_relation_client_sent =
from(ServiceInstanceRelation.tcpInfo.sentBytes).filter(type ==
RequestType.TCP).filter(detectPoint == DetectPoint.CLIENT).longAvg();
+service_instance_relation_server_received =
from(ServiceInstanceRelation.tcpInfo.sentBytes).filter(type ==
RequestType.TCP).filter(detectPoint == DetectPoint.SERVER).longAvg();
+service_instance_relation_server_sent =
from(ServiceInstanceRelation.tcpInfo.sentBytes).filter(type ==
RequestType.TCP).filter(detectPoint == DetectPoint.SERVER).longAvg();
Review comment:
OK, ignore my CPM question part. You are using PPM, but please add
comments on the OAL to make it clear.
##########
File path: oap-server/server-bootstrap/src/main/resources/oal/core.oal
##########
@@ -68,3 +68,18 @@ database_access_resp_time =
from(DatabaseAccess.latency).longAvg();
database_access_sla = from(DatabaseAccess.*).percent(status == true);
database_access_cpm = from(DatabaseAccess.*).cpm();
database_access_percentile = from(DatabaseAccess.latency).percentile(10);
+
+// TCP services' metrics
+service_throughput_received = from(Service.tcpInfo.receivedBytes).filter(type
== RequestType.TCP).longAvg();
+service_throughput_sent = from(Service.tcpInfo.sentBytes).filter(type ==
RequestType.TCP).longAvg();
+service_relation_client_received =
from(ServiceRelation.tcpInfo.sentBytes).filter(type ==
RequestType.TCP).filter(detectPoint == DetectPoint.CLIENT).longAvg();
+service_relation_client_sent =
from(ServiceRelation.tcpInfo.sentBytes).filter(type ==
RequestType.TCP).filter(detectPoint == DetectPoint.CLIENT).longAvg();
+service_relation_server_received =
from(ServiceRelation.tcpInfo.sentBytes).filter(type ==
RequestType.TCP).filter(detectPoint == DetectPoint.SERVER).longAvg();
+service_relation_server_sent =
from(ServiceRelation.tcpInfo.sentBytes).filter(type ==
RequestType.TCP).filter(detectPoint == DetectPoint.SERVER).longAvg();
+
+service_instance_throughput_received =
from(ServiceInstance.tcpInfo.receivedBytes).filter(type ==
RequestType.TCP).longAvg();
+service_instance_throughput_sent =
from(ServiceInstance.tcpInfo.sentBytes).filter(type ==
RequestType.TCP).longAvg();
+service_instance_relation_client_received =
from(ServiceInstanceRelation.tcpInfo.sentBytes).filter(type ==
RequestType.TCP).filter(detectPoint == DetectPoint.CLIENT).longAvg();
+service_instance_relation_client_sent =
from(ServiceInstanceRelation.tcpInfo.sentBytes).filter(type ==
RequestType.TCP).filter(detectPoint == DetectPoint.CLIENT).longAvg();
+service_instance_relation_server_received =
from(ServiceInstanceRelation.tcpInfo.sentBytes).filter(type ==
RequestType.TCP).filter(detectPoint == DetectPoint.SERVER).longAvg();
+service_instance_relation_server_sent =
from(ServiceInstanceRelation.tcpInfo.sentBytes).filter(type ==
RequestType.TCP).filter(detectPoint == DetectPoint.SERVER).longAvg();
Review comment:
> There is no response code for TCP transport, I set the status
according to the internalErrorCode, it exists in TCP transport.
Make sense.
--
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]