Documentation
¶
Overview ¶
Example ¶
package main
import (
"log"
pgtrace "git.proto.group/protoobp/pobp-trace-go/contrib/go-pg/pg.v10"
"github.com/go-pg/pg/v10"
)
func main() {
conn := pg.Connect(&pg.Options{
User: "go-pg-test",
Database: "protoobp",
})
// Wrap the connection with the APM hook.
pgtrace.Wrap(conn)
var user struct {
Name string
}
_, err := conn.QueryOne(&user, "SELECT name FROM users")
if err != nil {
log.Fatal(err)
}
}
Output:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option func(*config)
Option represents an option that can be used to create or wrap a client.
func WithAnalytics ¶
WithAnalytics enables Trace Analytics for all started spans.
func WithAnalyticsRate ¶
WithAnalyticsRate sets the sampling rate for Trace Analytics events correlated to started spans.
func WithServiceName ¶
WithServiceName sets the given service name for the client.
Click to show internal directories.
Click to hide internal directories.