apm-agent-go icon indicating copy to clipboard operation
apm-agent-go copied to clipboard

apmgormv2 2Calls mysql in kibana

Open gananggww opened this issue 1 year ago • 1 comments

Bug: using apmgormv2 double query in kibana

my config in go init db:

import (
  	"gorm.io/gorm"
	mysql "go.elastic.co/apm/module/apmgormv2/v2/driver/mysql"
)

//.....

o.Db, err = gorm.Open(mysql.Open(host), &gorm.Config{
		Logger: newLogger,
})

using gorm with context:

...
        err = o.db.WithContext(ctx).Table(tableNameActivation).Where(map[string]interface{}{"username": trueUname}).First(&act).Error
	if err != nil {
		return
	}

and the result in my kibana:

Image

any 2 cell in one query

Image

2 call in one sample query detail

expactation shold produce 1 query in 1 cell and 1 calls

gananggww avatar Aug 28 '24 07:08 gananggww

helo sorry , can i see on how you setup the gorm.io/gorm db connection with apmmysql driver, my query span didn't even show on my apm

ramasuryananda avatar Oct 09 '24 15:10 ramasuryananda