Path: blob/main/pkg/integrations/windows_exporter/windows_exporter.go
5365 views
//go:build !windows12package windows_exporter //nolint:golint34import (5"context"6"net/http"78"github.com/go-kit/log"9"github.com/go-kit/log/level"10"github.com/grafana/agent/pkg/integrations/config"11)1213// Integration is the windows_exporter integration. On non-Windows platforms,14// this integration does nothing and will print a warning if enabled.15type Integration struct {16}1718// New creates a fake windows_exporter integration.19func New(logger log.Logger, _ *Config) (*Integration, error) {20level.Warn(logger).Log("msg", "the windows_exporter only works on Windows; enabling it otherwise will do nothing")21return &Integration{}, nil22}2324// MetricsHandler satisfies Integration.RegisterRoutes.25func (i *Integration) MetricsHandler() (http.Handler, error) {26return http.NotFoundHandler(), nil27}2829// ScrapeConfigs satisfies Integration.ScrapeConfigs.30func (i *Integration) ScrapeConfigs() []config.ScrapeConfig {31// No-op: nothing to scrape.32return []config.ScrapeConfig{}33}3435// Run satisfies Integration.Run.36func (i *Integration) Run(ctx context.Context) error {37// We don't need to do anything here, so we can just wait for the context to38// finish.39<-ctx.Done()40return ctx.Err()41}424344