MCPcopy
hub / github.com/prometheus/client_golang / Run

Method Run

prometheus/graphite/bridge.go:150–163  ·  view source on GitHub ↗

Run starts the event loop that pushes Prometheus metrics to Graphite at the configured interval.

(ctx context.Context)

Source from the content-addressed store, hash-verified

148// Run starts the event loop that pushes Prometheus metrics to Graphite at the
149// configured interval.
150func (b *Bridge) Run(ctx context.Context) {
151 ticker := time.NewTicker(b.interval)
152 defer ticker.Stop()
153 for {
154 select {
155 case <-ticker.C:
156 if err := b.Push(); err != nil && b.logger != nil {
157 b.logger.Println("error pushing to Graphite:", err)
158 }
159 case <-ctx.Done():
160 return
161 }
162 }
163}
164
165// Push pushes Prometheus metrics to the configured Graphite server.
166func (b *Bridge) Push() error {

Callers 15

ExampleBridgeFunction · 0.95
TestNativeHistogramFunction · 0.80
TestConstNativeHistogramFunction · 0.80
TestWrapRegistererFunction · 0.80
TestWrapCollectorFunction · 0.80
TestAlreadyRegisteredFunction · 0.80
TestNewMultiTRegistryFunction · 0.80
TestWithExemplarsMetricFunction · 0.80

Calls 2

PushMethod · 0.95
PrintlnMethod · 0.65

Tested by 15

ExampleBridgeFunction · 0.76
TestNativeHistogramFunction · 0.64
TestConstNativeHistogramFunction · 0.64
TestWrapRegistererFunction · 0.64
TestWrapCollectorFunction · 0.64
TestAlreadyRegisteredFunction · 0.64
TestNewMultiTRegistryFunction · 0.64
TestWithExemplarsMetricFunction · 0.64