Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pkg/clickhouse/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,7 @@ func (c *Client) collectPoolMetrics() {
stat := c.pool.Stat()

// Set gauge values (current state)
common.ClickHouseConnectionsActive.WithLabelValues(network, c.processor).Set(float64(stat.AcquiredResources()))
common.ClickHousePoolAcquiredResources.WithLabelValues(network, c.processor).Set(float64(stat.AcquiredResources()))
common.ClickHousePoolIdleResources.WithLabelValues(network, c.processor).Set(float64(stat.IdleResources()))
common.ClickHousePoolConstructingResources.WithLabelValues(network, c.processor).Set(float64(stat.ConstructingResources()))
Expand Down
1 change: 0 additions & 1 deletion pkg/processor/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,6 @@ func (m *Manager) processBlocks(ctx context.Context) bool {
duration := time.Since(startTime)

common.BlockProcessingDuration.WithLabelValues(m.network.Name, name).Observe(duration.Seconds())
common.BlocksProcessed.WithLabelValues(m.network.Name, name).Inc()

m.log.WithFields(logrus.Fields{
"processor": name,
Expand Down
2 changes: 2 additions & 0 deletions pkg/processor/transaction/simple/block_processing.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,8 @@ func (p *Processor) ProcessBlock(ctx context.Context, block execution.Block) err
common.TasksEnqueued.WithLabelValues(p.network.Name, ProcessorName, queue, task.Type()).Inc()
}

common.BlocksProcessed.WithLabelValues(p.network.Name, ProcessorName).Inc()

p.log.WithFields(logrus.Fields{
"block_number": blockNumber.Uint64(),
"tx_count": len(block.Transactions()),
Expand Down
2 changes: 2 additions & 0 deletions pkg/processor/transaction/structlog/block_processing.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,8 @@
}).Warn("task count mismatch - some tasks may have failed to enqueue")
}

common.BlocksProcessed.WithLabelValues(p.network.Name, ProcessorName).Inc()

p.log.WithFields(logrus.Fields{
"network": p.network.Name,
"block_number": blockNumber,
Expand All @@ -287,7 +289,7 @@
payload := &ProcessPayload{
BlockNumber: *block.Number(),
TransactionHash: tx.Hash().String(),
TransactionIndex: uint32(index), //nolint:gosec // index is bounded by block.Transactions() length

Check failure on line 292 in pkg/processor/transaction/structlog/block_processing.go

View workflow job for this annotation

GitHub Actions / lint

directive `//nolint:gosec // index is bounded by block.Transactions() length` is unused for linter "gosec" (nolintlint)
NetworkName: p.network.Name,
Network: p.network.Name,
}
Expand Down Expand Up @@ -459,7 +461,7 @@
payload := &ProcessPayload{
BlockNumber: *block.Number(),
TransactionHash: tx.Hash().String(),
TransactionIndex: uint32(index), //nolint:gosec // index is bounded by block.Transactions() length

Check failure on line 464 in pkg/processor/transaction/structlog/block_processing.go

View workflow job for this annotation

GitHub Actions / lint

directive `//nolint:gosec // index is bounded by block.Transactions() length` is unused for linter "gosec" (nolintlint)
NetworkName: p.network.Name,
Network: p.network.Name,
}
Expand Down
2 changes: 2 additions & 0 deletions pkg/processor/transaction/structlog_agg/block_processing.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,8 @@ func (p *Processor) ProcessBlock(ctx context.Context, block execution.Block) err
}).Warn("task count mismatch - some tasks may have failed to enqueue")
}

common.BlocksProcessed.WithLabelValues(p.network.Name, ProcessorName).Inc()

p.log.WithFields(logrus.Fields{
"network": p.network.Name,
"block_number": blockNumber,
Expand Down
8 changes: 8 additions & 0 deletions pkg/rowbuffer/buffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,14 @@ func (b *Buffer[R]) doFlush(ctx context.Context, rows []R, waiters []waiter, tri
b.config.Network, b.config.Processor, b.config.Table, trigger, status,
).Inc()

common.ClickHouseOperationDuration.WithLabelValues(
b.config.Network, b.config.Processor, "insert", b.config.Table, status, "",
).Observe(duration.Seconds())

common.ClickHouseOperationTotal.WithLabelValues(
b.config.Network, b.config.Processor, "insert", b.config.Table, status, "",
).Inc()

common.RowBufferFlushDuration.WithLabelValues(
b.config.Network, b.config.Processor, b.config.Table,
).Observe(duration.Seconds())
Expand Down
Loading