Skip to content

Commit

Permalink
fix(testbed/datasenders): add missing 0 to nanoseconds calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
pichlermarc committed Jun 3, 2024
1 parent e13b1a3 commit 55fe355
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion testbed/datasenders/syslog.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func (f *SyslogWriter) GenConfigYAMLStr() string {
`, f.network, f.GetEndpoint())
}
func (f *SyslogWriter) Send(lr plog.LogRecord) error {
ts := time.Unix(int64(lr.Timestamp()/1000000000), int64(lr.Timestamp()%100000000)).Format(time.RFC3339Nano)
ts := time.Unix(int64(lr.Timestamp()/1_000_000_000), int64(lr.Timestamp()%1_000_000_000)).Format(time.RFC3339Nano)
sdid := strings.Builder{}
sdid.WriteString(fmt.Sprintf("%s=\"%s\" ", "trace_id", lr.TraceID()))
sdid.WriteString(fmt.Sprintf("%s=\"%s\" ", "span_id", lr.SpanID()))
Expand Down
2 changes: 1 addition & 1 deletion testbed/datasenders/tcpudp.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func (f *TCPUDPWriter) GenConfigYAMLStr() string {
`, f.network, f.GetEndpoint())
}
func (f *TCPUDPWriter) Send(lr plog.LogRecord) error {
ts := time.Unix(int64(lr.Timestamp()/1000000000), int64(lr.Timestamp()%100000000)).Format(time.RFC3339Nano)
ts := time.Unix(int64(lr.Timestamp()/1_000_000_000), int64(lr.Timestamp()%1_000_000_000)).Format(time.RFC3339Nano)
sdid := strings.Builder{}
sdid.WriteString(fmt.Sprintf("%s=\"%s\" ", "trace_id", traceutil.TraceIDToHexOrEmptyString(lr.TraceID())))
sdid.WriteString(fmt.Sprintf("%s=\"%s\" ", "span_id", traceutil.SpanIDToHexOrEmptyString(lr.SpanID())))
Expand Down

0 comments on commit 55fe355

Please sign in to comment.