v1alpha1

package
v0.0.0-...-0950592 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2023 License: Apache-2.0 Imports: 4 Imported by: 3

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the metrics v1alpha1 API group +kubebuilder:object:generate=true +groupName=metrics.turbonomic.io

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "metrics.turbonomic.io", 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

This section is empty.

Types

type AttributeConfiguration

type AttributeConfiguration struct {
	// The name of the attribute
	Name string `json:"name"`

	// Label is the name of the label that contains the value for this attribute.
	// If the Matches field is not specified, the value of this label will be used as the attribute value.
	Label string `json:"label"`

	// Matches is an optional regular expression that can be used to extract a pattern from the label value and
	// use that as the attribute value.
	// +optional
	Matches string `json:"matches,omitempty"`

	// As is an optional field that specifies how to reconstruct the extracted patterns from the result of the
	// Matches field and use that as the attribute value instead. This field is only evaluated when the Matches
	// field is specified.
	// +optional
	As string `json:"as,omitempty"`

	// IsIdentifier is an optional field that specifies if this attribute should be used as the identifier of an entity.
	// There should be one and only one identifier for an entity.
	// +optional
	IsIdentifier bool `json:"isIdentifier,omitempty"`
}

The AttributeConfiguration specifies how to map labels from Prometheus metrics into attributes of an entity.

type ClusterConfiguration

type ClusterConfiguration struct {
	// The Identifier field is an optional field that specifies the cluster identifier for a Prometurbo probe.
	// If this field is not specified, the probe will default to the cluster where it is running.
	// +optional
	Identifier ClusterIdentifier `json:"identifier,omitempty"`

	// The QueryMappingSelector field is an optional field that specifies a label selector for PrometheusQueryMapping
	// resources. This field is of type *metav1.LabelSelector, which is a Kubernetes API type that represents
	// a label selector.
	// If the QueryMappingSelector field is not defined, it will default to all PrometheusQueryMapping resources in the
	// current namespace. If it is defined, it should be set to a valid label selector that can be used to identify
	// the desired resources.
	// +optional
	QueryMappingSelector *metav1.LabelSelector `json:"queryMappingSelector,omitempty"`
}

The ClusterConfiguration struct is used to configure the behavior of a Prometurbo probe when collecting metrics from a cluster.

type ClusterIdentifier

type ClusterIdentifier struct {
	// The ClusterLabels that store the labels that identify the cluster when executing PromQL queries
	// against the Prometheus server.
	// Use this field to specify different labels for each cluster.
	// These labels will be used in PromQL queries to filter metrics from a specific cluster.
	// For example, the following labels could be used to select metrics from the "production" cluster in the
	// "us-west-2" region.
	//     clusterLabels := map[string]string {
	//         "cluster": "production",
	//         "region":  "us-west-2",
	//     }
	ClusterLabels map[string]string `json:"clusterLabels"`

	// The unique ID of the cluster.
	// Get the ID by running the following command inside the cluster:
	//     kubectl -n default get svc kubernetes -ojsonpath='{.metadata.uid}'
	// The resulting output should be the Kubernetes service ID, which is a version 4 UUID.
	// For example, 5f2bd289-20b8-4c3c-be48-f5c5d8ff9c82.
	// +kubebuilder:validation:Pattern:="^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
	ID string `json:"id"`
}

The ClusterIdentifier struct is used to identify a Kubernetes cluster and provide labels to be used in PromQL queries when you are monitoring multiple Kubernetes clusters.

type ClusterStatus

type ClusterStatus struct {
	// ID is the unique ID that identifies the cluster.
	ID string `json:"id"`

	// Entities is a list of EntityStatus objects.
	// This field is omitted if there are no entities found in the cluster.
	Entities []EntityStatus `json:"entities,omitempty"`

	// LastDiscoveryTime is a metav1.Time object that indicates when the cluster was last discovered.
	// This field is optional and can be omitted if the discovery time is not known.
	LastDiscoveryTime *metav1.Time `json:"lastDiscoveryTime,omitempty"`
}

The ClusterStatus struct defines the status of a cluster.

type EntityConfiguration

type EntityConfiguration struct {
	// Type specifies the type of entity.
	// This field is required and must be one of application, databaseServer, or virtualMachine.
	// +kubebuilder:validation:Enum=application;databaseServer;virtualMachine
	Type string `json:"type"`

	// HostedOnVM specifies if an entity is hosted on VM
	// If not set, the entity is assumed to be hosted on a container
	HostedOnVM bool `json:"hostedOnVM,omitempty"`

	// MetricConfigs is a list of MetricConfiguration objects that specify how to collect metrics for the entity.
	// This field is required and must contain at least one metric configuration.
	// +kubebuilder:validation:MinItems=1
	MetricConfigs []MetricConfiguration `json:"metrics"`

	// AttributeConfigs is a list of AttributeConfiguration objects that specify how to map labels into attributes
	// of the entity. This field is required and must contain at least one attribute configuration.
	// +listType=map
	// +listMapKey=name
	// +kubebuilder:validation:MinItems=1
	AttributeConfigs []AttributeConfiguration `json:"attributes"`
}

The EntityConfiguration defines the configuration for mapping from Prometheus query result to a specific type of Turbonomic entity.

type EntityStatus

type EntityStatus struct {
	// Type is a string that specifies the type of entity.
	Type string `json:"type"`

	// Count is a pointer to an int32 that represents the number of entities of this type in the cluster.
	// If this field is nil, it means that the number of entities is unknown or has not been discovered yet.
	Count *int32 `json:"count"`
}

The EntityStatus represents the status of an entity in a cluster.

type MetricConfiguration

type MetricConfiguration struct {
	// Type specifies the type of metric
	// +kubebuilder:validation:Enum=responseTime;transaction;heap;collectionTime;cacheHitRate;dbMem;cpu;memory
	Type string `json:"type"`

	// QueryConfigs is a list of QueryConfiguration structs.
	// +listType=map
	// +listMapKey=type
	// +kubebuilder:validation:MinItems=1
	QueryConfigs []QueryConfiguration `json:"queries"`
}

The MetricConfiguration is a struct that represents the configuration for a specific type of metric.

type PrometheusQueryMapping

type PrometheusQueryMapping struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   PrometheusQueryMappingSpec   `json:"spec,omitempty"`
	Status PrometheusQueryMappingStatus `json:"status,omitempty"`
}

PrometheusQueryMapping is the Schema for the prometheusquerymappings API

func (*PrometheusQueryMapping) DeepCopy

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

func (*PrometheusQueryMapping) DeepCopyInto

func (in *PrometheusQueryMapping) DeepCopyInto(out *PrometheusQueryMapping)

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

func (*PrometheusQueryMapping) DeepCopyObject

func (in *PrometheusQueryMapping) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type PrometheusQueryMappingList

type PrometheusQueryMappingList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []PrometheusQueryMapping `json:"items"`
}

PrometheusQueryMappingList contains a list of PrometheusQueryMapping

func (*PrometheusQueryMappingList) DeepCopy

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

func (*PrometheusQueryMappingList) DeepCopyInto

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

func (*PrometheusQueryMappingList) DeepCopyObject

func (in *PrometheusQueryMappingList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type PrometheusQueryMappingSpec

type PrometheusQueryMappingSpec struct {
	// EntityConfigs specifies how Turbonomic entities can be mapped from Prometheus
	// query result
	// +kubebuilder:validation:MinItems:=1
	EntityConfigs []EntityConfiguration `json:"entities"`
}

PrometheusQueryMappingSpec defines the desired state of PrometheusQueryMapping

func (*PrometheusQueryMappingSpec) DeepCopy

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

func (*PrometheusQueryMappingSpec) DeepCopyInto

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

type PrometheusQueryMappingStatus

type PrometheusQueryMappingStatus struct {
	// +optional
	State PrometheusQueryMappingStatusType `json:"state,omitempty"`
	// +optional
	Reason PrometheusQueryMappingStatusReason `json:"reason,omitempty"`
	// +optional
	Message string `json:"message,omitempty"`
}

PrometheusQueryMappingStatus defines the observed state of PrometheusQueryMapping

func (*PrometheusQueryMappingStatus) DeepCopy

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

func (*PrometheusQueryMappingStatus) DeepCopyInto

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

type PrometheusQueryMappingStatusReason

type PrometheusQueryMappingStatusReason string
const (
	PrometheusQueryMappingInvalidPromQLSyntax        PrometheusQueryMappingStatusReason = "InvalidPromQLSyntax"
	PrometheusQueryMappingInvalidMetricDefinition    PrometheusQueryMappingStatusReason = "InvalidMetricDefinition"
	PrometheusQueryMappingInvalidAttributeDefinition PrometheusQueryMappingStatusReason = "InvalidAttributeDefinition"
)

type PrometheusQueryMappingStatusType

type PrometheusQueryMappingStatusType string
const (
	PrometheusQueryMappingStatusOK    PrometheusQueryMappingStatusType = "ok"
	PrometheusQueryMappingStatusError PrometheusQueryMappingStatusType = "error"
)

type PrometheusServerConfig

type PrometheusServerConfig struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   PrometheusServerConfigSpec   `json:"spec,omitempty"`
	Status PrometheusServerConfigStatus `json:"status,omitempty"`
}

PrometheusServerConfig is the Schema for the prometheusserverconfigs API

func (*PrometheusServerConfig) DeepCopy

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

func (*PrometheusServerConfig) DeepCopyInto

func (in *PrometheusServerConfig) DeepCopyInto(out *PrometheusServerConfig)

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

func (*PrometheusServerConfig) DeepCopyObject

func (in *PrometheusServerConfig) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type PrometheusServerConfigList

type PrometheusServerConfigList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []PrometheusServerConfig `json:"items"`
}

PrometheusServerConfigList contains a list of PrometheusServerConfig

func (*PrometheusServerConfigList) DeepCopy

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

func (*PrometheusServerConfigList) DeepCopyInto

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

func (*PrometheusServerConfigList) DeepCopyObject

func (in *PrometheusServerConfigList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type PrometheusServerConfigSpec

type PrometheusServerConfigSpec struct {
	// Address of the Prometheus server.
	Address string `json:"address"`

	// ClusterConfigs is an optional list of ClusterConfiguration structs that specify information about the clusters
	// that the Prometheus server should obtain metrics for.
	// If this field is not specified, the Prometheus server obtains metrics only for the cluster where the
	// Prometurbo probe is running.
	// +optional
	ClusterConfigs []ClusterConfiguration `json:"clusters,omitempty"`
}

PrometheusServerConfigSpec defines the desired state of PrometheusServerConfig

func (*PrometheusServerConfigSpec) DeepCopy

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

func (*PrometheusServerConfigSpec) DeepCopyInto

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

type PrometheusServerConfigStatus

type PrometheusServerConfigStatus struct {
	// +optional
	State PrometheusServerConfigStatusType `json:"state,omitempty"`

	// +optional
	Reason PrometheusServerConfigStatusReason `json:"reason,omitempty"`

	// +optional
	Message string `json:"message,omitempty"`

	// +optional
	Clusters []ClusterStatus `json:"clusters,omitempty"`
}

PrometheusServerConfigStatus defines the observed state of PrometheusServerConfig

func (*PrometheusServerConfigStatus) DeepCopy

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

func (*PrometheusServerConfigStatus) DeepCopyInto

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

type PrometheusServerConfigStatusReason

type PrometheusServerConfigStatusReason string
const (
	PrometheusServerConfigConnectionFailure     PrometheusServerConfigStatusReason = "ConnectionFailure"
	PrometheusServerConfigAuthenticationFailure PrometheusServerConfigStatusReason = "AuthenticationFailure"
)

type PrometheusServerConfigStatusType

type PrometheusServerConfigStatusType string
const (
	PrometheusServerConfigStatusOK    PrometheusServerConfigStatusType = "ok"
	PrometheusServerConfigStatusError PrometheusServerConfigStatusType = "error"
)

type QueryConfiguration

type QueryConfiguration struct {
	// Type specifies the subtype of metric, for example, "used", "capacity", or "peak".
	// +kubebuilder:validation:Enum=used;capacity;peak
	Type string `json:"type"`

	// PromQL is a string that contains the PromQL query that will be used to collect data for the metric.
	PromQL string `json:"promql"`
}

The QueryConfiguration struct represents a specific query that will be used to collect data for the metric.

Jump to

Keyboard shortcuts

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