Skip to content

Commit

Permalink
Merge pull request stellar#5102 from sreuland/ingestion-next
Browse files Browse the repository at this point in the history
merge latest master back to ingestion-next
  • Loading branch information
sreuland authored Nov 1, 2023
2 parents 4af6d44 + 54e0f52 commit 0d42a41
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
matrix:
os: [ubuntu-22.04]
go: ["1.19", "1.20"]
pg: [10]
pg: [12]
runs-on: ${{ matrix.os }}
services:
postgres:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/horizon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
go: ["1.20", "1.21"]
pg: [10]
ingestion-backend: [db, captive-core, captive-core-remote-storage]
pg: [12]
ingestion-backend: [captive-core, captive-core-remote-storage]
protocol-version: [19, 20]
runs-on: ${{ matrix.os }}
services:
Expand Down
3 changes: 2 additions & 1 deletion ingest/ledgerbackend/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ func WithMetrics(base LedgerBackend, registry *prometheus.Registry, namespace st
summary := prometheus.NewSummary(
prometheus.SummaryOpts{
Namespace: namespace, Subsystem: "ingest", Name: "ledger_fetch_duration_seconds",
Help: "duration of fetching ledgers from ledger backend, sliding window = 10m",
Help: "duration of fetching ledgers from ledger backend, sliding window = 10m",
Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001},
},
)
registry.MustRegister(summary)
Expand Down
3 changes: 2 additions & 1 deletion services/horizon/internal/httpx/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ func NewServer(serverConfig ServerConfig, routerConfig RouterConfig, ledgerState
RequestDurationSummary: prometheus.NewSummaryVec(
prometheus.SummaryOpts{
Namespace: "horizon", Subsystem: "http", Name: "requests_duration_seconds",
Help: "HTTP requests durations, sliding window = 10m",
Help: "HTTP requests durations, sliding window = 10m",
Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001},
},
[]string{"status", "route", "streaming", "method"},
),
Expand Down
15 changes: 10 additions & 5 deletions services/horizon/internal/ingest/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,22 +337,26 @@ func (s *system) initMetrics() {

s.metrics.LedgerIngestionDuration = prometheus.NewSummary(prometheus.SummaryOpts{
Namespace: "horizon", Subsystem: "ingest", Name: "ledger_ingestion_duration_seconds",
Help: "ledger ingestion durations, sliding window = 10m",
Help: "ledger ingestion durations, sliding window = 10m",
Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001},
})

s.metrics.LedgerIngestionTradeAggregationDuration = prometheus.NewSummary(prometheus.SummaryOpts{
Namespace: "horizon", Subsystem: "ingest", Name: "ledger_ingestion_trade_aggregation_duration_seconds",
Help: "ledger ingestion trade aggregation rebuild durations, sliding window = 10m",
Help: "ledger ingestion trade aggregation rebuild durations, sliding window = 10m",
Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001},
})

s.metrics.LedgerIngestionReapLookupTablesDuration = prometheus.NewSummary(prometheus.SummaryOpts{
Namespace: "horizon", Subsystem: "ingest", Name: "ledger_ingestion_reap_lookup_tables_duration_seconds",
Help: "ledger ingestion reap lookup tables durations, sliding window = 10m",
Help: "ledger ingestion reap lookup tables durations, sliding window = 10m",
Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001},
})

s.metrics.StateVerifyDuration = prometheus.NewSummary(prometheus.SummaryOpts{
Namespace: "horizon", Subsystem: "ingest", Name: "state_verify_duration_seconds",
Help: "state verification durations, sliding window = 10m",
Help: "state verification durations, sliding window = 10m",
Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001},
})

s.metrics.StateInvalidGauge = prometheus.NewGaugeFunc(
Expand Down Expand Up @@ -401,7 +405,8 @@ func (s *system) initMetrics() {
s.metrics.ProcessorsRunDurationSummary = prometheus.NewSummaryVec(
prometheus.SummaryOpts{
Namespace: "horizon", Subsystem: "ingest", Name: "processor_run_duration_seconds",
Help: "run durations of ingestion processors, sliding window = 10m",
Help: "run durations of ingestion processors, sliding window = 10m",
Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001},
},
[]string{"name"},
)
Expand Down
3 changes: 2 additions & 1 deletion services/horizon/internal/txsub/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,8 @@ func (sys *System) Init() {

sys.Metrics.SubmissionDuration = prometheus.NewSummary(prometheus.SummaryOpts{
Namespace: "horizon", Subsystem: "txsub", Name: "submission_duration_seconds",
Help: "submission durations to Stellar-Core, sliding window = 10m",
Help: "submission durations to Stellar-Core, sliding window = 10m",
Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001},
})
sys.Metrics.FailedSubmissionsCounter = prometheus.NewCounter(prometheus.CounterOpts{
Namespace: "horizon", Subsystem: "txsub", Name: "failed",
Expand Down
2 changes: 2 additions & 0 deletions support/db/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ func RegisterMetrics(base *Session, namespace string, sub Subservice, registry *
Namespace: namespace, Subsystem: "db",
Name: "query_duration_seconds",
ConstLabels: prometheus.Labels{"subservice": string(sub)},
Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001},
},
[]string{"query_type", "error", "route"},
)
Expand Down Expand Up @@ -232,6 +233,7 @@ func RegisterMetrics(base *Session, namespace string, sub Subservice, registry *
Name: "round_trip_time_seconds",
Help: "time required to run `select 1` query in a DB - effectively measures round trip time, if time exceeds 1s it will be recorded as 1",
ConstLabels: prometheus.Labels{"subservice": string(sub)},
Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001},
},
)
registry.MustRegister(s.roundTripTimeSummary)
Expand Down

0 comments on commit 0d42a41

Please sign in to comment.