Documentation ¶
Overview ¶
Package ppgocql instruments the gocql package (https://github.com/gocql/gocql).
This package instruments all queries created from gocql session. Use the NewObserver as the gocql.QueryObserver or gocql.BatchObserver:
cluster := gocql.NewCluster("127.0.0.1") cluster.QueryObserver = ppgocql.NewObserver()
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Observer ¶
type Observer struct{}
func NewObserver ¶
func NewObserver() *Observer
NewObserver returns a query or batch observer ready to instrument.
func (*Observer) ObserveBatch ¶
func (o *Observer) ObserveBatch(ctx context.Context, batch gocql.ObservedBatch)
ObserveBatch instruments all batch queries created from gocql session. It is necessary to pass the context containing the pinpoint.Tracer to the query. Refer an example of ObserveQuery.
func (*Observer) ObserveQuery ¶
func (o *Observer) ObserveQuery(ctx context.Context, query gocql.ObservedQuery)
ObserveQuery instruments all queries created from gocql session. It is necessary to pass the context containing the pinpoint.Tracer to the query.
query := session.Query(query) ctx := pinpoint.NewContext(context.Background(), tracer) query.WithContext(ctx).Consistency(gocql.One).Scan(&id, &text)
Click to show internal directories.
Click to hide internal directories.