v1

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2022 License: Apache-2.0 Imports: 12 Imported by: 48

Documentation

Overview

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

Index

Constants

View Source
const (
	DefaultPrometheusKey   = "monitoring.appscode.com/is-default-prometheus"
	DefaultAlertmanagerKey = "monitoring.appscode.com/is-default-alertmanager"
	DefaultGrafanaKey      = "monitoring.appscode.com/is-default-grafana"
)
View Source
const (
	KeyAgent   = "monitoring.appscode.com/agent"
	KeyService = "monitoring.appscode.com/service"

	VendorPrometheus = "prometheus.io"

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

	PrometheusExporterPortNumber = 56790
	PrometheusExporterPortName   = "metrics"
)

Variables

View Source
var (
	ErrInvalidLengthGenerated        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowGenerated          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupGenerated = fmt.Errorf("proto: unexpected end of group")
)

Functions

func IsKnownAgentType

func IsKnownAgentType(at AgentType) bool

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" protobuf:"bytes,1,opt,name=agent,casttype=AgentType"`
	Prometheus *PrometheusSpec `json:"prometheus,omitempty" protobuf:"bytes,2,opt,name=prometheus"`
}

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) Descriptor

func (*AgentSpec) Descriptor() ([]byte, []int)

func (*AgentSpec) Marshal

func (m *AgentSpec) Marshal() (dAtA []byte, err error)

func (*AgentSpec) MarshalTo

func (m *AgentSpec) MarshalTo(dAtA []byte) (int, error)

func (*AgentSpec) MarshalToSizedBuffer

func (m *AgentSpec) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*AgentSpec) ProtoMessage

func (*AgentSpec) ProtoMessage()

func (*AgentSpec) Reset

func (m *AgentSpec) Reset()

func (*AgentSpec) SetDefaults

func (agent *AgentSpec) SetDefaults()

func (*AgentSpec) Size

func (m *AgentSpec) Size() (n int)

func (*AgentSpec) String

func (this *AgentSpec) String() string

func (*AgentSpec) Unmarshal

func (m *AgentSpec) Unmarshal(dAtA []byte) error

func (*AgentSpec) XXX_DiscardUnknown

func (m *AgentSpec) XXX_DiscardUnknown()

func (*AgentSpec) XXX_Marshal

func (m *AgentSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AgentSpec) XXX_Merge

func (m *AgentSpec) XXX_Merge(src proto.Message)

func (*AgentSpec) XXX_Size

func (m *AgentSpec) XXX_Size() int

func (*AgentSpec) XXX_Unmarshal

func (m *AgentSpec) XXX_Unmarshal(b []byte) error

type AgentType

type AgentType string

func (AgentType) Vendor

func (at AgentType) Vendor() string

type PrometheusExporterSpec

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

	// 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" protobuf:"bytes,2,rep,name=args"`

	// 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" protobuf:"bytes,3,rep,name=env"`

	// 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" protobuf:"bytes,4,opt,name=resources"`

	// 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" protobuf:"bytes,5,opt,name=securityContext"`
}

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.

func (*PrometheusExporterSpec) Descriptor

func (*PrometheusExporterSpec) Descriptor() ([]byte, []int)

func (*PrometheusExporterSpec) Marshal

func (m *PrometheusExporterSpec) Marshal() (dAtA []byte, err error)

func (*PrometheusExporterSpec) MarshalTo

func (m *PrometheusExporterSpec) MarshalTo(dAtA []byte) (int, error)

func (*PrometheusExporterSpec) MarshalToSizedBuffer

func (m *PrometheusExporterSpec) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PrometheusExporterSpec) ProtoMessage

func (*PrometheusExporterSpec) ProtoMessage()

func (*PrometheusExporterSpec) Reset

func (m *PrometheusExporterSpec) Reset()

func (*PrometheusExporterSpec) Size

func (m *PrometheusExporterSpec) Size() (n int)

func (*PrometheusExporterSpec) String

func (this *PrometheusExporterSpec) String() string

func (*PrometheusExporterSpec) Unmarshal

func (m *PrometheusExporterSpec) Unmarshal(dAtA []byte) error

func (*PrometheusExporterSpec) XXX_DiscardUnknown

func (m *PrometheusExporterSpec) XXX_DiscardUnknown()

func (*PrometheusExporterSpec) XXX_Marshal

func (m *PrometheusExporterSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PrometheusExporterSpec) XXX_Merge

func (m *PrometheusExporterSpec) XXX_Merge(src proto.Message)

func (*PrometheusExporterSpec) XXX_Size

func (m *PrometheusExporterSpec) XXX_Size() int

func (*PrometheusExporterSpec) XXX_Unmarshal

func (m *PrometheusExporterSpec) XXX_Unmarshal(b []byte) error

type PrometheusSpec

type PrometheusSpec struct {
	Exporter       PrometheusExporterSpec `json:"exporter,omitempty" protobuf:"bytes,1,opt,name=exporter"`
	ServiceMonitor *ServiceMonitorSpec    `json:"serviceMonitor,omitempty" protobuf:"bytes,2,opt,name=serviceMonitor"`
}

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.

func (*PrometheusSpec) Descriptor

func (*PrometheusSpec) Descriptor() ([]byte, []int)

func (*PrometheusSpec) Marshal

func (m *PrometheusSpec) Marshal() (dAtA []byte, err error)

func (*PrometheusSpec) MarshalTo

func (m *PrometheusSpec) MarshalTo(dAtA []byte) (int, error)

func (*PrometheusSpec) MarshalToSizedBuffer

func (m *PrometheusSpec) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PrometheusSpec) ProtoMessage

func (*PrometheusSpec) ProtoMessage()

func (*PrometheusSpec) Reset

func (m *PrometheusSpec) Reset()

func (*PrometheusSpec) Size

func (m *PrometheusSpec) Size() (n int)

func (*PrometheusSpec) String

func (this *PrometheusSpec) String() string

func (*PrometheusSpec) Unmarshal

func (m *PrometheusSpec) Unmarshal(dAtA []byte) error

func (*PrometheusSpec) XXX_DiscardUnknown

func (m *PrometheusSpec) XXX_DiscardUnknown()

func (*PrometheusSpec) XXX_Marshal

func (m *PrometheusSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PrometheusSpec) XXX_Merge

func (m *PrometheusSpec) XXX_Merge(src proto.Message)

func (*PrometheusSpec) XXX_Size

func (m *PrometheusSpec) XXX_Size() int

func (*PrometheusSpec) XXX_Unmarshal

func (m *PrometheusSpec) XXX_Unmarshal(b []byte) error

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" protobuf:"bytes,1,rep,name=labels"`

	// Interval at which metrics should be scraped
	// +optional
	Interval string `json:"interval,omitempty" protobuf:"bytes,2,opt,name=interval"`
}

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.

func (*ServiceMonitorSpec) Descriptor

func (*ServiceMonitorSpec) Descriptor() ([]byte, []int)

func (*ServiceMonitorSpec) Marshal

func (m *ServiceMonitorSpec) Marshal() (dAtA []byte, err error)

func (*ServiceMonitorSpec) MarshalTo

func (m *ServiceMonitorSpec) MarshalTo(dAtA []byte) (int, error)

func (*ServiceMonitorSpec) MarshalToSizedBuffer

func (m *ServiceMonitorSpec) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ServiceMonitorSpec) ProtoMessage

func (*ServiceMonitorSpec) ProtoMessage()

func (*ServiceMonitorSpec) Reset

func (m *ServiceMonitorSpec) Reset()

func (*ServiceMonitorSpec) Size

func (m *ServiceMonitorSpec) Size() (n int)

func (*ServiceMonitorSpec) String

func (this *ServiceMonitorSpec) String() string

func (*ServiceMonitorSpec) Unmarshal

func (m *ServiceMonitorSpec) Unmarshal(dAtA []byte) error

func (*ServiceMonitorSpec) XXX_DiscardUnknown

func (m *ServiceMonitorSpec) XXX_DiscardUnknown()

func (*ServiceMonitorSpec) XXX_Marshal

func (m *ServiceMonitorSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ServiceMonitorSpec) XXX_Merge

func (m *ServiceMonitorSpec) XXX_Merge(src proto.Message)

func (*ServiceMonitorSpec) XXX_Size

func (m *ServiceMonitorSpec) XXX_Size() int

func (*ServiceMonitorSpec) XXX_Unmarshal

func (m *ServiceMonitorSpec) XXX_Unmarshal(b []byte) error

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
}

Jump to

Keyboard shortcuts

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