package ocsql

Import Path
	contrib.go.opencensus.io/integrations/ocsql (on go.dev)

Dependency Relation
	imports 14 packages, and imported by 2 packages


Package-Level Type Names (total 10, in which 2 are exported)
/* sort exporteds by: | */
TraceOption allows for managing ocsql configuration using functional options. func WithAllowRoot(b bool) TraceOption func WithAllTraceOptions() TraceOption func WithDefaultAttributes(attrs ...trace.Attribute) TraceOption func WithLastInsertID(b bool) TraceOption func WithOptions(options TraceOptions) TraceOption func WithPing(b bool) TraceOption func WithQuery(b bool) TraceOption func WithQueryParams(b bool) TraceOption func WithRowsAffected(b bool) TraceOption func WithRowsClose(b bool) TraceOption func WithRowsNext(b bool) TraceOption func Register(driverName string, options ...TraceOption) (string, error) func Wrap(d driver.Driver, options ...TraceOption) driver.Driver func WrapConn(c driver.Conn, options ...TraceOption) driver.Conn func WrapConnector(dc driver.Connector, options ...TraceOption) driver.Connector func golang.org/x/pkgsite/internal/database.RegisterOCWrapper(driverName string, opts ...TraceOption) (string, error)
TraceOptions holds configuration of our ocsql tracing middleware. By default all options are set to false intentionally when creating a wrapped driver and provide the most sensible default with both performance and security in mind. AllowRoot, if set to true, will allow ocsql to create root spans in absence of existing spans or even context. Default is to not trace ocsql calls if no existing parent span is found in context or when using methods not taking context. DefaultAttributes will be set to each span as default. LastInsertID, if set to true, will enable the creation of spans on LastInsertId calls. Ping, if set to true, will enable the creation of spans on Ping requests. Query, if set to true, will enable recording of sql queries in spans. Only allow this if it is safe to have queries recorded with respect to security. QueryParams, if set to true, will enable recording of parameters used with parametrized queries. Only allow this if it is safe to have parameters recorded with respect to security. This setting is a noop if the Query option is set to false. RowsAffected, if set to true, will enable the creation of spans on RowsAffected calls. RowsClose, if set to true, will enable the creation of spans on RowsClose calls. RowsNext, if set to true, will enable the creation of spans on RowsNext calls. This can result in many spans. func WithOptions(options TraceOptions) TraceOption var AllTraceOptions
Package-Level Functions (total 26, in which 17 are exported)
RecordStats records database statistics for provided sql.DB at the provided interval.
Register initializes and registers our ocsql wrapped database driver identified by its driverName and using provided TraceOptions. On success it returns the generated driverName to use when calling sql.Open. It is possible to register multiple wrappers for the same database driver if needing different TraceOptions for different connections.
RegisterAllViews registers all ocsql views to enable collection of stats.
WithAllowRoot if set to true, will allow ocsql to create root spans in absence of exisiting spans or even context. Default is to not trace ocsql calls if no existing parent span is found in context or when using methods not taking context.
WithAllTraceOptions enables all available trace options.
WithDefaultAttributes will be set to each span as default.
WithLastInsertID if set to true, will enable the creation of spans on LastInsertId calls.
WithOptions sets our ocsql tracing middleware options through a single TraceOptions object.
WithPing if set to true, will enable the creation of spans on Ping requests.
WithQuery if set to true, will enable recording of sql queries in spans. Only allow this if it is safe to have queries recorded with respect to security.
WithQueryParams if set to true, will enable recording of parameters used with parametrized queries. Only allow this if it is safe to have parameters recorded with respect to security. This setting is a noop if the Query option is set to false.
WithRowsAffected if set to true, will enable the creation of spans on RowsAffected calls.
WithRowsClose if set to true, will enable the creation of spans on RowsClose calls.
WithRowsNext if set to true, will enable the creation of spans on RowsNext calls. This can result in many spans.
Wrap takes a SQL driver and wraps it with OpenCensus instrumentation.
WrapConn allows an existing driver.Conn to be wrapped by ocsql.
WrapConnector allows wrapping a database driver.Connector which eliminates the need to register ocsql as an available driver.Driver.
Package-Level Variables (total 29, in which 23 are exported)
AllTraceOptions has all tracing options enabled.
Default distributions used by views in this package
Package ocsql provides some convenience views. You still need to register these views for data to actually be collected. You can use the RegisterAllViews function for this.
GoSQLError is the error received while calling a SQL method.
GoSQLMethod is the SQL method called.
GoSQLStatus identifies success vs. error from the SQL method response.
The following measures are supported for use in custom views.
The following measures are supported for use in custom views.
The following measures are supported for use in custom views.
The following measures are supported for use in custom views.
The following measures are supported for use in custom views.
The following measures are supported for use in custom views.
The following measures are supported for use in custom views.
The following measures are supported for use in custom views.
Package ocsql provides some convenience views. You still need to register these views for data to actually be collected. You can use the RegisterAllViews function for this.
Package ocsql provides some convenience views. You still need to register these views for data to actually be collected. You can use the RegisterAllViews function for this.
Package ocsql provides some convenience views. You still need to register these views for data to actually be collected. You can use the RegisterAllViews function for this.
Package ocsql provides some convenience views. You still need to register these views for data to actually be collected. You can use the RegisterAllViews function for this.
Package ocsql provides some convenience views. You still need to register these views for data to actually be collected. You can use the RegisterAllViews function for this.
Package ocsql provides some convenience views. You still need to register these views for data to actually be collected. You can use the RegisterAllViews function for this.
Package ocsql provides some convenience views. You still need to register these views for data to actually be collected. You can use the RegisterAllViews function for this.
Package ocsql provides some convenience views. You still need to register these views for data to actually be collected. You can use the RegisterAllViews function for this.
Package ocsql provides some convenience views. You still need to register these views for data to actually be collected. You can use the RegisterAllViews function for this.