Path: blob/main/pkg/integrations/node_exporter/node_exporter_windows.go
5307 views
package node_exporter //nolint:golint12import (3"context"4"net/http"56"github.com/go-kit/log"7"github.com/go-kit/log/level"8"github.com/grafana/agent/pkg/integrations/config"9)1011// Integration is the node_exporter integration. On Windows platforms,12// this integration does nothing and will print a warning if enabled.13type Integration struct {14}1516// New creates a fake node_exporter integration.17func New(logger log.Logger, _ *Config) (*Integration, error) {18level.Warn(logger).Log("msg", "the node_exporter does not work on Windows; enabling it otherwise will do nothing")19return &Integration{}, nil20}2122// MetricsHandler satisfies Integration.RegisterRoutes.23func (i *Integration) MetricsHandler() (http.Handler, error) {24return http.NotFoundHandler(), nil25}2627// ScrapeConfigs satisfies Integration.ScrapeConfigs.28func (i *Integration) ScrapeConfigs() []config.ScrapeConfig {29// No-op: nothing to scrape.30return []config.ScrapeConfig{}31}3233// Run satisfies Integration.Run.34func (i *Integration) Run(ctx context.Context) error {35// We don't need to do anything here, so we can just wait for the context to36// finish.37<-ctx.Done()38return ctx.Err()39}404142