Skip to content

Commit

Permalink
Merge pull request #508 from sctb512/remove-unused-code
Browse files Browse the repository at this point in the history
Remove some unused code and updated docs for metrics
  • Loading branch information
changweige authored Jul 14, 2023
2 parents e02116c + e35a800 commit 7f7c998
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
5 changes: 4 additions & 1 deletion docs/configure_nydus.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ The Nydus snapshotter will get the new secret and parse the authorization. If yo

## Metrics

Nydusd records metrics in its own format. The metrics are exported via a HTTP server on top of unix domain socket. Nydus-snapshotter fetches the metrics and convert them in to Prometheus format which is exported via a network address. Nydus-snapshotter by default does not fetch metrics from nydusd. You can enable the nydusd metrics download by assigning an network address to `metrics.address` in nydus-snapshotter's toml [configuration file](../misc/snapshotter/config.toml).
Nydusd records metrics in its own format. The metrics are exported via a HTTP server on top of unix domain socket. Nydus-snapshotter fetches the metrics and convert them in to Prometheus format which is exported via a network address. Nydus-snapshotter by default does not fetch metrics from nydusd. You can enable the nydusd metrics download by assigning a network address to `metrics.address` in nydus-snapshotter's toml [configuration file](../misc/snapshotter/config.toml).

Once this entry is enabled, not only nydusd metrics, but also some information about the nydus-snapshotter
runtime and snapshot related events are exported in Prometheus format as well.

## Diagnose

Expand Down
8 changes: 0 additions & 8 deletions pkg/metrics/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,12 @@ const defaultHungIOInterval = 10 * time.Second
type ServerOpt func(*Server) error

type Server struct {
rootDir string
managers []*manager.Manager
snCollectors []*collector.SnapshotterMetricsCollector
fsCollector *collector.FsMetricsVecCollector
inflightCollector *collector.InflightMetricsVecCollector
}

func WithRootDir(rootDir string) ServerOpt {
return func(s *Server) error {
s.rootDir = rootDir
return nil
}
}

func WithProcessManager(pm *manager.Manager) ServerOpt {
return func(s *Server) error {
s.managers = append(s.managers, pm)
Expand Down
1 change: 0 additions & 1 deletion snapshot/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ func NewSnapshotter(ctx context.Context, cfg *config.SnapshotterConfig) (snapsho

metricServer, err := metrics.NewServer(
ctx,
metrics.WithRootDir(cfg.Root),
metrics.WithProcessManager(manager),
)
if err != nil {
Expand Down

0 comments on commit 7f7c998

Please sign in to comment.