Documentation
¶
Index ¶
Constants ¶
View Source
const ( // DBMeterName is the name of the meter for DB metrics. Use the global DB // instance to access use these metrics. DBMeterName = "github.com/kwilteam/kwil-db/node/pg" // RPCMeterName is the name of the meter for RPC metrics. Use the global RPC // instance to access use these metrics. RPCMeterName = "github.com/kwilteam/kwil-db/node/services/jsonrpc" // currently the http server, but may be used in services like services/jsonrpc/usersvc NodeMeterName = "github.com/kwilteam/kwil-db/node" // node and node/peers EngineMeterName = "github.com/kwilteam/kwil-db/node/engine" // maybe split into engine/interpreter and engin/parse and engine/planner ConsensusMeterName = "github.com/kwilteam/kwil-db/node/consensus" BlockProcessorMeterName = "github.com/kwilteam/kwil-db/node/block_processor" MempoolMeterName = "github.com/kwilteam/kwil-db/node/mempool" BlockStoreMeterName = "github.com/kwilteam/kwil-db/node/store" AccountsMeterName = "github.com/kwilteam/kwil-db/node/accounts" )
Variables ¶
View Source
var ( RPC RPCMetrics = rpcMetrics{} DB DBMetrics = dbMetrics{} Consensus ConsensusMetrics = consensusMetrics{} Node NodeMetrics = nodeMetrics{} Store StoreMetrics = storeMetrics{} )
These are the global instances of the metrics grouped by the meter name. Until and unless Start is called, these are no-op meters.
Functions ¶
func StartOTEL ¶
StartOTEL bootstraps the OpenTelemetry pipeline. The collected metrics are exported to the specified OTLP (opentelemetry protocol) collector HTTP endpoint. The endpoint is in host port format, with no schema, as it uses unencrypted HTTP currently. If it does not return an error, make sure to call shutdown for proper cleanup.
Types ¶
type ConsensusMetrics ¶
type NodeMetrics ¶
type NodeMetrics interface {
PeerCount(ctx context.Context, numPeers int)
DownloadedBlock(ctx context.Context, blockHeight, size int64)
ServedBlock(ctx context.Context, blockHeight, size int64)
Advertised(ctx context.Context, protocol string)
AdvertiseRejected(ctx context.Context, protocol string)
AdvertiseServed(ctx context.Context, protocol string, contentLen int64)
TxnsReannounced(ctx context.Context, num, totalSize int64)
}
type OTELOption ¶
type OTELOption func(*otelOptions)
func WithOTELEndpoint ¶
func WithOTELEndpoint(endpoint string) OTELOption
func WithOTELInterval ¶
func WithOTELInterval(interval time.Duration) OTELOption
type RPCMetrics ¶
Click to show internal directories.
Click to hide internal directories.