diff --git a/fcm.go b/fcm.go index 161aea3..959782e 100644 --- a/fcm.go +++ b/fcm.go @@ -28,6 +28,7 @@ import ( "golang.org/x/oauth2" "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/attribute" ) const tracerName = "git.bit5.ru/backend/fcm" @@ -188,6 +189,10 @@ func (c *Client) doSendRequest(ctx context.Context, req SendRequest, loggerEnabl } defer response.Body.Close() + span.SetAttributes( + attribute.Int("response.status_code", response.StatusCode), + ) + if response.StatusCode != http.StatusOK { body, err := ioutil.ReadAll(response.Body) if err != nil {