Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove some unused code and updated docs for metrics #508

Merged
merged 2 commits into from
Jul 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading