Add span attribute request_body.
This commit is contained in:
parent
86e7c8815f
commit
e3ee45f895
4
fcm.go
4
fcm.go
|
@ -225,6 +225,10 @@ func (c *Client) doSendRequest(ctx context.Context, req SendRequest, loggerEnabl
|
||||||
)
|
)
|
||||||
|
|
||||||
if response.StatusCode != http.StatusOK {
|
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)
|
err := errors.Errorf("Status is not OK. Status: %d. Body: %q.", response.StatusCode, bodyStr)
|
||||||
span.SetStatus(codes.Error, err.Error())
|
span.SetStatus(codes.Error, err.Error())
|
||||||
span.RecordError(err)
|
span.RecordError(err)
|
||||||
|
|
Loading…
Reference in New Issue