exporters

package
v0.2.40 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPAlertsList

type HTTPAlertsList struct {
	Kind       string             `json:"kind"`
	ApiVersion string             `json:"apiVersion"`
	Spec       HTTPAlertsListSpec `json:"spec"`
}

type HTTPAlertsListSpec

type HTTPAlertsListSpec struct {
	Alerts      []apitypes.RuntimeAlert `json:"alerts"`
	ProcessTree apitypes.ProcessTree    `json:"processTree"`
}

type HTTPExporter

type HTTPExporter struct {
	Host        string `json:"host"`
	ClusterName string `json:"clusterName"`
	// contains filtered or unexported fields
}

we will have a CRD-like json struct to send in the HTTP request

func InitHTTPExporter

func InitHTTPExporter(config HTTPExporterConfig, clusterName string) (*HTTPExporter, error)

InitHTTPExporter initializes an HTTPExporter with the given URL, headers, timeout, and method

func (*HTTPExporter) SendAdmissionAlert

func (exporter *HTTPExporter) SendAdmissionAlert(ruleFailure rules.RuleFailure)

type HTTPExporterConfig

type HTTPExporterConfig struct {
	// URL is the URL to send the HTTP request to
	URL string `json:"url"`
	// Headers is a map of headers to send in the HTTP request
	Headers map[string]string `json:"headers"`
	// Timeout is the timeout for the HTTP request
	TimeoutSeconds int `json:"timeoutSeconds"`
	// Method is the HTTP method to use for the HTTP request
	Method             string `json:"method"`
	MaxAlertsPerMinute int    `json:"maxAlertsPerMinute"`
}

func (*HTTPExporterConfig) Validate

func (config *HTTPExporterConfig) Validate() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL