v1

package
v0.30.2 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 License: Apache-2.0 Imports: 9 Imported by: 49

Documentation

Overview

+k8s:deepcopy-gen=package +k8s:openapi-gen=true +gencrdrefdocs:force=true

Index

Constants

View Source
const (
	GroupName                = "monitoring.appscode.com"
	DefaultPrometheusKey     = GroupName + "/is-default-prometheus"
	DefaultAlertmanagerKey   = GroupName + "/is-default-alertmanager"
	DefaultGrafanaKey        = GroupName + "/is-default-grafana"
	PrometheusKey            = GroupName + "/prometheus"
	PrometheusValueAuto      = "auto"
	PrometheusValueFederated = "federated"
)
View Source
const (
	KeyAgent   = GroupName + "/agent"
	KeyService = GroupName + "/service"

	VendorPrometheus = "prometheus.io"

	AgentPrometheus         AgentType = VendorPrometheus
	AgentPrometheusBuiltin  AgentType = VendorPrometheus + "/builtin"
	AgentPrometheusOperator AgentType = VendorPrometheus + "/operator"

	PrometheusExporterPortNumber = 56790
	PrometheusExporterPortName   = "metrics"
)

Variables

This section is empty.

Functions

func GrafanaDatasource added in v0.25.3

func GrafanaDatasource(isDefault bool, clusterName, projectId string) string

func IsKnownAgentType

func IsKnownAgentType(at AgentType) bool

func TricksterBackend added in v0.25.3

func TricksterBackend(isDefault bool, ownerID int64, clusterUID, projectId string) string

Types

type Agent

type Agent interface {
	GetType() AgentType
	CreateOrUpdate(sp StatsAccessor, spec *AgentSpec) (kutil.VerbType, error)
	Delete(sp StatsAccessor) (kutil.VerbType, error)
}

type AgentSpec

type AgentSpec struct {
	Agent      AgentType       `json:"agent,omitempty"`
	Prometheus *PrometheusSpec `json:"prometheus,omitempty"`
}

func (*AgentSpec) DeepCopy

func (in *AgentSpec) DeepCopy() *AgentSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AgentSpec.

func (*AgentSpec) DeepCopyInto

func (in *AgentSpec) DeepCopyInto(out *AgentSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*AgentSpec) SetDefaults

func (agent *AgentSpec) SetDefaults()

func (*AgentSpec) SetSecurityContextDefaults added in v0.25.6

func (agent *AgentSpec) SetSecurityContextDefaults()

type AgentType

type AgentType string

+kubebuilder:validation:Enum=prometheus.io/operator;prometheus.io;prometheus.io/builtin

func (AgentType) Vendor

func (at AgentType) Vendor() string

type AlertPreset added in v0.25.2

type AlertPreset struct {
	Enabled SeverityFlag `json:"enabled"`
	// +optional
	Labels map[string]string `json:"labels"`
}

func (*AlertPreset) DeepCopy added in v0.25.2

func (in *AlertPreset) DeepCopy() *AlertPreset

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AlertPreset.

func (*AlertPreset) DeepCopyInto added in v0.25.2

func (in *AlertPreset) DeepCopyInto(out *AlertPreset)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BasicAuth added in v0.25.2

type BasicAuth struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

func (*BasicAuth) DeepCopy added in v0.25.2

func (in *BasicAuth) DeepCopy() *BasicAuth

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BasicAuth.

func (*BasicAuth) DeepCopyInto added in v0.25.2

func (in *BasicAuth) DeepCopyInto(out *BasicAuth)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DashboardSpec added in v0.25.2

type DashboardSpec struct {
	Datasource string `json:"datasource"`
	FolderID   int    `json:"folderID"`
}

func (*DashboardSpec) DeepCopy added in v0.25.2

func (in *DashboardSpec) DeepCopy() *DashboardSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DashboardSpec.

func (*DashboardSpec) DeepCopyInto added in v0.25.2

func (in *DashboardSpec) DeepCopyInto(out *DashboardSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type GrafanaConfig added in v0.25.2

type GrafanaConfig struct {
	URL         string        `json:"url"`
	Service     ServiceSpec   `json:"service"`
	BasicAuth   BasicAuth     `json:"basicAuth"`
	BearerToken string        `json:"bearerToken"`
	TLS         TLSConfig     `json:"tls"`
	Dashboard   DashboardSpec `json:"dashboard"`
}

func (*GrafanaConfig) DeepCopy added in v0.25.2

func (in *GrafanaConfig) DeepCopy() *GrafanaConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GrafanaConfig.

func (*GrafanaConfig) DeepCopyInto added in v0.25.2

func (in *GrafanaConfig) DeepCopyInto(out *GrafanaConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type GrafanaContext added in v0.25.3

type GrafanaContext struct {
	FolderID   *int64 `json:"folderID,omitempty"`
	Datasource string `json:"datasource,omitempty"`
}

func (*GrafanaContext) DeepCopy added in v0.25.3

func (in *GrafanaContext) DeepCopy() *GrafanaContext

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GrafanaContext.

func (*GrafanaContext) DeepCopyInto added in v0.25.3

func (in *GrafanaContext) DeepCopyInto(out *GrafanaContext)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MonitoringPresets added in v0.25.2

type MonitoringPresets struct {
	Spec MonitoringPresetsSpec `json:"spec,omitempty"`
	Form MonitoringPresetsForm `json:"form,omitempty"`
}

func (*MonitoringPresets) DeepCopy added in v0.25.2

func (in *MonitoringPresets) DeepCopy() *MonitoringPresets

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MonitoringPresets.

func (*MonitoringPresets) DeepCopyInto added in v0.25.2

func (in *MonitoringPresets) DeepCopyInto(out *MonitoringPresets)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MonitoringPresetsForm added in v0.25.2

type MonitoringPresetsForm struct {
	Alert AlertPreset `json:"alert"`
}

func (*MonitoringPresetsForm) DeepCopy added in v0.25.2

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MonitoringPresetsForm.

func (*MonitoringPresetsForm) DeepCopyInto added in v0.25.2

func (in *MonitoringPresetsForm) DeepCopyInto(out *MonitoringPresetsForm)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MonitoringPresetsSpec added in v0.25.2

type MonitoringPresetsSpec struct {
	Monitoring ServiceMonitorPreset `json:"monitoring"`
}

func (*MonitoringPresetsSpec) DeepCopy added in v0.25.2

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MonitoringPresetsSpec.

func (*MonitoringPresetsSpec) DeepCopyInto added in v0.25.2

func (in *MonitoringPresetsSpec) DeepCopyInto(out *MonitoringPresetsSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PrometheusConfig added in v0.25.2

type PrometheusConfig struct {
	URL         string      `json:"url"`
	Service     ServiceSpec `json:"service"`
	BasicAuth   BasicAuth   `json:"basicAuth"`
	BearerToken string      `json:"bearerToken"`
	TLS         TLSConfig   `json:"tls"`
}

func (*PrometheusConfig) DeepCopy added in v0.25.2

func (in *PrometheusConfig) DeepCopy() *PrometheusConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrometheusConfig.

func (*PrometheusConfig) DeepCopyInto added in v0.25.2

func (in *PrometheusConfig) DeepCopyInto(out *PrometheusConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PrometheusContext added in v0.25.3

type PrometheusContext struct {
	HubUID     string `json:"hubUID,omitempty"`
	ClusterUID string `json:"clusterUID"`
	ProjectId  string `json:"projectId,omitempty"`
	Default    bool   `json:"default"`
}

func (*PrometheusContext) DeepCopy added in v0.25.3

func (in *PrometheusContext) DeepCopy() *PrometheusContext

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrometheusContext.

func (*PrometheusContext) DeepCopyInto added in v0.25.3

func (in *PrometheusContext) DeepCopyInto(out *PrometheusContext)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PrometheusExporterSpec

type PrometheusExporterSpec struct {
	// Port number for the exporter side car.
	// +optional
	// +kubebuilder:default=56790
	Port int32 `json:"port,omitempty"`

	// Arguments to the entrypoint.
	// The docker image's CMD is used if this is not provided.
	// Variable references $(VAR_NAME) are expanded using the container's environment. If a variable
	// cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax
	// can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded,
	// regardless of whether the variable exists or not.
	// Cannot be updated.
	// More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell
	// +optional
	Args []string `json:"args,omitempty"`

	// List of environment variables to set in the container.
	// Cannot be updated.
	// +optional
	// +patchMergeKey=name
	// +patchStrategy=merge
	Env []core.EnvVar `json:"env,omitempty" patchStrategy:"merge" patchMergeKey:"name"`

	// Compute Resources required by exporter container.
	// Cannot be updated.
	// More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/
	// +optional
	Resources core.ResourceRequirements `json:"resources,omitempty"`

	// Security options the pod should run with.
	// More info: https://kubernetes.io/docs/concepts/policy/security-context/
	// More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
	// +optional
	SecurityContext *core.SecurityContext `json:"securityContext,omitempty"`
}

func (*PrometheusExporterSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrometheusExporterSpec.

func (*PrometheusExporterSpec) DeepCopyInto

func (in *PrometheusExporterSpec) DeepCopyInto(out *PrometheusExporterSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PrometheusSpec

type PrometheusSpec struct {
	Exporter       PrometheusExporterSpec `json:"exporter,omitempty"`
	ServiceMonitor *ServiceMonitorSpec    `json:"serviceMonitor,omitempty"`
}

func (*PrometheusSpec) DeepCopy

func (in *PrometheusSpec) DeepCopy() *PrometheusSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrometheusSpec.

func (*PrometheusSpec) DeepCopyInto

func (in *PrometheusSpec) DeepCopyInto(out *PrometheusSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ServiceMonitorLabels added in v0.25.2

type ServiceMonitorLabels struct {
	// +optional
	Labels map[string]string `json:"labels"`
}

func (*ServiceMonitorLabels) DeepCopy added in v0.25.2

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceMonitorLabels.

func (*ServiceMonitorLabels) DeepCopyInto added in v0.25.2

func (in *ServiceMonitorLabels) DeepCopyInto(out *ServiceMonitorLabels)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ServiceMonitorPreset added in v0.25.2

type ServiceMonitorPreset struct {
	Agent          string               `json:"agent"`
	ServiceMonitor ServiceMonitorLabels `json:"serviceMonitor"`
}

func (*ServiceMonitorPreset) DeepCopy added in v0.25.2

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceMonitorPreset.

func (*ServiceMonitorPreset) DeepCopyInto added in v0.25.2

func (in *ServiceMonitorPreset) DeepCopyInto(out *ServiceMonitorPreset)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ServiceMonitorSpec

type ServiceMonitorSpec struct {
	// Labels are key value pairs that is used to select Prometheus instance via ServiceMonitor labels.
	// +optional
	Labels map[string]string `json:"labels,omitempty"`

	// Interval at which metrics should be scraped
	// +optional
	Interval string `json:"interval,omitempty"`
}

func (*ServiceMonitorSpec) DeepCopy

func (in *ServiceMonitorSpec) DeepCopy() *ServiceMonitorSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceMonitorSpec.

func (*ServiceMonitorSpec) DeepCopyInto

func (in *ServiceMonitorSpec) DeepCopyInto(out *ServiceMonitorSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ServiceSpec added in v0.25.2

type ServiceSpec struct {
	Scheme    string `json:"scheme"`
	Name      string `json:"name"`
	Namespace string `json:"namespace"`
	Port      string `json:"port"`
	Path      string `json:"path"`
	Query     string `json:"query"`
}

func (*ServiceSpec) DeepCopy added in v0.25.2

func (in *ServiceSpec) DeepCopy() *ServiceSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceSpec.

func (*ServiceSpec) DeepCopyInto added in v0.25.2

func (in *ServiceSpec) DeepCopyInto(out *ServiceSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SeverityFlag added in v0.25.2

type SeverityFlag string

+kubebuilder:validation:Enum=none;critical;warning;info

const (
	SeverityFlagNone     SeverityFlag = "none"     // 0
	SeverityFlagCritical SeverityFlag = "critical" // 1
	SeverityFlagWarning  SeverityFlag = "warning"  // 2
	SeverityFlagInfo     SeverityFlag = "info"     // 3
)

type StatsAccessor

type StatsAccessor interface {
	GetNamespace() string
	ServiceName() string
	ServiceMonitorName() string
	ServiceMonitorAdditionalLabels() map[string]string
	Path() string
	// Scheme is used to determine url scheme /metrics endpoint
	Scheme() string
	TLSConfig() *promapi.TLSConfig
}

type TLSConfig added in v0.25.2

type TLSConfig struct {
	Ca                    string `json:"ca"`
	Cert                  string `json:"cert"`
	Key                   string `json:"key"`
	ServerName            string `json:"serverName"`
	InsecureSkipTLSVerify bool   `json:"insecureSkipTLSVerify"`
}

func (*TLSConfig) DeepCopy added in v0.25.2

func (in *TLSConfig) DeepCopy() *TLSConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TLSConfig.

func (*TLSConfig) DeepCopyInto added in v0.25.2

func (in *TLSConfig) DeepCopyInto(out *TLSConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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