diff --git a/fcm.go b/fcm.go index 40614ec..fc46814 100644 --- a/fcm.go +++ b/fcm.go @@ -103,6 +103,10 @@ func NewClient(cfg ClientConfig, ts oauth2.TokenSource, hc *http.Client, logger } func (c *Client) SendMessage(ctx context.Context, msg Message) (SendResponse, error) { + + ctx, span := tracer.Start(ctx, "Client.SendMessage") + defer span.End() + sendRequest := SendRequest{ ValidateOnly: false, Message: msg, @@ -112,6 +116,10 @@ func (c *Client) SendMessage(ctx context.Context, msg Message) (SendResponse, er } func (c *Client) ValidateMessage(ctx context.Context, msg Message) (SendResponse, error) { + + ctx, span := tracer.Start(ctx, "Client.ValidateMessage") + defer span.End() + sendRequest := SendRequest{ ValidateOnly: true, Message: msg, @@ -121,6 +129,10 @@ func (c *Client) ValidateMessage(ctx context.Context, msg Message) (SendResponse } func (c *Client) Send(ctx context.Context, message Message) (string, error) { + + ctx, span := tracer.Start(ctx, "Client.Send") + defer span.End() + sendRequest := SendRequest{ ValidateOnly: false, Message: message, @@ -131,6 +143,10 @@ func (c *Client) Send(ctx context.Context, message Message) (string, error) { } func (c *Client) Validate(ctx context.Context, message Message) (string, error) { + + ctx, span := tracer.Start(ctx, "Client.Validate") + defer span.End() + sendRequest := SendRequest{ ValidateOnly: true, Message: message,