diff --git a/telemetry/client.go b/telemetry/client.go index 1c9d039..7e6cc7b 100644 --- a/telemetry/client.go +++ b/telemetry/client.go @@ -57,13 +57,13 @@ func (c *Client) SendTelemetry(invokedFunctionARN string, telemetry [][]byte) er logEvents = append(logEvents, logEvent) } - if len(c.functionName) == 0 { + if len(c.functionName) == 0 { nameStart := strings.Index(invokedFunctionARN, ":function:") + len(":function:") nameLen := strings.Index(invokedFunctionARN[nameStart:], ":") if nameLen < 0 { nameLen = len(invokedFunctionARN) - nameStart } - c.functionName = invokedFunctionARN[nameStart:nameStart+nameLen] + c.functionName = invokedFunctionARN[nameStart : nameStart+nameLen] util.Debugf("Recovered missing function name: %s", c.functionName) } diff --git a/telemetry/client_test.go b/telemetry/client_test.go index 5ddbb94..152b796 100644 --- a/telemetry/client_test.go +++ b/telemetry/client_test.go @@ -42,7 +42,7 @@ func TestClientSend(t *testing.T) { client := NewWithHTTPClient(srv.Client(), "", "a mock license key", &srv.URL) bytes := []byte("foobar") - err := client.SendTelemetry("fakeArn", [][]byte{bytes}) + err := client.SendTelemetry("arn:aws:lambda:us-east-1:1234:function:newrelic-example-go", [][]byte{bytes}) assert.NoError(t, err) }