Просмотр исходного кода

Add server entry source and timestamp to diagnostics

Rod Hynes 4 лет назад
Родитель
Сommit
a2deebb21e
1 измененных файлов с 14 добавлено и 0 удалено
  1. 14 0
      psiphon/notice.go

+ 14 - 0
psiphon/notice.go

@@ -459,6 +459,8 @@ func noticeWithDialParameters(noticeType string, dialParams *DialParameters) {
 
 	if GetEmitNetworkParameters() {
 
+		// Omit appliedTacticsTag as that is emitted in another notice.
+
 		if dialParams.BPFProgramName != "" {
 			args = append(args, "client_bpf", dialParams.BPFProgramName)
 		}
@@ -510,6 +512,18 @@ func noticeWithDialParameters(noticeType string, dialParams *DialParameters) {
 			args = append(args, "TLSVersion", dialParams.GetTLSVersionForMetrics())
 		}
 
+		// dialParams.ServerEntry.Region is emitted above.
+
+		if dialParams.ServerEntry.LocalSource != "" {
+			args = append(args, "serverEntrySource", dialParams.ServerEntry.LocalSource)
+		}
+
+		localServerEntryTimestamp := common.TruncateTimestampToHour(
+			dialParams.ServerEntry.LocalTimestamp)
+		if localServerEntryTimestamp != "" {
+			args = append(args, "serverEntryTimestamp", localServerEntryTimestamp)
+		}
+
 		if dialParams.DialPortNumber != "" {
 			args = append(args, "dialPortNumber", dialParams.DialPortNumber)
 		}