Save token in span.
This commit is contained in:
parent
678438ace4
commit
65928f4c0b
7
fcm.go
7
fcm.go
|
@ -27,6 +27,7 @@ import (
|
|||
"go.opentelemetry.io/otel"
|
||||
"go.opentelemetry.io/otel/attribute"
|
||||
"go.opentelemetry.io/otel/codes"
|
||||
"go.opentelemetry.io/otel/trace"
|
||||
)
|
||||
|
||||
const tracerName = "git.bit5.ru/backend/fcm"
|
||||
|
@ -166,7 +167,11 @@ func (c *Client) Validate(ctx context.Context, message Message) (string, error)
|
|||
|
||||
func (c *Client) doSendRequest(ctx context.Context, req SendRequest, loggerEnabled bool) (SendResponse, error) {
|
||||
|
||||
_, span := tracer.Start(ctx, "Client.doSendRequest")
|
||||
spanAttrs := trace.WithAttributes(
|
||||
attribute.String("token", req.Message.Token),
|
||||
)
|
||||
|
||||
_, span := tracer.Start(ctx, "Client.doSendRequest", spanAttrs)
|
||||
defer span.End()
|
||||
|
||||
accessToken, err := c.ts.Token()
|
||||
|
|
Loading…
Reference in New Issue