tel

package
v1.13.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 10, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package tel provides telemetry data on the connector's internal operations. The initial version is based on OpenCensus.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitMetrics

func InitMetrics() error

InitMetrics registers all views once. Without registering views, metrics will not be reported. If any names of the registered views conflict, this function returns an error to indicate an internal configuration problem.

func RecordBytesReceived

func RecordBytesReceived(ctx context.Context, num int64, instance, dialerID string)

RecordBytesReceived reports the number of bytes received from an AlloyDB instance.

func RecordBytesSent

func RecordBytesSent(ctx context.Context, num int64, instance, dialerID string)

RecordBytesSent reports the number of bytes sent to an AlloyDB instance.

func RecordDialError

func RecordDialError(ctx context.Context, instance, dialerID string, err error)

RecordDialError reports a failed dial attempt. If err is nil, RecordDialError is a no-op.

func RecordDialLatency

func RecordDialLatency(ctx context.Context, instance, dialerID string, latency int64)

RecordDialLatency records a latency value for a call to dial.

func RecordOpenConnections

func RecordOpenConnections(ctx context.Context, num int64, dialerID, instance string)

RecordOpenConnections records the number of open connections

func RecordRefreshResult

func RecordRefreshResult(ctx context.Context, instance, dialerID string, err error)

RecordRefreshResult reports the result of a refresh operation, either successful or failed.

Types

type Attribute

type Attribute struct {
	// contains filtered or unexported fields
}

Attribute annotates a span with additional data.

func AddDialerID

func AddDialerID(dialerID string) Attribute

AddDialerID creates an attribute to identify a particular dialer.

func AddInstanceName

func AddInstanceName(name string) Attribute

AddInstanceName creates an attribute with the AlloyDB instance name.

type EndSpanFunc

type EndSpanFunc func(error)

EndSpanFunc is a function that ends a span, reporting an error if necessary.

func StartSpan

func StartSpan(ctx context.Context, name string, attrs ...Attribute) (context.Context, EndSpanFunc)

StartSpan begins a span with the provided name and returns a context and a function to end the created span.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL