Documentation ¶
Overview ¶
Package v1alpha1 contains API Schema definitions for the appo11y v1alpha1 API group +kubebuilder:object:generate=true +groupName=appo11y.grafana.com
Index ¶
- Constants
- Variables
- func AddInstrumenter(instrumenterName string, sidecar *v1.Container, dst *v1.Pod)
- func InstrumentIfRequired(iq *Instrumenter, dst *v1.Pod) bool
- func NeedsInstrumentation(iq *Instrumenter, dst *v1.Pod) (*v1.Container, bool)
- func RemoveInstrumenter(dst *v1.Pod)
- func SetupWebhookWithManager(mgr ctrl.Manager) error
- type Exporter
- type Instrumenter
- type InstrumenterList
- type InstrumenterSpec
- type InstrumenterStatus
- type OpenTelemetry
- type Prometheus
- type PrometheusAnnotations
- type Selector
Constants ¶
const ( ExporterPrometheus = "Prometheus" ExporterOTELMetrics = "OpenTelemetryMetrics" ExporterOTELTraces = "OpenTelemetryTraces" )
const (
InstrumentedLabel = "grafana.com/instrumented-by"
)
TODO: user-overridable
Variables ¶
var ( // GroupVersion is group version used to register these objects GroupVersion = schema.GroupVersion{Group: "appo11y.grafana.com", Version: "v1alpha1"} // SchemeBuilder is used to add go types to the GroupVersionKind scheme SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} // AddToScheme adds the types in this group-version to the given scheme. AddToScheme = SchemeBuilder.AddToScheme )
Functions ¶
func AddInstrumenter ¶
func InstrumentIfRequired ¶
func InstrumentIfRequired(iq *Instrumenter, dst *v1.Pod) bool
InstrumentIfRequired instruments, if needed, the destination pod, and returns whether it has been instrumented
func NeedsInstrumentation ¶
NeedsInstrumentation returns whether the given pod requires instrumentation, and a container with the instrumenter, in case of requiring it.
func RemoveInstrumenter ¶
func SetupWebhookWithManager ¶
SetupWebhookWithManager needs to manually register the webhook (not using the kubebuilder/operator-sdk workflow) as it needs to be registered towards a core type that is not registerd as type by the controller.
Types ¶
type Exporter ¶
type Exporter string
Exporter type for metrics +kubebuilder:validation:Enum:="Prometheus";"OpenTelemetryMetrics";"OpenTelemetryTraces"
type Instrumenter ¶
type Instrumenter struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec InstrumenterSpec `json:"spec,omitempty"` Status InstrumenterStatus `json:"status,omitempty"` }
Instrumenter is the Schema for the instrumenters API
func (*Instrumenter) DeepCopy ¶
func (in *Instrumenter) DeepCopy() *Instrumenter
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Instrumenter.
func (*Instrumenter) DeepCopyInto ¶
func (in *Instrumenter) DeepCopyInto(out *Instrumenter)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Instrumenter) DeepCopyObject ¶
func (in *Instrumenter) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type InstrumenterList ¶
type InstrumenterList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []Instrumenter `json:"items"` }
InstrumenterList contains a list of Instrumenter
func (*InstrumenterList) DeepCopy ¶
func (in *InstrumenterList) DeepCopy() *InstrumenterList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstrumenterList.
func (*InstrumenterList) DeepCopyInto ¶
func (in *InstrumenterList) DeepCopyInto(out *InstrumenterList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*InstrumenterList) DeepCopyObject ¶
func (in *InstrumenterList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type InstrumenterSpec ¶
type InstrumenterSpec struct { // Image allows overriding the autoinstrumenter container image for development purposes // +kubebuilder:validate:MinLength:=1 // +kubebuilder:default:="grafana/ebpf-autoinstrument:latest" // TODO: make Image values optional and use relatedImages sections in bundle Image string `json:"image,omitempty"` // ImagePullPolicy allows overriding the container pull policy for development purposes // +kubebuilder:default:="IfNotPresent" ImagePullPolicy v1.PullPolicy `json:"imagePullPolicy,omitempty"` // Exporters define the exporter endpoints that the autoinstrumenter must support // +optional // +kubebuilder:default:={"Prometheus"} Export []Exporter `json:"export"` // Selector overrides the selection of Pods and executables to instrument // +kubebuilder:default:={portLabel:"grafana.com/instrument-port"} Selector Selector `json:"selector,omitempty"` // Prometheus allows configuring the autoinstrumenter as a Prometheus pull exporter. // +kubebuilder:default:={path:"/metrics"} Prometheus Prometheus `json:"prometheus,omitempty"` // OpenTelemetry allows configuring the autoinstrumenter as an OpenTelemetry metrics // and traces exporter // +kubebuilder:default:={interval:"5s"} OpenTelemetry OpenTelemetry `json:"openTelemetry,omitempty"` // OverrideEnv allows overriding the autoinstrumenter env vars for fine-grained // configuration // +optional OverrideEnv []v1.EnvVar `json:"overrideEnv,omitempty"` }
InstrumenterSpec defines the desired state of Instrumenter
func (*InstrumenterSpec) DeepCopy ¶
func (in *InstrumenterSpec) DeepCopy() *InstrumenterSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstrumenterSpec.
func (*InstrumenterSpec) DeepCopyInto ¶
func (in *InstrumenterSpec) DeepCopyInto(out *InstrumenterSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type InstrumenterStatus ¶
type InstrumenterStatus struct { }
InstrumenterStatus defines the observed state of Instrumenter
func (*InstrumenterStatus) DeepCopy ¶
func (in *InstrumenterStatus) DeepCopy() *InstrumenterStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstrumenterStatus.
func (*InstrumenterStatus) DeepCopyInto ¶
func (in *InstrumenterStatus) DeepCopyInto(out *InstrumenterStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type OpenTelemetry ¶
type OpenTelemetry struct { // Endpoint of the OpenTelemetry collector // +optional // TODO: properly validate URL (or empty value) Endpoint string `json:"endpoint,omitempty"` // InsecureSkipVerify controls whether the instrumenter OTEL client verifies the server's // certificate chain and host name. // If set to `true`, the OTEL client accepts any certificate presented by the server // and any host name in that certificate. In this mode, TLS is susceptible to machine-in-the-middle // attacks. This option should be used only for testing and development purposes. // +kubebuilder:default:=false InsecureSkipVerify bool `json:"insecureSkipVerify,omitempty"` // Interval is the intervening time between metrics exports // +kubebuilder:default:="5s" Interval metav1.Duration `json:"interval,omitempty"` }
func (*OpenTelemetry) DeepCopy ¶
func (in *OpenTelemetry) DeepCopy() *OpenTelemetry
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenTelemetry.
func (*OpenTelemetry) DeepCopyInto ¶
func (in *OpenTelemetry) DeepCopyInto(out *OpenTelemetry)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Prometheus ¶
type Prometheus struct { // +kubebuilder:default:="/metrics" Path string `json:"path,omitempty"` // +kubebuilder:default:=9102 // +kubebuilder:validate:Minimum:=1 // +kubebuilder:validate:Maximum:=65535 Port int `json:"port,omitempty"` // +kubebuilder:default:={scrape:"prometheus.io/scrape"} Annotations PrometheusAnnotations `json:"annotations,omitempty"` }
func (*Prometheus) DeepCopy ¶
func (in *Prometheus) DeepCopy() *Prometheus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Prometheus.
func (*Prometheus) DeepCopyInto ¶
func (in *Prometheus) DeepCopyInto(out *Prometheus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PrometheusAnnotations ¶
type PrometheusAnnotations struct { // +kubebuilder:default:="prometheus.io/scrape" Scrape string `json:"scrape,omitempty"` // +kubebuilder:default:="prometheus.io/scheme" Scheme string `json:"scheme,omitempty"` // +kubebuilder:default:="prometheus.io/port" Port string `json:"port,omitempty"` // +kubebuilder:default:="prometheus.io/path" Path string `json:"path,omitempty"` }
func (*PrometheusAnnotations) DeepCopy ¶
func (in *PrometheusAnnotations) DeepCopy() *PrometheusAnnotations
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrometheusAnnotations.
func (*PrometheusAnnotations) DeepCopyInto ¶
func (in *PrometheusAnnotations) DeepCopyInto(out *PrometheusAnnotations)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Selector ¶
type Selector struct { // PortLabel specifies which Pod label would specify which executable needs to be instrumented, // according to the port it opens. // Any pod containing the label would be selected for instrumentation // +optional // +kubebuilder:default:="grafana.com/instrument-port" PortLabel string `json:"portLabel"` }
Selector allows selecting the Pod and executable to autoinstrument
func (*Selector) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Selector.
func (*Selector) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.