Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
aos
GitHub Repository: aos/grafana-agent
Path: blob/main/pkg/integrations/stub_integration.go
5327 views
1
package integrations
2
3
import (
4
"context"
5
"net/http"
6
7
"github.com/grafana/agent/pkg/integrations/config"
8
)
9
10
// StubIntegration implements a no-op integration for use on platforms not supported by an integration
11
type StubIntegration struct{}
12
13
// MetricsHandler returns an http.NotFoundHandler to satisfy the Integration interface
14
func (i *StubIntegration) MetricsHandler() (http.Handler, error) {
15
return http.NotFoundHandler(), nil
16
}
17
18
// ScrapeConfigs returns an empty list of scrape configs, since there is nothing to scrape
19
func (i *StubIntegration) ScrapeConfigs() []config.ScrapeConfig {
20
return []config.ScrapeConfig{}
21
}
22
23
// Run just waits for the context to finish
24
func (i *StubIntegration) Run(ctx context.Context) error {
25
<-ctx.Done()
26
return ctx.Err()
27
}
28
29