Trying to configure APM Go Agent with a simple example:
main.go
package main
import (
"errors"
"log"
"github.com/joho/godotenv"
"go.elastic.co/apm"
)
func main() {
err := godotenv.Load()
if err != nil {
log.Println("Error loading .env file")
}
tx := apm.DefaultTracer.StartTransaction("GET /api/v1", "request")
tx.Result = "HTTP 2xx"
tx.Context.SetTag("region", "us-east-1")
defer tx.End()
e := apm.DefaultTracer.NewError(errors.New("error"))
e.Send()
}
.dotenv
ELASTIC_APM_SERVER_URL=http://192.168.1.52:8200
ELASTIC_APM_SERVICE_NAME=go-apm-test
No requests, no logs. I have looked net packets with Wireshark. No packets with dst port 8200 on client machine