Documentation
¶
Index ¶
- type MetricsFanIn
- type MetricsService
- type NonCloseableL1BeaconClient
- type NonCloseableL1Client
- type NonCloseableRPC
- func (c *NonCloseableRPC) BatchCallContext(ctx context.Context, b []rpc.BatchElem) error
- func (c *NonCloseableRPC) CallContext(ctx context.Context, result any, method string, args ...any) error
- func (c *NonCloseableRPC) Close()
- func (c *NonCloseableRPC) Subscribe(ctx context.Context, namespace string, channel any, args ...any) (ethereum.Subscription, error)
- type Router
- type RouterConfig
- type SupernodeMetrics
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MetricsFanIn ¶
type MetricsFanIn struct {
// contains filtered or unexported fields
}
MetricsFanIn is an http.handler which allows multiple Prometheus metrics "Gatherers" to be combined and served at the /metrics path.
The Gatherers must not collide with each other, e.g. each must have a unique name or label set. This can be accomplished by using a distinct, global label on each Gatherer.
func NewMetricsFanIn ¶
func NewMetricsFanIn(numGatherers int) *MetricsFanIn
func (*MetricsFanIn) AddGatherer ¶ added in v1.17.0
func (r *MetricsFanIn) AddGatherer(g prometheus.Gatherer)
AddGatherer registers an additional prometheus.Gatherer (e.g. SupernodeMetrics) to be served alongside per-chain metrics. Nil gatherers are ignored.
func (*MetricsFanIn) ServeHTTP ¶
func (r *MetricsFanIn) ServeHTTP(w http.ResponseWriter, req *http.Request)
func (*MetricsFanIn) SetMetricsRegistry ¶
func (r *MetricsFanIn) SetMetricsRegistry(key string, g prometheus.Gatherer)
type MetricsService ¶
type MetricsService struct {
// contains filtered or unexported fields
}
MetricsService encapsulates an HTTP server that serves the MetricsRouter.
func NewMetricsService ¶
func NewMetricsService(log gethlog.Logger, listenAddr string, port int, handler http.Handler) *MetricsService
NewMetricsService constructs a metrics HTTP server bound to the given address/port using the provided handler.
func (*MetricsService) Start ¶
func (s *MetricsService) Start(onDone func(), onError func(error))
Start begins serving metrics in a background goroutine. If the server exits with an error, the optional onError callback is invoked.
type NonCloseableL1BeaconClient ¶
type NonCloseableL1BeaconClient struct {
*sources.L1BeaconClient
}
NonCloseableL1BeaconClient wraps an L1BeaconClient to prevent it from being closed. This is used when sharing a single beacon client across multiple virtual nodes.
func NewNonCloseableL1BeaconClient ¶
func NewNonCloseableL1BeaconClient(client *sources.L1BeaconClient) *NonCloseableL1BeaconClient
NewNonCloseableL1BeaconClient wraps an L1BeaconClient to prevent closure. Returns nil if the input client is nil (beacon client is optional).
func (*NonCloseableL1BeaconClient) Close ¶
func (c *NonCloseableL1BeaconClient) Close()
type NonCloseableL1Client ¶
NonCloseableL1Client wraps an L1Client to prevent it from being closed. This is used when sharing a single L1Client across multiple virtual nodes, where we don't want any individual node to close the shared resource.
func NewNonCloseableL1Client ¶
func NewNonCloseableL1Client(client *sources.L1Client) *NonCloseableL1Client
NewNonCloseableL1Client wraps an L1Client to prevent closure.
func (*NonCloseableL1Client) Close ¶
func (c *NonCloseableL1Client) Close()
Close is a no-op for the non-closeable wrapper. The underlying client should only be closed when the supernode itself shuts down.
type NonCloseableRPC ¶
NonCloseableRPC wraps an RPC client to prevent it from being closed. This is used when sharing a single RPC connection across multiple clients.
func NewNonCloseableRPC ¶
func NewNonCloseableRPC(rpcClient client.RPC) *NonCloseableRPC
NewNonCloseableRPC wraps an RPC client to prevent closure.
func (*NonCloseableRPC) BatchCallContext ¶
BatchCallContext delegates to the underlying RPC client
func (*NonCloseableRPC) CallContext ¶
func (c *NonCloseableRPC) CallContext(ctx context.Context, result any, method string, args ...any) error
CallContext delegates to the underlying RPC client
func (*NonCloseableRPC) Close ¶
func (c *NonCloseableRPC) Close()
Close is a no-op for the non-closeable wrapper.
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Router multiplexes JSON-RPC requests by the first path segment which represents the chainID.
func NewRouter ¶
func NewRouter(log gethlog.Logger, cfg RouterConfig) *Router
NewRouter constructs an empty Router. Handlers can be added later via SetHandler.
func (*Router) ServeHTTP ¶
func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request)
ServeHTTP routes requests to the chain-specific handler, after stripping the chain prefix.
func (*Router) SetHandler ¶
SetHandler replaces or adds the handler for a given chainID at runtime.
func (*Router) SetRootHandler ¶
SetRootHandler sets the optional handler for '/'. If unset, '/' returns 404.
type RouterConfig ¶
RouterConfig defines runtime options for the RPC router server.
type SupernodeMetrics ¶ added in v1.17.0
type SupernodeMetrics struct {
VNRestarts *prometheus.CounterVec
InteropTimestampsVerified prometheus.Counter
InteropInvalidations *prometheus.CounterVec
InteropVerifiedTimestamp prometheus.Gauge
InteropRoundDecisions *prometheus.CounterVec
InteropRewinds prometheus.Counter
InteropVerificationDuration prometheus.Histogram
ChainRewindDepthBlocks *prometheus.HistogramVec
DenyListEntries *prometheus.CounterVec
LogBackfillProgress *prometheus.GaugeVec
LogBackfillRetries *prometheus.CounterVec
ActivityErrors *prometheus.CounterVec
// contains filtered or unexported fields
}
SupernodeMetrics holds supernode-level metrics that outlive individual virtual node restarts. Created once in supernode.New() and shared with chain containers and activities. Callers that receive nil default to NewSupernodeMetrics(), which creates functional counters not attached to any scraped registry (safe for tests).
func NewSupernodeMetrics ¶ added in v1.17.0
func NewSupernodeMetrics() *SupernodeMetrics
NewSupernodeMetrics creates a new SupernodeMetrics backed by a dedicated registry.
func (*SupernodeMetrics) Registry ¶ added in v1.17.0
func (m *SupernodeMetrics) Registry() prometheus.Gatherer
Registry returns the prometheus gatherer for these metrics.