From e3ee45f89510559a0b1dd3e253785b0d258449c3 Mon Sep 17 00:00:00 2001 From: Vladislav Veselskiy Date: Tue, 28 Jan 2025 15:27:58 +0300 Subject: [PATCH] Add span attribute request_body. --- fcm.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fcm.go b/fcm.go index 2ff543e..7110c88 100644 --- a/fcm.go +++ b/fcm.go @@ -225,6 +225,10 @@ func (c *Client) doSendRequest(ctx context.Context, req SendRequest, loggerEnabl ) if response.StatusCode != http.StatusOK { + span.SetAttributes( + attribute.String("request_body", string(data)), + ) + err := errors.Errorf("Status is not OK. Status: %d. Body: %q.", response.StatusCode, bodyStr) span.SetStatus(codes.Error, err.Error()) span.RecordError(err)