Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertEvaluatorAlias(alias string) string
- func NewGrafanaClient(ctx context.Context, r logr.Logger, apiURI string, setters ...Option) error
- type Alert
- type Annotation
- type Client
- func (c *Client) PatchAnnotation(reqID uint, ga sdk.PatchAnnotationRequest)
- func (c *Client) SetAlert(alert *Alert) (uint, error)
- func (c *Client) SetAnnotation(ga sdk.CreateAnnotationRequest) (reqID uint)
- func (c *Client) SetNotificationChannel(webhookPort string, cb func(b *notifier.Body)) error
- func (c *Client) UnsetAlert(alertID string)
- type Metric
- type Option
- type Options
- type PointAnnotation
- type Query
- type RangeAnnotation
- type TimeRange
Constants ¶
const ( AnnotationRun = "run" AnnotationExit = "exit" AnnotationFailure = "failure" )
Variables ¶
var AnnotationTimeout = 30 * time.Second
var (
Assertor *regexp.Regexp
)
Functions ¶
func ConvertEvaluatorAlias ¶
Types ¶
type Annotation ¶
type Annotation interface { // Add pushes an annotation to grafana indicating that a new component has joined the experiment. Add(obj client.Object) // Delete pushes an annotation to grafana indicating that a new component has left the experiment. Delete(obj client.Object) }
Annotation provides a way to mark points on the graph with rich events. // When you hover over an annotation you can get event description and event tags. // The text field can include links to other systems with more detail.
type Client ¶
var DefaultClient *Client
func (*Client) PatchAnnotation ¶
func (c *Client) PatchAnnotation(reqID uint, ga sdk.PatchAnnotationRequest)
PatchAnnotation updates an existing annotation to Grafana.
func (*Client) SetAnnotation ¶
func (c *Client) SetAnnotation(ga sdk.CreateAnnotationRequest) (reqID uint)
SetAnnotation inserts a new annotation to Grafana.
func (*Client) SetNotificationChannel ¶
func (*Client) UnsetAlert ¶
UnsetAlert removes an alert from Grafana.
type Metric ¶
Metric points to the Grafana metric we are interested in. The location can retrieved from the Grafana URL. Example: URL: http://grafana.platform.science-hangar.eu/d/wpFnYRwGk/iperf?orgId=1&viewPanel=2 Metric: wpFnYRwGk/2/bitrate
type Option ¶
type Option func(*Options)
func WithNotifyOnAlert ¶
WithNotifyOnAlert will update the object's annotations if a Grafana alert is triggered
type PointAnnotation ¶
type PointAnnotation struct{}
func (*PointAnnotation) Add ¶
func (a *PointAnnotation) Add(obj client.Object)
func (*PointAnnotation) Delete ¶
func (a *PointAnnotation) Delete(obj client.Object)
type Query ¶
type Query struct { /* == Evaluator * below * above * within_range * outside_range * empty */ Evaluator sdk.AlertEvaluator /* == Reducers * avg * min * max * sum */ Reducer sdk.AlertReducer }
type RangeAnnotation ¶
type RangeAnnotation struct {
// contains filtered or unexported fields
}
RangeAnnotation uses range annotations to indicate the duration of a Chaos. It consists of two parts. In the first part, a failure annotation is created with open end. When a new value is pushed to the timeEnd channel, the annotation is updated accordingly. TimeEnd channel can be used as many times as wished. The client is responsible to close the channel.
func (*RangeAnnotation) Add ¶
func (a *RangeAnnotation) Add(obj client.Object)
func (*RangeAnnotation) Delete ¶
func (a *RangeAnnotation) Delete(obj client.Object)