Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateCACertPool(files ...string) (*tls.Config, error)
- func GetAuthToken(apiTokenPath string) (token string, returnErr error)
- func GetAuthTokenForKubeAdm() (token string, returnErr error)
- func NewSecureClient(config *PrometheusSecureClientConfig) (api.Client, error)
- func NewSecureClientFromCert(config *PrometheusSecureClientConfig) (api.Client, error)
- func WithBasicAuth(rt http.RoundTripper, username, password string) http.RoundTripper
- func WithBearerAuth(rt http.RoundTripper, token string) http.RoundTripper
- func WithHeader(rt http.RoundTripper) withHeader
- type MeterDefinitionQuery
- type PromQuery
- type PromQueryArgs
- type PrometheusAPI
- func NewPromAPI(promService *corev1.Service, targetPort *corev1.ServicePort, caCert *[]byte, ...) (*PrometheusAPI, error)
- func NewPrometheusAPIForReporter(setup *PrometheusAPISetup) (*PrometheusAPI, error)
- func NewThanosAPI(promService *corev1.Service, caCert *[]byte, token string) (*PrometheusAPI, error)
- func ProvidePrometheusAPI(context context.Context, client client.Client, deployedNamespace string, ...) (*PrometheusAPI, error)
- type PrometheusAPIBuilder
- type PrometheusAPISetup
- type PrometheusAPIType
- type PrometheusSecureClientConfig
- type ResultQueryArgs
- type ServiceAccountClient
- type Token
- type UserAuth
Constants ¶
View Source
const TypeNotSupportedErr = errors.Sentinel("type is not supported")
Variables ¶
View Source
var ClientError = errors.Sentinel("clientError")
View Source
var ServerError = errors.Sentinel("serverError")
Functions ¶
func GetAuthToken ¶
func GetAuthTokenForKubeAdm ¶
func NewSecureClient ¶
func NewSecureClient(config *PrometheusSecureClientConfig) (api.Client, error)
func NewSecureClientFromCert ¶
func NewSecureClientFromCert(config *PrometheusSecureClientConfig) (api.Client, error)
func WithBasicAuth ¶
func WithBasicAuth(rt http.RoundTripper, username, password string) http.RoundTripper
func WithBearerAuth ¶
func WithBearerAuth(rt http.RoundTripper, token string) http.RoundTripper
func WithHeader ¶
func WithHeader(rt http.RoundTripper) withHeader
Types ¶
type MeterDefinitionQuery ¶
func (*MeterDefinitionQuery) Print ¶
func (q *MeterDefinitionQuery) Print() (string, error)
type PromQuery ¶
type PromQuery struct {
*PromQueryArgs
}
func NewPromQuery ¶
func NewPromQuery( args *PromQueryArgs, ) *PromQuery
func NewPromQueryFromLabels ¶
func NewPromQueryFromLabels( meterDefLabels *common.MeterDefPrometheusLabels, start, end time.Time, ) *PromQuery
func PromQueryFromLabels ¶
func PromQueryFromLabels( meterDefLabels *common.MeterDefPrometheusLabels, start, end time.Time, ) *PromQuery
func (*PromQuery) GetQueryArgs ¶
func (q *PromQuery) GetQueryArgs() ResultQueryArgs
type PromQueryArgs ¶
type PromQueryArgs struct { Type common.WorkloadType MeterDef types.NamespacedName Metric string Query string Start, End time.Time Step time.Duration AggregateFunc string LabelReplacePrefix string LabelReplaceSuffix string MetricType common.MetricType GroupBy []string Without []string // contains filtered or unexported fields }
type PrometheusAPI ¶
func NewPromAPI ¶
func NewPromAPI( promService *corev1.Service, targetPort *corev1.ServicePort, caCert *[]byte, token string, ) (*PrometheusAPI, error)
func NewPrometheusAPIForReporter ¶
func NewPrometheusAPIForReporter( setup *PrometheusAPISetup, ) (*PrometheusAPI, error)
func NewThanosAPI ¶
func ProvidePrometheusAPI ¶
func ProvidePrometheusAPI( context context.Context, client client.Client, deployedNamespace string, apiType PrometheusAPIType) (*PrometheusAPI, error)
func (*PrometheusAPI) MeterDefLabelValues ¶
func (p *PrometheusAPI) MeterDefLabelValues(matches []string) (model.LabelValues, v1.Warnings, error)
return LabelValues/MeterDefinition names seen in the last hour
func (*PrometheusAPI) QueryMeterDefinitions ¶
func (p *PrometheusAPI) QueryMeterDefinitions(query *MeterDefinitionQuery) (model.Value, v1.Warnings, error)
func (*PrometheusAPI) ReportQuery ¶
type PrometheusAPIBuilder ¶
type PrometheusAPIBuilder struct { Cfg *config.OperatorConfig Client client.Client // contains filtered or unexported fields }
func (*PrometheusAPIBuilder) Get ¶
func (p *PrometheusAPIBuilder) Get(apiType PrometheusAPIType) (*PrometheusAPI, error)
func (*PrometheusAPIBuilder) GetAPITypeFromFlag ¶
func (p *PrometheusAPIBuilder) GetAPITypeFromFlag(userWorkloadMonitoringEnabled bool) PrometheusAPIType
type PrometheusAPISetup ¶
type PrometheusAPISetup struct { Report *v1alpha1.MeterReport PromService *corev1.Service PromPort *corev1.ServicePort CertFilePath string TokenFilePath string RunLocal bool }
type PrometheusAPIType ¶
type PrometheusAPIType string
const RHMWorkload PrometheusAPIType = "RHMWorkload"
const UserWorkload PrometheusAPIType = "UserWorkload"
type ResultQueryArgs ¶
type ServiceAccountClient ¶
func NewServiceAccountClient ¶
func NewServiceAccountClient( namespace string, kubernetesInterface kubernetes.Interface, log logr.Logger, ) *ServiceAccountClient
Click to show internal directories.
Click to hide internal directories.