Skip to content

Commit

Permalink
feat(timeseries): add a new cloudmonitoring target
Browse files Browse the repository at this point in the history
  • Loading branch information
jlevesy committed Apr 7, 2024
1 parent bdd14e8 commit 45987f3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions timeseries/targets.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package timeseries

import (
"github.com/K-Phoen/grabana/target/cloudmonitoring"
"github.com/K-Phoen/grabana/target/graphite"
"github.com/K-Phoen/grabana/target/influxdb"
"github.com/K-Phoen/grabana/target/loki"
Expand Down Expand Up @@ -61,6 +62,14 @@ func WithStackdriverTarget(target *stackdriver.Stackdriver) Option {
}
}

// WithCloudMonitoringTarget adds a cloud monitoring query to the graph.
func WithCloudMonitoringTarget(target cloudmonitoring.Target) Option {
return func(graph *TimeSeries) error {
graph.Builder.AddTarget(target.Target())
return nil
}
}

// WithLokiTarget adds a loki query to the graph.
func WithLokiTarget(query string, options ...loki.Option) Option {
target := loki.New(query, options...)
Expand Down

0 comments on commit 45987f3

Please sign in to comment.