Comments (6)
i got same issue
the point is, if query using parameter arguments got failed and return error missing method CheckNamedValue
but, if using query plain without parameter is succeed
from pinpoint-go-agent.
how to query using func QueryContext with argument?
i used db.QueryContext(ctx, myQuery, args1, args2)
i still get error *pq.conn is not driver.NamedValueChecker: missing method CheckNamedValue
from pinpoint-go-agent.
The code that solved the problem was committed to the main branch, and the problem you mentioned do not occur when I test. I think you tested it with the previously released version. Check if you tested it with the main branch.
Or maybe it's because of the go runtime version, but I tested it at 1.18.4. What version did you use?
from pinpoint-go-agent.
The code that solved the problem was committed to the main branch, and the problem you mentioned do not occur when I test. I think you tested it with the previously released version. Check if you tested it with the main branch.
Or maybe it's because of the go runtime version, but I tested it at 1.18.4. What version did you use?
I used go 19 version, and i'm still strugling with this errors :D
it's my code, if you can correct my code
`
package main
import (
"context"
"database/sql"
"fmt"
"log"
"net/http"
pinpoint "github.com/pinpoint-apm/pinpoint-go-agent"
phttp "github.com/pinpoint-apm/pinpoint-go-agent/plugin/http"
"github.com/pkg/errors"
_ "github.com/pinpoint-apm/pinpoint-go-agent/plugin/pgsql" // wrap driver psql.
)
const queryG = "select
smc_member,
smc_no_juklak,
sum(smc_star) as star
from star_member_cancel smc
join star_master_expired sme on smc.smc_no_juklak = sme.sme_no_juklak and (now() at time zone 'Asia/Jakarta')::timestamp <= (sme.sme_expired_date at time zone 'Asia/Jakarta')::timestamp
where smc_no_juklak = $1
group by smc_member, smc_no_juklak"
func main() {
opts := []pinpoint.ConfigOption{
pinpoint.WithAppName("test-pinpoint"),
pinpoint.WithAgentId("test-pinpoint-agent"),
pinpoint.WithCollectorHost("pinpoint-host"),
}
cfg, _ := pinpoint.NewConfig(opts...)
agent, err := pinpoint.NewAgent(cfg)
if err != nil {
log.Fatalf("pinpoint agent start fail=%v", err)
}
http.HandleFunc(phttp.WrapHandleFunc(agent, "query", "/", query))
http.ListenAndServe(":9000", nil)
agent.Shutdown()
}
func query(w http.ResponseWriter, r *http.Request) {
db, err := sql.Open("pq-pinpoint", "postgresql://user:password@host:port/db?sslmode=disable")
if err != nil {
log.Fatalf("error connecting DB =%v", err)
}
defer db.Close()
tracer := pinpoint.TracerFromRequestContext(r)
ctx := pinpoint.NewContext(context.Background(), tracer)
_, err = db.Prepare("select * from star_member_collect where smc_no_juklak=$1")
if err != nil {
log.Fatalf("err stmt: %v", err)
}
rows, err := db.QueryContext(ctx, queryG, "asdasds")
if err != nil {
log.Fatalf("sql error: %v", err)
}
var count int
for rows.Next() {
err = rows.Scan(&count)
if err != nil && !errors.Is(err, sql.ErrNoRows) {
log.Fatalf("sql error: %v", err)
}
}
defer rows.Close()
fmt.Println("number of entries in pg_catalog.pg_tables", count)
}
`
and my pinpoint-go-agent version is v0.5.1
from pinpoint-go-agent.
There is no problem when I test the go 19 version. Please refer to the link below and test it with the main branch.
from pinpoint-go-agent.
There is no problem when I test the go 19 version. Please refer to the link below and test it with the main branch.
it's solved, thank you for yout advice
from pinpoint-go-agent.
Related Issues (20)
- grpc plugin - peer address issue
- invalid handler name from echo plugins
- MS SQL-Server plugin HOT 1
- Oracle plugin HOT 1
- fix plugins to have go.mod file each
- build with lower grpc versions HOT 1
- sarama plugin - call tree display error
- Memory leak from EndSpan
- support request URL statistics
- elasticsearch plugin - node is not displayed on the server map
- fasthttp router plugin
- go-redis import path changed HOT 2
- Cascade sampling error HOT 1
- please support custom plugin for avatica phoenix
- Error from handler is not propagated in echo middleware HOT 1
- calcite-avatica-go plugin
- segment violation connectGrpcServer HOT 1
- optimize grpc debug log message HOT 1
- incorrect cpu usage value on inspector screen
- How to avoid data race when send message with sarama plugin? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pinpoint-go-agent.