Skip to content

Commit 4f6c4aa

Browse files
committed
Add changelog and test json first event for timestamp
1 parent 401b489 commit 4f6c4aa

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
change_type: bug_fix
2+
component: libhoneyreceiver
3+
note: return full array of statuses per event
4+
issues: [42272]
5+
subtext:
6+
Libhoney has a per-event-within-each-batch response code array for each batch received.
7+
This has now been implemented for both initial parsing errors as well as downstream consumer errors.
8+
change_logs: [user]

receiver/libhoneyreceiver/receiver.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,13 @@ func (r *libhoneyReceiver) handleEvent(resp http.ResponseWriter, req *http.Reque
271271
writeLibhoneyError(resp, enc, "failed to unmarshal JSON")
272272
return
273273
}
274+
274275
if len(libhoneyevents) > 0 {
275-
r.settings.Logger.Debug("Decoding with json worked", zap.Time("timestamp.first.msgpacktimestamp", *libhoneyevents[0].MsgPackTimestamp), zap.String("timestamp.first.time", libhoneyevents[0].Time))
276+
if libhoneyevents[0].MsgPackTimestamp != nil {
277+
r.settings.Logger.Debug("Decoding with json worked", zap.Time("timestamp.first.msgpacktimestamp", *libhoneyevents[0].MsgPackTimestamp), zap.String("timestamp.first.time", libhoneyevents[0].Time))
278+
} else {
279+
r.settings.Logger.Debug("Decoding with json worked", zap.String("timestamp.first.time", libhoneyevents[0].Time))
280+
}
276281
}
277282
default:
278283
r.settings.Logger.Info("unsupported content type", zap.String("content-type", req.Header.Get("Content-Type")))

0 commit comments

Comments
 (0)