Documentation
¶
Index ¶
- Variables
- type EventHub
- type EventPublisher
- type ProviderIdentityResolver
- type ProviderRegistry
- type Server
- func (s *Server) Run(ctx context.Context) error
- func (s *Server) RunDatabaseMetrics(ctx context.Context)
- func (s *Server) Serve(ctx context.Context, listener net.Listener) error
- func (s *Server) WithAuthConfig(cfg config.AdminAuthConfig) error
- func (s *Server) WithCommitPolicy(policy config.TaskWorkerConfig, legacyLimit uint64) *Server
- func (s *Server) WithEventHub(events *EventHub) *Server
- func (s *Server) WithFilecoinReadiness(probe filecoinReadinessProbe) *Server
- func (s *Server) WithMonitoring(monitor *observability.RuntimeMonitor, ...) *Server
- func (s *Server) WithObjectStorage(storage synapse.StorageClient) *Server
- func (s *Server) WithObjectUploader(uploader objectUploader) *Server
- func (s *Server) WithObjectVersionRestorer(restorer objectVersionRestorer) *Server
- func (s *Server) WithObservability(service *observability.Service) *Server
- func (s *Server) WithProviderIdentityResolver(resolver providerIdentityLookup) *Server
- func (s *Server) WithProviderReplacement(selector providerReplacementSelector) *Server
- func (s *Server) WithProviderTier(tier providerselect.Tier) *Server
- func (s *Server) WithS3IAM(iam auth.IAMService, rootAccess string) *Server
- func (s *Server) WithSettings(settings *SettingsService) *Server
- func (s *Server) WithTaskMessages(replacement, copyRetry *taskengine.Messenger) *Server
- func (s *Server) WithTaskService(service *taskengine.Service) *Server
- func (s *Server) WithTrustedProxies(values []string) error
- func (s *Server) WithUploadSpeedTest(cfg config.FilecoinUploadSpeedTestConfig) *Server
- func (s *Server) WithWarmStorageMarket(market WarmStorageMarket, chainID uint64, usdfcAddress string) *Server
- type SettingsService
- func (s *SettingsService) FilecoinDraftConfig(req *settingsFilecoinUpdate) (*config.Config, []config.FieldError)
- func (s *SettingsService) Snapshot(writable bool) settingsResponse
- func (s *SettingsService) Update(req settingsUpdateRequest, writable bool) (settingsResponse, []config.FieldError, error)
- func (s *SettingsService) Validate(req settingsUpdateRequest) ([]config.FieldError, error)
- type StorageProviderSelector
- type WarmStorageMarket
- type WorkerHealthChecker
Constants ¶
This section is empty.
Variables ¶
var ( DatabaseMetricsCollectionSuccess = promauto.NewGauge(prometheus.GaugeOpts{ Namespace: "synaps3", Subsystem: "database_metrics", Name: "collection_success", Help: "Whether the most recent database metrics collection succeeded", }) DatabaseMetricsLastSuccess = promauto.NewGauge(prometheus.GaugeOpts{ Namespace: "synaps3", Subsystem: "database_metrics", Name: "last_success_timestamp_seconds", Help: "Unix timestamp of the last successful database metrics collection", }) // ObjectOperationsTotal counts S3 object operations by type and status. ObjectOperationsTotal = promauto.NewCounterVec(prometheus.CounterOpts{ Namespace: "synaps3", Subsystem: "backend", Name: "object_operations_total", Help: "Total S3 object operations by type and status", }, []string{"operation", "status"}) // CacheUsedBytes tracks current cache usage in bytes. CacheUsedBytes = promauto.NewGauge(prometheus.GaugeOpts{ Namespace: "synaps3", Subsystem: "cache", Name: "used_bytes", Help: "Current cache usage in bytes", }) // CacheHitsTotal counts cache hits (object found locally). CacheHitsTotal = promauto.NewCounter(prometheus.CounterOpts{ Namespace: "synaps3", Subsystem: "cache", Name: "hits_total", Help: "Total cache hits (object found locally)", }) // CacheMissesTotal counts cache misses (object not found locally). CacheMissesTotal = promauto.NewCounter(prometheus.CounterOpts{ Namespace: "synaps3", Subsystem: "cache", Name: "misses_total", Help: "Total cache misses (object not found locally)", }) // CacheLRUEvictionPaused reports whether LRU eviction is paused because // recent cache access could not be retained safely. CacheLRUEvictionPaused = promauto.NewGauge(prometheus.GaugeOpts{ Namespace: "synaps3", Subsystem: "cache", Name: "lru_eviction_paused", Help: "Whether LRU cache eviction is paused because recent cache access could not be retained safely", }) // TaskQueueDepth tracks active task count by type and status. TaskQueueDepth = promauto.NewGaugeVec(prometheus.GaugeOpts{ Namespace: "synaps3", Subsystem: "task", Name: "queue_depth", Help: "Number of tasks by type and status", }, []string{"type", "status"}) // ObjectStateDistribution tracks object count by state. ObjectStateDistribution = promauto.NewGaugeVec(prometheus.GaugeOpts{ Namespace: "synaps3", Subsystem: "object", Name: "state_distribution", Help: "Number of objects by state", }, []string{"state"}) )
Functions ¶
This section is empty.
Types ¶
type EventHub ¶
type EventHub struct {
// contains filtered or unexported fields
}
func NewEventHub ¶
func NewEventHub() *EventHub
type EventPublisher ¶
type ProviderIdentityResolver ¶
type ProviderIdentityResolver struct {
// contains filtered or unexported fields
}
ProviderIdentityResolver caches only Filecoin fields derived from a saved service provider address.
func NewProviderIdentityResolver ¶
func NewProviderIdentityResolver(rpcURL string, logger *slog.Logger) *ProviderIdentityResolver
func (*ProviderIdentityResolver) EnrichActors ¶
func (r *ProviderIdentityResolver) EnrichActors(identities map[string]*providerIdentityResponse) map[string]*providerIdentityResponse
func (*ProviderIdentityResolver) Run ¶
func (r *ProviderIdentityResolver) Run(ctx context.Context)
func (*ProviderIdentityResolver) SetProviderIdentityPublisher ¶
func (r *ProviderIdentityResolver) SetProviderIdentityPublisher(publish func(string))
type ProviderRegistry ¶
type ProviderRegistry interface {
ListProviderObservations(ctx context.Context, opts observability.ListOptions) (observability.ProviderObservationPage, error)
}
ProviderRegistry lists the storage providers a replacement can move to. It is an interface so provider selection stays testable without live observability.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server provides /healthz and /metrics endpoints on a separate port.
func New ¶
func New( addr string, db *bun.DB, c cache.Cache, cacheGate *cacheaccess.Gate, cacheAccessTracker *cacheaccess.Tracker, cacheMaxBytes int64, repos *repository.Repositories, wh WorkerHealthChecker, wallet synapse.WalletQuerier, filecoinDefaultCopies int, logger *slog.Logger, ) *Server
New creates a new admin HTTP server.
func NewSetup ¶
func NewSetup(addr string, settings *SettingsService, logger *slog.Logger) *Server
NewSetup creates an admin HTTP server for first-run/setup mode.
func (*Server) RunDatabaseMetrics ¶
RunDatabaseMetrics samples read-only database statistics until cancellation.
func (*Server) Serve ¶
Serve serves the admin API on listener until ctx is cancelled. The listener is owned by Serve and closed during shutdown.
func (*Server) WithAuthConfig ¶
func (s *Server) WithAuthConfig(cfg config.AdminAuthConfig) error
func (*Server) WithCommitPolicy ¶
func (s *Server) WithCommitPolicy(policy config.TaskWorkerConfig, legacyLimit uint64) *Server
func (*Server) WithEventHub ¶
func (*Server) WithFilecoinReadiness ¶
WithFilecoinReadiness enables Filecoin readiness API routes.
func (*Server) WithMonitoring ¶
func (s *Server) WithMonitoring(monitor *observability.RuntimeMonitor, counters *observability.TransferCounters) *Server
WithMonitoring connects the runtime's resource history and transfer counters.
func (*Server) WithObjectStorage ¶
func (s *Server) WithObjectStorage(storage synapse.StorageClient) *Server
WithObjectStorage enables provider-backed object reads for admin downloads.
func (*Server) WithObjectUploader ¶
WithObjectUploader enables admin object uploads through the existing object write path.
func (*Server) WithObjectVersionRestorer ¶
WithObjectVersionRestorer enables admin object version restore operations.
func (*Server) WithObservability ¶
func (s *Server) WithObservability(service *observability.Service) *Server
func (*Server) WithProviderIdentityResolver ¶
WithProviderIdentityResolver enables provider identity enrichment for admin APIs.
func (*Server) WithProviderReplacement ¶
WithProviderReplacement enables the provider replacement endpoints. Without it they report that Filecoin storage is unavailable.
func (*Server) WithProviderTier ¶
func (s *Server) WithProviderTier(tier providerselect.Tier) *Server
func (*Server) WithS3IAM ¶
func (s *Server) WithS3IAM(iam auth.IAMService, rootAccess string) *Server
WithS3IAM enables S3 user management API routes.
func (*Server) WithSettings ¶
func (s *Server) WithSettings(settings *SettingsService) *Server
WithSettings enables settings API routes on a full admin server.
func (*Server) WithTaskMessages ¶
func (s *Server) WithTaskMessages(replacement, copyRetry *taskengine.Messenger) *Server
func (*Server) WithTaskService ¶
func (s *Server) WithTaskService(service *taskengine.Service) *Server
func (*Server) WithTrustedProxies ¶
func (*Server) WithUploadSpeedTest ¶
func (s *Server) WithUploadSpeedTest(cfg config.FilecoinUploadSpeedTestConfig) *Server
WithUploadSpeedTest supplies the running provider test policy.
func (*Server) WithWarmStorageMarket ¶
func (s *Server) WithWarmStorageMarket(market WarmStorageMarket, chainID uint64, usdfcAddress string) *Server
type SettingsService ¶
type SettingsService struct {
// contains filtered or unexported fields
}
func NewSettingsService ¶
func (*SettingsService) FilecoinDraftConfig ¶
func (s *SettingsService) FilecoinDraftConfig(req *settingsFilecoinUpdate) (*config.Config, []config.FieldError)
func (*SettingsService) Snapshot ¶
func (s *SettingsService) Snapshot(writable bool) settingsResponse
func (*SettingsService) Update ¶
func (s *SettingsService) Update(req settingsUpdateRequest, writable bool) (settingsResponse, []config.FieldError, error)
func (*SettingsService) Validate ¶
func (s *SettingsService) Validate(req settingsUpdateRequest) ([]config.FieldError, error)
type StorageProviderSelector ¶
type StorageProviderSelector struct {
// contains filtered or unexported fields
}
StorageProviderSelector reports which storage providers a replacement can use. It resolves candidates only; the paid service itself is created later by the worker, after the operator has confirmed.
func NewStorageProviderSelector ¶
func NewStorageProviderSelector(providers ProviderRegistry) *StorageProviderSelector
NewStorageProviderSelector builds the provider inventory used by replacement.
func (*StorageProviderSelector) ListReplacementProviderObservations ¶
func (s *StorageProviderSelector) ListReplacementProviderObservations(ctx context.Context, providerID *idtypes.OnChainID) ([]observability.ProviderObservation, error)
ListReplacementProviderObservations reads the same observed inventory shown by storage topology; eligibility is decided by the caller.
type WarmStorageMarket ¶
type WorkerHealthChecker ¶
WorkerHealthChecker provides worker liveness info. Implemented by worker.Manager.
Source Files
¶
- api_bucket_storage_health.go
- api_buckets.go
- api_commit_batches.go
- api_copy_health.go
- api_copy_retry.go
- api_filecoin_readiness.go
- api_monitoring.go
- api_object_upload.go
- api_object_version_restore.go
- api_observability.go
- api_overview.go
- api_provider_tiers.go
- api_replacement.go
- api_s3_users.go
- api_settings.go
- api_storage_confirmations.go
- api_system.go
- api_task_provider_identity.go
- api_task_subjects.go
- api_tasks.go
- api_upload_speed_setup.go
- api_wallet.go
- auth.go
- events.go
- metrics.go
- provider_identity.go
- provider_market.go
- replacement_candidates.go
- replacement_selector.go
- server.go
- spa.go
- wallet_cache.go