Documentation ¶
Overview ¶
Package metrics provides a set of metrics for the op-node.
Index ¶
- Constants
- type Metricer
- type Metrics
- func (m *Metrics) ClientPayloadByNumberEvent(num uint64, resultCode byte, duration time.Duration)
- func (m *Metrics) CountSequencedTxs(count int)
- func (m *Metrics) DecPeerCount()
- func (m *Metrics) DecStreamCount()
- func (m *Metrics) Document() []metrics.DocumentedMetric
- func (m *Metrics) IncPeerCount()
- func (m *Metrics) IncStreamCount()
- func (m *Metrics) PayloadsQuarantineSize(n int)
- func (m *Metrics) RecordAccept(allow bool)
- func (m *Metrics) RecordBandwidth(ctx context.Context, bwc *libp2pmetrics.BandwidthCounter)
- func (m *Metrics) RecordChannelInputBytes(inputCompressedBytes int)
- func (m *Metrics) RecordChannelTimedOut()
- func (m *Metrics) RecordDerivationError()
- func (m *Metrics) RecordDerivedBatches(batchType string)
- func (m *Metrics) RecordDial(allow bool)
- func (m *Metrics) RecordFrame()
- func (m *Metrics) RecordGossipEvent(evType int32)
- func (m *Metrics) RecordHeadChannelOpened()
- func (m *Metrics) RecordIPUnban()
- func (m *Metrics) RecordInfo(version string)
- func (m *Metrics) RecordL1ReorgDepth(d uint64)
- func (m *Metrics) RecordL1RequestTime(method string, duration time.Duration)
- func (m *Metrics) RecordPeerUnban()
- func (m *Metrics) RecordPipelineReset()
- func (m *Metrics) RecordPublishingError()
- func (m *Metrics) RecordReceivedUnsafePayload(payload *eth.ExecutionPayloadEnvelope)
- func (m *Metrics) RecordSequencerBuildingDiffTime(duration time.Duration)
- func (m *Metrics) RecordSequencerInconsistentL1Origin(from eth.BlockID, to eth.BlockID)
- func (m *Metrics) RecordSequencerReset()
- func (m *Metrics) RecordSequencerSealingTime(duration time.Duration)
- func (m *Metrics) RecordSequencingError()
- func (m *Metrics) RecordUnsafePayloadsBuffer(length uint64, memSize uint64, next eth.BlockID)
- func (m *Metrics) RecordUp()
- func (m *Metrics) ReportProtocolVersions(local, engine, recommended, required params.ProtocolVersion)
- func (m *Metrics) ServerPayloadByNumberEvent(num uint64, resultCode byte, duration time.Duration)
- func (m *Metrics) SetDerivationIdle(status bool)
- func (m *Metrics) SetPeerScores(allScores []store.PeerScores)
- func (m *Metrics) StartServer(hostname string, port int) (*ophttp.HTTPServer, error)
Constants ¶
const ( Namespace = "op_node" BatchMethod = "<batch>" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Metricer ¶
type Metricer interface { RecordInfo(version string) RecordUp() RecordRPCServerRequest(method string) func() RecordRPCClientRequest(method string) func(err error) RecordRPCClientResponse(method string, err error) SetDerivationIdle(status bool) RecordPipelineReset() RecordSequencingError() RecordPublishingError() RecordDerivationError() RecordReceivedUnsafePayload(payload *eth.ExecutionPayloadEnvelope) RecordRef(layer string, name string, num uint64, timestamp uint64, h common.Hash) RecordL1Ref(name string, ref eth.L1BlockRef) RecordL2Ref(name string, ref eth.L2BlockRef) RecordUnsafePayloadsBuffer(length uint64, memSize uint64, next eth.BlockID) RecordDerivedBatches(batchType string) CountSequencedTxs(count int) RecordL1ReorgDepth(d uint64) RecordSequencerInconsistentL1Origin(from eth.BlockID, to eth.BlockID) RecordSequencerReset() RecordGossipEvent(evType int32) IncPeerCount() DecPeerCount() IncStreamCount() DecStreamCount() RecordBandwidth(ctx context.Context, bwc *libp2pmetrics.BandwidthCounter) RecordSequencerBuildingDiffTime(duration time.Duration) RecordSequencerSealingTime(duration time.Duration) Document() []metrics.DocumentedMetric RecordChannelInputBytes(num int) RecordHeadChannelOpened() RecordChannelTimedOut() RecordFrame() // P2P Metrics SetPeerScores(allScores []store.PeerScores) ClientPayloadByNumberEvent(num uint64, resultCode byte, duration time.Duration) ServerPayloadByNumberEvent(num uint64, resultCode byte, duration time.Duration) PayloadsQuarantineSize(n int) RecordPeerUnban() RecordIPUnban() RecordDial(allow bool) RecordAccept(allow bool) ReportProtocolVersions(local, engine, recommended, required params.ProtocolVersion) }
type Metrics ¶
type Metrics struct { Info *prometheus.GaugeVec Up prometheus.Gauge metrics.RPCMetrics L1SourceCache *metrics.CacheMetrics L2SourceCache *metrics.CacheMetrics DerivationIdle prometheus.Gauge PipelineResets *metrics.Event UnsafePayloads *metrics.Event DerivationErrors *metrics.Event SequencingErrors *metrics.Event PublishingErrors *metrics.Event DerivedBatches metrics.EventVec P2PReqDurationSeconds *prometheus.HistogramVec P2PReqTotal *prometheus.CounterVec P2PPayloadByNumber *prometheus.GaugeVec PayloadsQuarantineTotal prometheus.Gauge SequencerInconsistentL1Origin *metrics.Event SequencerResets *metrics.Event L1RequestDurationSeconds *prometheus.HistogramVec SequencerBuildingDiffDurationSeconds prometheus.Histogram SequencerBuildingDiffTotal prometheus.Counter SequencerSealingDurationSeconds prometheus.Histogram SequencerSealingTotal prometheus.Counter UnsafePayloadsBufferLen prometheus.Gauge UnsafePayloadsBufferMemSize prometheus.Gauge metrics.RefMetrics L1ReorgDepth prometheus.Histogram TransactionsSequencedTotal prometheus.Counter // P2P Metrics PeerCount prometheus.Gauge StreamCount prometheus.Gauge GossipEventsTotal *prometheus.CounterVec BandwidthTotal *prometheus.GaugeVec PeerUnbans prometheus.Counter IPUnbans prometheus.Counter Dials *prometheus.CounterVec Accepts *prometheus.CounterVec PeerScores *prometheus.HistogramVec ChannelInputBytes prometheus.Counter // Protocol version reporting // Delta = params.ProtocolVersionComparison ProtocolVersionDelta *prometheus.GaugeVec // ProtocolVersions is pseudo-metric to report the exact protocol version info ProtocolVersions *prometheus.GaugeVec // contains filtered or unexported fields }
Metrics tracks all the metrics for the op-node.
func NewMetrics ¶
NewMetrics creates a new Metrics instance with the given process name.
func (*Metrics) ClientPayloadByNumberEvent ¶ added in v1.0.3
func (*Metrics) CountSequencedTxs ¶
func (*Metrics) DecPeerCount ¶
func (m *Metrics) DecPeerCount()
func (*Metrics) DecStreamCount ¶
func (m *Metrics) DecStreamCount()
func (*Metrics) Document ¶
func (m *Metrics) Document() []metrics.DocumentedMetric
func (*Metrics) IncPeerCount ¶
func (m *Metrics) IncPeerCount()
func (*Metrics) IncStreamCount ¶
func (m *Metrics) IncStreamCount()
func (*Metrics) PayloadsQuarantineSize ¶ added in v1.0.3
func (*Metrics) RecordAccept ¶ added in v1.1.2
func (*Metrics) RecordBandwidth ¶
func (m *Metrics) RecordBandwidth(ctx context.Context, bwc *libp2pmetrics.BandwidthCounter)
func (*Metrics) RecordChannelInputBytes ¶ added in v1.0.3
func (*Metrics) RecordChannelTimedOut ¶ added in v1.1.4
func (m *Metrics) RecordChannelTimedOut()
func (*Metrics) RecordDerivationError ¶
func (m *Metrics) RecordDerivationError()
func (*Metrics) RecordDerivedBatches ¶ added in v1.4.2
func (*Metrics) RecordDial ¶ added in v1.1.2
func (*Metrics) RecordFrame ¶ added in v1.1.4
func (m *Metrics) RecordFrame()
func (*Metrics) RecordGossipEvent ¶
func (*Metrics) RecordHeadChannelOpened ¶ added in v1.1.4
func (m *Metrics) RecordHeadChannelOpened()
func (*Metrics) RecordIPUnban ¶ added in v1.1.2
func (m *Metrics) RecordIPUnban()
func (*Metrics) RecordInfo ¶
RecordInfo sets a pseudo-metric that contains versioning and config info for the opnode.
func (*Metrics) RecordL1ReorgDepth ¶
func (*Metrics) RecordL1RequestTime ¶ added in v1.0.8
RecordL1RequestTime tracks the amount of time the derivation pipeline spent waiting for L1 data requests.
func (*Metrics) RecordPeerUnban ¶ added in v1.1.2
func (m *Metrics) RecordPeerUnban()
func (*Metrics) RecordPipelineReset ¶
func (m *Metrics) RecordPipelineReset()
func (*Metrics) RecordPublishingError ¶
func (m *Metrics) RecordPublishingError()
func (*Metrics) RecordReceivedUnsafePayload ¶
func (m *Metrics) RecordReceivedUnsafePayload(payload *eth.ExecutionPayloadEnvelope)
func (*Metrics) RecordSequencerBuildingDiffTime ¶
RecordSequencerBuildingDiffTime tracks the amount of time the sequencer was allowed between start to finish, incl. sealing, minus the block time. Ideally this is 0, realistically the sequencer scheduler may be busy with other jobs like syncing sometimes.
func (*Metrics) RecordSequencerInconsistentL1Origin ¶
func (*Metrics) RecordSequencerReset ¶
func (m *Metrics) RecordSequencerReset()
func (*Metrics) RecordSequencerSealingTime ¶
RecordSequencerSealingTime tracks the amount of time the sequencer took to finish sealing the block. Ideally this is 0, realistically it may take some time.
func (*Metrics) RecordSequencingError ¶
func (m *Metrics) RecordSequencingError()
func (*Metrics) RecordUnsafePayloadsBuffer ¶
func (*Metrics) ReportProtocolVersions ¶ added in v1.1.6
func (m *Metrics) ReportProtocolVersions(local, engine, recommended, required params.ProtocolVersion)
func (*Metrics) ServerPayloadByNumberEvent ¶ added in v1.0.3
func (*Metrics) SetDerivationIdle ¶
func (*Metrics) SetPeerScores ¶
func (m *Metrics) SetPeerScores(allScores []store.PeerScores)
SetPeerScores updates the peer score metrics. Accepts a slice of peer scores in any order.
func (*Metrics) StartServer ¶ added in v1.4.2
StartServer starts the metrics server on the given hostname and port.