Documentation
¶
Overview ¶
Package metrics owns ghsync's OpenTelemetry meter provider and Prometheus exposition. Runtime packages expose narrow observer interfaces; the daemon registers their implementations here so instrumentation never creates an import cycle.
Index ¶
- Constants
- type Registrar
- type Registry
- type Runtime
- func (r *Runtime) BranchBulkApplied(ctx context.Context, repositories int, pullRequests int, stacks int, pages int, ...)
- func (r *Runtime) BranchReconciliationPage(ctx context.Context, outcome string, targets int, superseded int)
- func (r *Runtime) BudgetRequest(observation budget.RequestObservation)
- func (r *Runtime) BudgetStarvation(starvation budget.Starvation)
- func (r *Runtime) CacheWrite(ctx context.Context, kind string, accepted bool, tombstone bool)
- func (r *Runtime) DeriverPass(ctx context.Context, count int, duration time.Duration, err error)
- func (r *Runtime) DispatchBatch(ctx context.Context, count int)
- func (r *Runtime) Divergence(ctx context.Context, finding *dbgen.DriftFinding)
- func (r *Runtime) GapRedelivery(ctx context.Context, _ int64, _ string)
- func (r *Runtime) GapWindowIncomplete(ctx context.Context, _ string, _ int)
- func (r *Runtime) OutboxFence(ctx context.Context, observation outbox.FenceObservation)
- func (r *Runtime) PersistentDivergence(ctx context.Context, finding *dbgen.DriftFinding)
- func (r *Runtime) PrunerDelete(ctx context.Context, kind string, count int64)
- func (r *Runtime) RefreshDeadlineMissed(ctx context.Context, kind string, _ string, _ time.Time, _ time.Time)
- func (r *Runtime) RefreshFinished(ctx context.Context, observation *queue.RefreshObservation)
- func (r *Runtime) RegisterMetrics(meter metric.Meter) error
- func (r *Runtime) SweepOverrun(ctx context.Context, kind string, _ string, _ time.Duration)
- func (r *Runtime) WatermarkStep(ctx context.Context, advanced bool)
- type RuntimeOptions
Constants ¶
const Path = "/metrics"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Registrar ¶
Registrar lets a component register instruments against the process-local provider without importing the registry or another runtime package.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry is one isolated OTel provider backed by one Prometheus registry. Tests and role-separated processes can therefore coexist without global collector collisions.
func (*Registry) Provider ¶
func (r *Registry) Provider() metric.MeterProvider
Provider exposes the process-local provider to instrumentation libraries such as River's OpenTelemetry plugin. The provider remains registry-owned and must not be shut down by callers.
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
Runtime implements the engine's observer hooks and DB-backed asynchronous instruments. Every metric name includes the constraint it verifies (C-O4).
func NewRuntime ¶
func NewRuntime(options RuntimeOptions) (*Runtime, error)
func (*Runtime) BranchBulkApplied ¶ added in v0.5.0
func (*Runtime) BranchReconciliationPage ¶ added in v0.5.0
func (*Runtime) BudgetRequest ¶
func (r *Runtime) BudgetRequest(observation budget.RequestObservation)
func (*Runtime) BudgetStarvation ¶
func (r *Runtime) BudgetStarvation(starvation budget.Starvation)
func (*Runtime) CacheWrite ¶
func (*Runtime) DeriverPass ¶
func (*Runtime) Divergence ¶
func (r *Runtime) Divergence( ctx context.Context, finding *dbgen.DriftFinding, )
func (*Runtime) GapRedelivery ¶
func (*Runtime) GapWindowIncomplete ¶
func (*Runtime) OutboxFence ¶ added in v0.4.1
func (r *Runtime) OutboxFence( ctx context.Context, observation outbox.FenceObservation, )
OutboxFence records the C-S2 shared-writer and exclusive-watermarker phases independently so queueing cannot be mistaken for an oversized critical section.
func (*Runtime) PersistentDivergence ¶
func (r *Runtime) PersistentDivergence( ctx context.Context, finding *dbgen.DriftFinding, )
func (*Runtime) PrunerDelete ¶
func (*Runtime) RefreshDeadlineMissed ¶
func (*Runtime) RefreshFinished ¶
func (r *Runtime) RefreshFinished( ctx context.Context, observation *queue.RefreshObservation, )
func (*Runtime) SweepOverrun ¶
type RuntimeOptions ¶
type RuntimeOptions struct {
Pool *pgxpool.Pool
InstallationID int64
Roles []string
CollectDatabase bool
OpenStackStaleness time.Duration
OpenPRStaleness time.Duration
RepoRulesStaleness time.Duration
ClosedStaleness time.Duration
RepositoryPeriod time.Duration
StreamRetentionAge time.Duration
DeriverDirtyCap int
}