kezhenxu94 commented on a change in pull request #42:
URL: 
https://github.com/apache/skywalking-data-collect-protocol/pull/42#discussion_r557812718



##########
File path: event/Event.proto
##########
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+syntax = "proto3";
+
+package skywalking.v3;
+
+option java_multiple_files = true;
+option java_package = "org.apache.skywalking.apm.network.event.v3";
+option csharp_namespace = "SkyWalking.NetworkProtocol.V3";
+option go_package = "skywalking/network/event/v3";
+
+import "common/Common.proto";
+
+service EventService {
+  // When reporting an event, you typically call the collect function twice, 
one for starting of the event and the other one for ending of the event, with 
the same UUID.
+  // There are also cases where you have both start time and end time already, 
for example, when exporting events from a 3rd-party system,
+  // the start time and end time are already known so that you can call the 
collect function only once.
+  rpc collect (stream Event) returns (Commands) {
+  }
+}
+
+message Event {
+  // Unique ID of the event. Because an event may span a long period of time, 
the UUID is necessary to associate the
+  // start time with the end time of the same event.
+  string uuid = 1;
+
+  // The source object that the event occurs on.
+  Source source = 2;
+
+  // The name of the event. For example, `Reboot`, `Upgrade` etc.
+  string name = 3;
+
+  // The type of the event. This field is friendly for UI visualization, where 
events of type `Normal` are considered as normal operations,
+  // while `Error` is considered as unexpected operations, such as `Crash` 
events, therefore we can mark them with different colors to be easier 
identified.
+  Type type = 4;
+
+  // The detail of the event that describes why this event happened. This 
should be a one-line message that briefly describes why the event is reported.
+  // Examples of an `Upgrade` event may be something like `Upgrade from 
${from_version} to ${to_version}`.
+  // It's NOT encouraged to include the detailed logs of this event, such as 
the exception stack trace.
+  string message = 5;
+
+  // The parameters in the `message` field.
+  map<string, string> parameters = 6;
+
+  // The start time (in milliseconds) of the event, measured between the 
current time and midnight, January 1, 1970 UTC.
+  // This field is mandatory when an event occurs.
+  int64 startTime = 7;
+
+  // The end time (in milliseconds) of the event. , measured between the 
current time and midnight, January 1, 1970 UTC.
+  // This field may be empty if the event has not stopped yet, otherwise it 
should be a valid timestamp after `startTime`.
+  int64 endTime = 8;
+}
+
+enum Type {
+  Normal = 0;
+  Error = 1;
+}
+
+message Source {
+  string service = 1;
+  string serviceInstance = 2;
+  string endpoint = 3;

Review comment:
       The usage in my mind is, 
   
   - If the event occurs on a service ONLY, the serviceInstance and endpoint 
are optional;
   - If it occurs on serviceInstance, the service and serviceInstance are 
mandatory and endpoint is optional;
   - If it occurs on an endpoint, `service` and `endpoint` are mandatory and 
`serviceInstance` is optional (depends on whether the event occurs a particular 
service instance or all instances of a service), does it 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]


Reply via email to