Documentation
¶
Index ¶
- func Handler() http.Handler
- type Collector
- func (c *Collector) Middleware(serviceName string) func(http.Handler) http.Handler
- func (c *Collector) RecordCacheHit(serviceName, cacheName string)
- func (c *Collector) RecordCacheMiss(serviceName, cacheName string)
- func (c *Collector) RecordDBQuery(serviceName, queryType string, duration time.Duration)
- func (c *Collector) RecordLedgerEntry(serviceName, entryType, status string)
- func (c *Collector) RecordRiskEvent(serviceName, rule, action string)
- func (c *Collector) RecordTransaction(serviceName, txType, status string, amountPaise int64)
- func (c *Collector) RecordWalletOperation(serviceName, operation, status string)
- func (c *Collector) UpdateDBConnections(count int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Collector ¶
type Collector struct {
// HTTP Metrics
HTTPRequestsTotal *prometheus.CounterVec
HTTPRequestDuration *prometheus.HistogramVec
HTTPRequestSize *prometheus.HistogramVec
HTTPResponseSize *prometheus.HistogramVec
// Business Metrics
TransactionsTotal *prometheus.CounterVec
TransactionAmount *prometheus.HistogramVec
WalletOperationsTotal *prometheus.CounterVec
LedgerEntriesTotal *prometheus.CounterVec
RiskEventsTotal *prometheus.CounterVec
// System Metrics
DBConnectionsActive prometheus.Gauge
DBQueryDuration *prometheus.HistogramVec
CacheHitsTotal *prometheus.CounterVec
CacheMissesTotal *prometheus.CounterVec
}
Collector holds all Prometheus metrics for a service
func NewCollector ¶
NewCollector creates a new metrics collector for a service
func (*Collector) Middleware ¶
Middleware returns an HTTP middleware that instruments requests
func (*Collector) RecordCacheHit ¶
RecordCacheHit records a cache hit
func (*Collector) RecordCacheMiss ¶
RecordCacheMiss records a cache miss
func (*Collector) RecordDBQuery ¶
RecordDBQuery records a database query duration
func (*Collector) RecordLedgerEntry ¶
RecordLedgerEntry records a ledger entry metric
func (*Collector) RecordRiskEvent ¶
RecordRiskEvent records a risk event metric
func (*Collector) RecordTransaction ¶
RecordTransaction records a transaction metric
func (*Collector) RecordWalletOperation ¶
RecordWalletOperation records a wallet operation metric
func (*Collector) UpdateDBConnections ¶
UpdateDBConnections updates the active database connections gauge
Click to show internal directories.
Click to hide internal directories.